summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/TestRunner.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-10-24 15:56:44 -0700
commit741d78b6e840c88b7b183010c812ad982b342da1 (patch)
tree84a75eb7ad351bffd20cd5fb152bab032b74271c /src/test/java/com/seaofnodes/simple/TestRunner.java
parent8d90d2292bbdb23596849c3c3d1cda2f6cad783e (diff)
downloadSimple-linear-chapter28a.tar.gz
Simple-linear-chapter28a.zip
Chapter 28a: Modules and Lazy Class Initializationlinear-chapter28a
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/TestRunner.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/TestRunner.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/com/seaofnodes/simple/TestRunner.java b/src/test/java/com/seaofnodes/simple/TestRunner.java
new file mode 100644
index 00000000..5389967e
--- /dev/null
+++ b/src/test/java/com/seaofnodes/simple/TestRunner.java
@@ -0,0 +1,17 @@
+package com.seaofnodes.simple;
+
+import org.junit.internal.TextListener;
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Request;
+
+/** Make's single-class/single-method JUnit entry point. */
+public class TestRunner {
+ public static void main(String[] args) throws ClassNotFoundException {
+ String name=args[0];
+ Class<?> test=Class.forName(name.contains(".") ? name : "com.seaofnodes.simple."+name);
+ Request request=args[1].isEmpty() ? Request.aClass(test) : Request.method(test,args[1]);
+ JUnitCore runner=new JUnitCore();
+ runner.addListener(new TextListener(System.out));
+ System.exit(runner.run(request).wasSuccessful() ? 0 : 1);
+ }
+}