Skip to content
Permalink
Browse files

updating to JUnit 5.6

  • Loading branch information
arcuri82 committed Jan 27, 2020
1 parent 03b914c commit 5ac031ce0a35aba04b9dde8a6d32f80a637e7bc5
@@ -9,13 +9,7 @@ are listed here:

* _RegexEcma262.g4_: from [Antlr examples](https://github.com/antlr/grammars-v4/blob/master/ecmascript/ECMAScript.g4).
Released under MIT license.

* _CustomSummaryGeneratingListener.java_ and _CustomMutableTestExecutionSummary.java_:
from JUnit 5.
Released under Eclipse Public License.
These classes will be removed when this [PR](https://github.com/junit-team/junit5/issues/1947)
will be part of the next JUnit release.


* _RegexDistanceUtils.java_: from [EvoSuite](http://www.evosuite.org) unit test generator.
Released under GNU Lesser General Public

@@ -2,15 +2,11 @@

import org.junit.platform.launcher.Launcher;
import org.junit.platform.launcher.LauncherDiscoveryRequest;
import org.junit.platform.launcher.TestPlan;
import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder;
import org.junit.platform.launcher.core.LauncherFactory;
import org.junit.platform.launcher.listeners.CustomSummaryGeneratingListener;
import org.junit.platform.launcher.listeners.SummaryGeneratingListener;
import org.junit.platform.launcher.listeners.TestExecutionSummary;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;

@@ -21,13 +17,12 @@

public static TestExecutionSummary runTestsInClass(Class<?> klass){

CustomSummaryGeneratingListener listener = new CustomSummaryGeneratingListener();
SummaryGeneratingListener listener = new SummaryGeneratingListener();

LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
.selectors(selectClass(klass))
.build();
Launcher launcher = LauncherFactory.create();
//TestPlan testPlan = launcher.discover(request);
launcher.registerTestExecutionListeners(listener);
launcher.execute(request);

@@ -216,7 +216,7 @@ protected void compileRunAndVerifyTests(String outputFolderName, ClassName class
PrintWriter pw = new PrintWriter(writer);

TestExecutionSummary summary = JUnitTestRunner.runTestsInClass(klass);
summary.printFailuresTo(pw);
summary.printFailuresTo(pw, 100);
String failures = writer.toString();

assertTrue(summary.getContainersFoundCount() > 0);

This file was deleted.

0 comments on commit 5ac031c

Please sign in to comment.
You can’t perform that action at this time.