public static void main(String[] args) { final Result result = JUnitCore.runClasses( codeu.chat.common.SecretTest.class, codeu.chat.relay.ServerTest.class, codeu.chat.server.BasicControllerTest.class, codeu.chat.server.RawControllerTest.class, codeu.chat.util.TimeTest.class, codeu.chat.util.TokenizerTest.class, codeu.chat.util.UuidTest.class, codeu.chat.util.store.StoreTest.class ); for (final Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); }
/** * Creates and runs a JUnit test runner for testSuite. * * @param testSuite the class defining test cases to run * @param view a UI component to report test failures to * @return the counts of failures and total test cases. */ static RunResult runTestSuiteAgainst(Class testSuite, View view) { if(testSuite == null) throw new NullPointerException("testSuite"); if(view == null) throw new NullPointerException("view"); Result result = new JUnitCore().run(testSuite); if (result.getFailureCount() > 0) { for (Failure f : result.getFailures()) view.declarePassProgramTestFailure(f.getTrace()); } return new RunResult(result.getFailureCount(), result.getRunCount()); }
public static void main(String[] args) { final Result result = JUnitCore.runClasses( codeu.chat.common.SecretTest.class, codeu.chat.relay.ServerTest.class, codeu.chat.server.BasicControllerTest.class, codeu.chat.server.RawControllerTest.class, codeu.chat.util.TimeTest.class, codeu.chat.util.UuidTest.class, codeu.chat.util.store.StoreTest.class ); for (final Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); }
/** * . * @param args . * @throws ClassNotFoundException . */ public static void main(String... args) throws ClassNotFoundException { int retCode = 0; String resultMessage = "SUCCESS"; String[] classAndMethod = args[0].split("#"); Request request = Request.method(Class.forName(classAndMethod[0]), classAndMethod[1]); Result result = new JUnitCore().run(request); if (!result.wasSuccessful()) { retCode = 1; resultMessage = "FAILURE"; } System.out.println(resultMessage); System.exit(retCode); }
/** * Chama o motor de testes JUnit. */ private static void executarTodosOs50Testes() { final Result result = JUnitCore.runClasses( GrafoTest.class ); final StringBuilder mensagem = new StringBuilder(); if( result.getFailureCount() > 0 ) { mensagem.append( "############## OS SEGUINTES TESTES FALHARAM!! " + "#####################################\n" ); } else { mensagem.append( "############## TODOS OS TESTES FORAM EXECUTADOS " + "COM SUCESSO!! #######################\n" ); } for( final Failure failure: result.getFailures() ) { mensagem.append( failure.getDescription() ).append( '\n' ); mensagem.append( failure.getMessage() ).append( '\n' ); } System.out.println( mensagem ); }
/** * Run the tests in the supplied {@code testClass}, using the specified * {@link Runner}, and assert the expectations of the test execution. * * <p>If the specified {@code runnerClass} is {@code null}, the tests * will be run with the runner that the test class is configured with * (i.e., via {@link RunWith @RunWith}) or the default JUnit runner. * * @param runnerClass the explicit runner class to use or {@code null} * if the implicit runner should be used * @param testClass the test class to run with JUnit * @param expectedStartedCount the expected number of tests that started * @param expectedFailedCount the expected number of tests that failed * @param expectedFinishedCount the expected number of tests that finished * @param expectedIgnoredCount the expected number of tests that were ignored * @param expectedAssumptionFailedCount the expected number of tests that * resulted in a failed assumption */ public static void runTestsAndAssertCounters(Class<? extends Runner> runnerClass, Class<?> testClass, int expectedStartedCount, int expectedFailedCount, int expectedFinishedCount, int expectedIgnoredCount, int expectedAssumptionFailedCount) throws Exception { TrackingRunListener listener = new TrackingRunListener(); if (runnerClass != null) { Constructor<?> constructor = runnerClass.getConstructor(Class.class); Runner runner = (Runner) BeanUtils.instantiateClass(constructor, testClass); RunNotifier notifier = new RunNotifier(); notifier.addListener(listener); runner.run(notifier); } else { JUnitCore junit = new JUnitCore(); junit.addListener(listener); junit.run(testClass); } assertEquals("tests started for [" + testClass + "]:", expectedStartedCount, listener.getTestStartedCount()); assertEquals("tests failed for [" + testClass + "]:", expectedFailedCount, listener.getTestFailureCount()); assertEquals("tests finished for [" + testClass + "]:", expectedFinishedCount, listener.getTestFinishedCount()); assertEquals("tests ignored for [" + testClass + "]:", expectedIgnoredCount, listener.getTestIgnoredCount()); assertEquals("failed assumptions for [" + testClass + "]:", expectedAssumptionFailedCount, listener.getTestAssumptionFailureCount()); }
private void runTestAndVerifyHierarchies(Class<? extends FooTestCase> testClass, boolean isFooContextActive, boolean isBarContextActive, boolean isBazContextActive) { JUnitCore jUnitCore = new JUnitCore(); Result result = jUnitCore.run(testClass); assertTrue("all tests passed", result.wasSuccessful()); assertThat(ContextHierarchyDirtiesContextTests.context, notNullValue()); ConfigurableApplicationContext bazContext = (ConfigurableApplicationContext) ContextHierarchyDirtiesContextTests.context; assertEquals("baz", ContextHierarchyDirtiesContextTests.baz); assertThat("bazContext#isActive()", bazContext.isActive(), is(isBazContextActive)); ConfigurableApplicationContext barContext = (ConfigurableApplicationContext) bazContext.getParent(); assertThat(barContext, notNullValue()); assertEquals("bar", ContextHierarchyDirtiesContextTests.bar); assertThat("barContext#isActive()", barContext.isActive(), is(isBarContextActive)); ConfigurableApplicationContext fooContext = (ConfigurableApplicationContext) barContext.getParent(); assertThat(fooContext, notNullValue()); assertEquals("foo", ContextHierarchyDirtiesContextTests.foo); assertThat("fooContext#isActive()", fooContext.isActive(), is(isFooContextActive)); }
@Override public void runTaskCase() throws Exception { AbstractCaseData.setCaseData(null); String caseDataInfo = this.tcr.getTaskCase().getCaseDataInfo(); if (!caseDataInfo.isEmpty()) { CaseData caseData = AbstractCaseData.getCaseData(caseDataInfo); LOG.debug("Injecting case data: {} = {}", caseDataInfo, caseData.getValue()); AbstractCaseData.setCaseData(caseData); } TaskCase tc = this.tcr.getTaskCase(); LOG.debug("Loading case {}", tc.format()); CaseRunListener trl = new CaseRunListener(this.db, this.tcr); JUnitCore core = new JUnitCore(); core.addListener(trl); core.run(Request.method(Class.forName(tc.getCaseClass()), tc.getCaseMethod())); }
@Test public void run() { JUnitCore junitCore = new JUnitCore(); Result result = junitCore.run(TestDummy.class); List<Failure>failures = result.getFailures(); if(!(failures == null || failures.isEmpty())) { for(Failure f : failures) { System.out.println(f.getMessage()); } } Assert.assertEquals(2, result.getRunCount()); Assert.assertEquals(0, result.getIgnoreCount()); Assert.assertEquals(0, result.getFailureCount()); Assert.assertEquals("After was not executed", "true", System.getProperty("JUnit_After")); Assert.assertEquals("AfterClass was not executed", "true", System.getProperty("JUnit_AfterClass")); }
@Override public void start(Stage stage) throws Exception { AppLauncher.getInstance().setRemoteStage(stage); new Thread(new Runnable() { public void run() { try { System.out.println("Running junit"); Result r = new JUnitCore().run(Request.method(Class.forName(className), testName)); System.out.println("got result = " + r.wasSuccessful()); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } finally { //System.exit(0); } } }).start(); }
private static void runTests(){ JUnitCore junit = new JUnitCore(); Result result = junit.run(Tests.class); System.err.println("Ran " + result.getRunCount() + " tests in "+ result.getRunTime() +"ms."); if (result.wasSuccessful()) System.out.println("All tests were successfull!"); else { System.err.println(result.getFailureCount() + "Failures:"); for (Failure fail: result.getFailures()){ System.err.println("Failure in: "+ fail.getTestHeader()); System.err.println(fail.getMessage()); System.err.println(fail.getTrace()); System.err.println(); } } }
public static void main(String[] args) { if (args.length != 1) { System.out.println("Need an argument for target directory: i.e. /var/tmp/silverking_holstben/skfs/skfs_mnt/skfs"); return; } targetDirPath = args[0]; absTestsDir = targetDirPath + sep + testsDirName; targetDir = new File(targetDirPath); testsDir = new File(targetDirPath, testsDirName); parentFile = new File(absTestsDir, parentFileName); parentFileRename = new File(absTestsDir, parentFileName+"Rename"); Result result = JUnitCore.runClasses(SkfsRenameGlenn.class); printSummary(result); }
public static void main(String[] args) { if (args.length != 1) { System.out.println("Need an argument for target directory: i.e. /var/tmp/silverking_holstben/skfs/skfs_mnt/skfs"); return; } targetDirPath = args[0]; absTestsDir = targetDirPath + sep + testsDirName; targetDir = new File(targetDirPath); testsDir = new File(targetDirPath, testsDirName); parentDir = new File(absTestsDir, parentDirName); Result result = JUnitCore.runClasses(SkfsCopyGlenn.class); printSummary(result); System.out.println("exists: " + exists); }
@Test public void testTextResultPresentation() throws Exception { IResultPresentation presentation = new TextResultPresentation(); final String genericExpected = "" + "Testcase: junit.framework.TestCase.test()" + NEW_LINE + "Mutated method: java.lang.Object.hashCode()" + NEW_LINE + "Return value generator: " + SAMPLE_RET_VAL_GEN_NAME + NEW_LINE + "Result: %s" + NEW_LINE + "."; String output; String expected; Result result; result = new Result(); output = presentation.formatTestResultEntry(SAMPLE_TEST_IDENTIFIER, new JUnitTestRunResult(result), SAMPLE_METHOD_IDENTIFIER, SAMPLE_RET_VAL_GEN_NAME); expected = String.format(genericExpected, "OK"); assertEquals(expected, output); result = new JUnitCore().run(Request.method(SampleJUnitTestClass.class, "b")); output = presentation.formatTestResultEntry(SAMPLE_TEST_IDENTIFIER, new JUnitTestRunResult(result), SAMPLE_METHOD_IDENTIFIER, SAMPLE_RET_VAL_GEN_NAME); expected = String.format(genericExpected, "1 of 1 FAILED" + NEW_LINE + "Exception: java.lang.AssertionError"); assertEquals(expected, output); }
@Test public void testDatabaseResultPresentation() { IResultPresentation presentation = new DatabaseResultPresentation(); presentation.setExecutionId(ExecutionIdFactory.parseShortExecutionId("EXEC")); final String genericExpected = "INSERT INTO Test_Result_Import (execution, testcase, method, retValGen, killed, assertErr, exception) VALUES ('EXEC', 'junit.framework.TestCase.test()', 'java.lang.Object.hashCode()', '%s', %s, %s, '%s');"; String output; String expected; Result result; result = new Result(); output = presentation.formatTestResultEntry(SAMPLE_TEST_IDENTIFIER, new JUnitTestRunResult(result), SAMPLE_METHOD_IDENTIFIER, SAMPLE_RET_VAL_GEN_NAME); expected = String.format(genericExpected, SAMPLE_RET_VAL_GEN_NAME, false, false, ""); assertEquals(expected, output); result = new JUnitCore().run(Request.method(SampleJUnitTestClass.class, "b")); output = presentation.formatTestResultEntry(SAMPLE_TEST_IDENTIFIER, new JUnitTestRunResult(result), SAMPLE_METHOD_IDENTIFIER, SAMPLE_RET_VAL_GEN_NAME); expected = String.format(genericExpected, SAMPLE_RET_VAL_GEN_NAME, true, true, AssertionError.class.getName()); assertEquals(expected, output); }
public void runTests(String outputDir) { JUnitCore junit = new JUnitCore(); if (outputDir == null) { junit.addListener(new TextListener(System.out)); } else { junit.addListener(new JUnitResultFormatterAsRunListener(new XMLJUnitResultFormatter()) { @Override public void testStarted(Description description) throws Exception { formatter.setOutput(new FileOutputStream( new File(outputDir, "TEST-" + description.getDisplayName() + ".xml"))); super.testStarted(description); } }); } junit.run(TestContainer.class); }
@Test public void testSystem() throws Throwable { Computer computer = new Computer(); JUnitCore jUnitCore = new JUnitCore(); ByteArrayOutputStream capture = new ByteArrayOutputStream(); final PrintStream printStream = new PrintStream(capture); TextListener listener = new TextListener(printStream); jUnitCore.addListener(listener); PrintStream systemOut = System.out; System.setOut(printStream); try { jUnitCore.run(computer, ExampleTest.class); } finally { System.setOut(systemOut); } String output = capture.toString("UTF-8"); output = normalizeOutput(output); String expectedOutput = getResource("/CompositeTest.testSystem.expected.txt"); Assert.assertEquals(expectedOutput, output); }
public static void main(String[] args) { Result result = JUnitCore.runClasses(EXQ2Tests.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
protected boolean runBootstrapTest(RunNotifier notifier, TestClass testClass) { if (!runningBootstrapTest.get().booleanValue()) { runningBootstrapTest.set(Boolean.TRUE); try { BootstrapTest bootstrapTest = getBootstrapTestAnnotation(testClass.getJavaClass()); if (bootstrapTest != null) { Result result = JUnitCore.runClasses(bootstrapTest.value()); List<Failure> failures = result.getFailures(); for (Failure failure : failures) { notifier.fireTestFailure(failure); } return result.getFailureCount() == 0; } else { throw new IllegalStateException("LoadTimeWeavableTestRunner, must be coupled with an @BootstrapTest annotation to define the bootstrap test to execute."); } } finally { runningBootstrapTest.set(Boolean.FALSE); } } return true; }
public static void main(String[] args) { Result result = JUnitCore.runClasses(EXQ6Tests.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ //System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
public boolean run() throws IOException { try { m_dir = "testout/junit-" + m_timestamp + "/" + m_testClazz.getCanonicalName() + "/"; new File(m_dir).mkdirs(); // redirect std out/err to files m_out.addOutputStream(new File(m_dir + "fulloutput.txt")); System.setOut(new PrintStream(m_out, true)); System.setErr(new PrintStream(m_out, true)); JUnitCore junit = new JUnitCore(); junit.addListener(this); Result r = junit.run(m_testClazz); STDOUT.printf("RESULTS: %d/%d\n", r.getRunCount() - r.getFailureCount(), r.getRunCount()); return true; } catch (Exception e) { return false; } finally { m_out.flush(); System.setOut(STDOUT); System.setErr(STDERR); m_out.close(); } }
/** * Runs the test classes given in {@param classes}. * * @returns Zero if all tests pass, non-zero otherwise. */ public static int run(Class[] classes, RunListener listener, PrintStream out) { JUnitCore junitCore = new JUnitCore(); junitCore.addListener(listener); boolean hasError = false; int numTests = 0; int numFailures = 0; long start = System.currentTimeMillis(); for (@AutoreleasePool Class c : classes) { out.println("Running " + c.getName()); Result result = junitCore.run(c); numTests += result.getRunCount(); numFailures += result.getFailureCount(); hasError = hasError || !result.wasSuccessful(); } long end = System.currentTimeMillis(); out.println(String.format("Ran %d tests, %d failures. Total time: %s seconds", numTests, numFailures, NumberFormat.getInstance().format((double) (end - start) / 1000))); return hasError ? 1 : 0; }
/** * Runs all unit tests defined in the FHAES test suite. */ @Test public void runUnitTests() { Result result = JUnitCore.runClasses(FHAESTestSuite.class); if (result.getFailureCount() > 0) { for (Failure failure : result.getFailures()) { log.error(failure.getException().toString()); log.error("error occurred in: " + failure.getTestHeader()); // Report to the JUnit window that a failure has been encountered Assert.fail(failure.getTrace()); } } else { log.info("All tests passed for FHAESTestSuite"); } }
@Test public void shouldReportDescriptionsinCorrectOrder() { JUnitCore jUnit = new JUnitCore(); jUnit.addListener(new RunListener() { @Override public void testRunStarted(Description description) throws Exception { suiteDescription = description; } }); jUnit.run(CuppaRunnerTest.TestsAndTestBlocks.class); List<Description> rootDescriptionChildren = suiteDescription .getChildren().get(0).getChildren().get(0).getChildren(); assertThat(rootDescriptionChildren).hasSize(3); assertThat(rootDescriptionChildren.get(0).getDisplayName()).startsWith("a"); assertThat(rootDescriptionChildren.get(1).getDisplayName()).startsWith("b"); assertThat(rootDescriptionChildren.get(2).getDisplayName()).startsWith("when c"); assertThat(rootDescriptionChildren.get(2).getChildren().get(0).getDisplayName()).startsWith("d"); }
public static void main(String[] args) { Result result = JUnitCore.runClasses(DListTest.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ System.out.println(true); /**127 : nombre magique afin de signaler que tout le tests sont passés */ System.exit(127); } }
public static void main(String[] args) { Result result1 = JUnitCore.runClasses(DListTest.class); Result result2 = JUnitCore.runClasses(DListParseTest.class); Iterator<Failure> failures1 = result1.getFailures().iterator(); Failure f; while(failures1.hasNext()){ f = failures1.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } Iterator<Failure> failures2 = result2.getFailures().iterator(); while(failures2.hasNext()){ f = failures2.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result1.wasSuccessful() && result2.wasSuccessful()){ //System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
public static void main(String[] args) { Result result = JUnitCore.runClasses(DListTest.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
public static void main(String[] args) { Result result = JUnitCore.runClasses(EXQ6Tests.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
public static void main(String[] args) { Result result = JUnitCore.runClasses(M5Q5TestSuite.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); System.err.println(f.getException()); } if(result.wasSuccessful() == true){ /**127 : nombre magique afin de signaler que tout le tests sont passés */ System.exit(127); } }
private void addListeners(List<RunListener> listeners, JUnitCore testRunner, PrintStream writer) { if (getBooleanArgument(ARGUMENT_SUITE_ASSIGNMENT)) { listeners.add(new SuiteAssignmentPrinter()); } else { listeners.add(new TextListener(writer)); listeners.add(new LogRunListener()); mInstrumentationResultPrinter = new InstrumentationResultPrinter(); listeners.add(mInstrumentationResultPrinter); listeners.add(new ActivityFinisherRunListener(this, new ActivityFinisher())); addDelayListener(listeners); addCoverageListener(listeners); } addListenersFromArg(listeners, writer); addListenersFromManifest(listeners, writer); for (RunListener listener : listeners) { testRunner.addListener(listener); if (listener instanceof InstrumentationRunListener) { ((InstrumentationRunListener) listener).setInstrumentation(this); } } }
/** * Wrapper over JUniteCore that runs one test. * * @return the result of the test. * @throws Exception if there was an exception running the test. */ @Override public AugmentedResult call() throws Exception { JUnitCore jUnitCore = getJUnitCore(); String testName = String.format("%s#%s", test.getDeclaringClass().getCanonicalName(), test.getName()); long start = System.currentTimeMillis(); try { LOG.info(String.format("STARTING Test %s", testName)); // HACK since for TestSuiteRunner we want to retry, and for TestMethodRunner we don't want to // The other way would be a RETRY on augmented.properties, but this is independent of the configuration of // the test. if (retry) { TestRunnerRetryingRule.retry(); } Result result = jUnitCore.run(Request.method(test.getDeclaringClass(), test.getName())); LOG.info(String.format("FINSHED Test %s in %s, result %s", testName, Util.TO_PRETTY_FORMAT.apply(System.currentTimeMillis() - start), result.wasSuccessful()? "SUCCEEDED" : "FAILED")); return new AugmentedResult(testName, result, outputStream); } finally { outputStream.close(); } }
public static void main(String[] args) { Result result = JUnitCore.runClasses(EXQ4Tests.class); Iterator<Failure> failures = result.getFailures().iterator(); Failure f; while(failures.hasNext()){ f = failures.next(); System.err.println(f.getMessage()); //System.err.println(f.getTrace()); } if(result.wasSuccessful() == true){ //System.out.println(true); /**127 : nombre magique afin de signaler que tout les tests sont passés */ System.exit(127); } }
public static void main(String[] args) throws Exception { Result result = JUnitCore.runClasses(Bug_for_Next.class); for (Failure fail : result.getFailures()) { System.out.println(fail.toString()); } if (result.wasSuccessful()) { System.out.println("All tests finished successfully..."); } }
public static void main(String[] args) { final Result result = JUnitCore.runClasses( codeu.chat.common.SecretTest.class, codeu.chat.relay.ServerTest.class, codeu.chat.server.BasicControllerTest.class, codeu.chat.server.RawControllerTest.class, codeu.chat.util.TimeTest.class, codeu.chat.util.UuidTest.class, codeu.chat.util.store.StoreTest.class, codeu.chat.util.TokenizerTest.class, codeu.chat.server.ControllerTest.class ); System.out.println("\n===================== Test Status ===================="); System.out.println(String.format("%d tests run.", result.getRunCount())); if (result.wasSuccessful()) { System.out.println("All tests passed."); } else { System.out.println(String.format("%d tests failed.", result.getFailureCount())); System.out.println("\nFailures:"); for (final Failure failure : result.getFailures()) { System.out.println(failure.toString()); } } System.out.println("======================================================\n"); System.exit(result.wasSuccessful() ? 0 : -1); }
public TestResult handleRequest(TestRequest testRequest, Context context) { LoggerContainer.LOGGER = new Logger(context.getLogger()); System.setProperty("target.test.uuid", testRequest.getTestRunUUID()); Optional<Result> result = Optional.empty(); try { BlockJUnit4ClassRunner runner = new BlockJUnit4ClassRunner(getTestClass(testRequest)); runner.filter(new MethodFilter(testRequest.getFrameworkMethod())); result = ofNullable(new JUnitCore().run(runner)); } catch (Exception e) { testResult.setThrowable(e); LOGGER.log(e); } if (result.isPresent()) { testResult.setRunCount(result.get().getRunCount()); testResult.setRunTime(result.get().getRunTime()); LOGGER.log("Run count: " + result.get().getRunCount()); result.get().getFailures().forEach(failure -> { LOGGER.log(failure.getException()); testResult.setThrowable(failure.getException()); }); } return testResult; }
@Override protected void deploy(final String... args) throws Exception { configure(args); final JUnitCore core = new JUnitCore(); final Result result = core.run(test_classes.toArray(new Class[test_classes.size()])); for (Failure failure : failures) { result.getFailures().add(failure); } setProperty(TEST_RESULT, serializeAsBase64(result)); }
/** * Returns new instance of the JUnit kernel with provided listeners. * * @param listeners an instance (or instances) of JUnit listeners * @return the new instance of the JUnit kernel */ @Override public Junit4Kernel with(RunListener... listeners) { final JUnitCore jUnitCore = new JUnitCore(); Arrays.stream(listeners).forEach(jUnitCore::addListener); return new Junit4Kernel(jUnitCore, this.suiteForRun); }