@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(); }
private boolean executeTestAndCollectRuntimeValues( Object result, TestCase currentTest, ClassLoader unitTestClassLoader, SpecificationTestCasesListener<T> listener) { LoggingInstrumenter.setValue(result); Result testResult = TestSuiteExecution.runTestCase(currentTest, unitTestClassLoader, listener); if (testResult.getFailureCount() == 0) { return true; } return false; }