Class ContractsRan

java.lang.Object
me.ahoo.cosid.store.tck.ContractsRan

public final class ContractsRan extends Object
Checks from the JUnit XML reports of a backend that its contract cases really ran (roadmap R2: a CI job that silently skipped its backend must fail). For each contract, some test class extending it must have reported every case of the contract as passed; a case marked OptionalCapability may be skipped.

Run it on the test runtime classpath of the backend, after its tests: ContractsRan <report dir> [contract class ...]; the contracts default to RangeStoreContract and SlotLeaseStoreContract. It exits with status 1 and lists the problems when a case did not run.

  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Checks the reports in args[0] against the contracts named by the other arguments.
      Parameters:
      args - the report directory, then the contract classes
      Throws:
      Exception - if a report or a class cannot be read
    • check

      public static List<String> check(Path reportDir, List<Class<?>> contracts, ClassLoader classLoader) throws IOException
      Lists the contract cases that no report shows as run.
      Parameters:
      reportDir - the directory of the TEST-*.xml reports
      contracts - the contract classes
      classLoader - loads the test classes the reports name
      Returns:
      the problems; empty when every case ran
      Throws:
      IOException - if a report cannot be read