Skip to content

Commit 2803e39

Browse files
committed
minor formatting and debug output fixes
1 parent a96e676 commit 2803e39

5 files changed

Lines changed: 1 addition & 37 deletions

File tree

src/main/java/gin/test/ExternalTestRunner.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ private List<UnitTestResult> runTests(int reps) throws IOException, InterruptedE
183183
if (launcher.isPresent()) {
184184
childCp = childCp + File.pathSeparator + launcher.get().toAbsolutePath();
185185
}
186-
// Logger.warn("ETR: embedded launcher bucket=" + bucket +
187-
// " present=" + launcher.isPresent() +
188-
// " resource=" + ExternalTestRunner.class.getResource("/embedded-libs/" + bucket + "/launcher.jar"));
189-
// Logger.warn("ETR: child cp contains extracted launcher? " + childCp.contains("gin-junit-launcher-"));
190-
// Logger.debug("ETR: child cp = " + childCp);
191186
}
192187
String rawClasspath = this.getTemporaryDirectory() + File.pathSeparator +
193188
childCp + File.pathSeparator +
@@ -243,8 +238,6 @@ private List<UnitTestResult> runTests(int reps) throws IOException, InterruptedE
243238
cmd.add(moduleClasspath);
244239
cmd.add(HARNESS_CLASS);
245240

246-
// Logger.debug("ETR: launching harness: " + String.join(" ", cmd));
247-
248241
ProcessBuilder builder = new ProcessBuilder(cmd);
249242
builder.directory(moduleDir);
250243

@@ -510,7 +503,7 @@ private static boolean isJUnit4OrVintageLibPath(String path) {
510503
String name = new java.io.File(path).getName().toLowerCase(java.util.Locale.ROOT);
511504
// Exclude JUnit 4 and the Vintage engine
512505
if (name.startsWith("junit-vintage-")) return true; // Vintage engine
513-
//if (name.matches("^junit-\\d+.*\\.jar$")) return true; // junit-4.x.jar - actually, keep this. needed for legacy builds!
506+
//if (name.matches("^junit-\\d+.*\\.jar$")) return true; // junit-4.x.jar - later decided to comment this out. the library is needed for legacy builds!
514507

515508
// Also exclude obvious Vintage directories on classpath
516509
String p = path.replace('\\', '/');

src/main/java/gin/test/JUnitBridge.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ private LauncherDiscoveryRequest buildRequest(UnitTest test)
159159
if (m == null) throw new NoSuchMethodException(className + "#" + method);
160160

161161
return org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request()
162-
// .filters(org.junit.platform.launcher.EngineFilter.includeEngines("junit-jupiter","junit-vintage"))
163162
.configurationParameter("junit.jupiter.execution.timeout.test.method.default",
164163
test.getTimeoutMS() + " ms")
165164
.selectors(

src/main/java/gin/test/TestHarness.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ private UnitTestResult runTest(UnitTest test, int rep) {
203203
if (!hasTests) {
204204
var classOnlyBuilder = LauncherDiscoveryRequestBuilder.request()
205205
.selectors(selectClass(clazz));
206-
// .filters(EngineFilter.includeEngines(
207-
// jupiterish ? new String[]{"junit-jupiter"}
208-
// : new String[]{"junit-jupiter", "junit-vintage"}))
209-
// .build();
210206
if (jupiterish) {
211207
if (hasJupiter) classOnlyBuilder.filters(EngineFilter.includeEngines("junit-jupiter"));
212208
} else {
@@ -363,25 +359,9 @@ private LauncherDiscoveryRequest buildRequest(UnitTest test, boolean jupiterish)
363359
String method = normalizeMethodName(test.getMethodName());
364360

365361
var builder = LauncherDiscoveryRequestBuilder.request()
366-
// .filters(EngineFilter.includeEngines(
367-
// jupiterish ? new String[]{"junit-jupiter"}
368-
// : new String[]{"junit-jupiter", "junit-vintage"}))
369362
// Jupiter timeout only; harmless for Vintage
370363
.configurationParameter("junit.jupiter.execution.timeout.test.method.default",
371364
test.getTimeoutMS() + " ms");
372-
//
373-
//
374-
// // Optionally narrow to Jupiter only when we know it's there:
375-
//// if (jupiterish && hasEngine("junit-jupiter")) {
376-
//// builder.filters(EngineFilter.includeEngines("junit-jupiter"));
377-
//// }
378-
// if (jupiterish) {
379-
// builder.filters(EngineFilter.includeEngines("junit-jupiter"));
380-
// } else {
381-
// // Allow both: many legacy tests are JUnit 4 but some projects mix in Jupiter
382-
// builder.filters(EngineFilter.includeEngines("junit-jupiter", "junit-vintage"));
383-
// }
384-
//
385365

386366
// Change C: only filter to engines that actually exist on this classpath
387367
boolean hasJupiter = hasEngine("junit-jupiter");

src/main/java/gin/test/TestRunListener.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import org.junit.platform.engine.support.descriptor.MethodSource;
55
import org.junit.platform.launcher.TestExecutionListener;
66
import org.junit.platform.launcher.TestIdentifier;
7-
//import org.junit.runner.Description;
8-
//import org.junit.runner.notification.Failure;
97
import org.pmw.tinylog.Logger;
108

119
import java.io.Serial;
@@ -14,7 +12,6 @@
1412
import java.lang.management.ThreadMXBean;
1513
import java.util.concurrent.TimeoutException;
1614
import org.opentest4j.TestAbortedException;
17-
//import org.junit.AssumptionViolatedException;
1815

1916

2017
/**

src/main/java/gin/util/Trace.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ private static Map<String, Integer> parseJFRMethodCounts(File jfrF, Project proj
213213

214214
if (s != null) {
215215

216-
// Logger.info("Attempting parsing. List of main classes [" + mainClasses +"]");
217-
218216
//traverse the call stack, if a frame is part of the main program,
219217
//return it
220218
Logger.info("Parsing trace...");
@@ -226,8 +224,6 @@ private static Map<String, Integer> parseJFRMethodCounts(File jfrF, Project proj
226224
String methodName = method.getType().getName();
227225
String className = StringUtils.substringBeforeLast(methodName, ".");
228226

229-
// Logger.info("c:" + className + ",m:" + methodName);
230-
231227
if (mainClasses.contains(methodName) || mainClasses.contains(className)) {
232228
methodName += "." + method.getName() + ":" + topFrame.getLineNumber();
233229
samples.merge(methodName, 1, Integer::sum);
@@ -247,7 +243,6 @@ private static Map<String, Integer> parseJFRMethodCounts(File jfrF, Project proj
247243
Logger.warn("IOEx. reading JFR. " +
248244
"Probably this is because of something causing multiple writes to the JFR log files." +
249245
"If you get lots of these it will likely impact on the reliability of the profiling results.");
250-
//Logger.warn(e);
251246
return samples;
252247
}
253248
}

0 commit comments

Comments
 (0)