Beispiel #1
0
  @Override
  public Collection<Specification<T>> buildFor(
      final URL[] classpath, final String[] testClasses, final Collection<TestCase> failures) {
    final LoggingInstrumenter<T> logging = createLoggingInstrumenter();
    SpoonedClass fork = cleanSpoon.forked(sourceLocation.getContainingClassName());
    final ClassLoader unitTestClassLoader = fork.processedAndDumpedToClassLoader(logging);

    final SpecificationTestCasesListener<T> listener =
        run(classpath, failures, unitTestClassLoader);

    if (this.find) {
      logging.disable();
      TestSuiteExecution.runCasesIn(testClasses, unitTestClassLoader, listener);
    }
    return listener.specifications();
  }
Beispiel #2
0
 private Collection<TestCase> failingTests(String[] testClasses) {
   TestCasesListener listener = new TestCasesListener();
   TestSuiteExecution.runCasesIn(testClasses, spooner.dumpedToClassLoader(), listener);
   return listener.failedTests();
 }