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

    if (this.find) {
      logging.disable();
      TestSuiteExecution.runTestResult(testClasses, unitTestClassLoader, listener);
    }
    return listener.specifications();
  }