File tree Expand file tree Collapse file tree 4 files changed +30
-6
lines changed
src/main/java/org/jsl/collider Expand file tree Collapse file tree 4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 3636 <sequential >
3737 <property name =" testName" value =" " />
3838 <get-test-name propertyName =" testName" />
39- <java classname =" org.jsl.tests.${ testName } .Main" fork =" true" >
39+ <java classname =" org.jsl.tests.${ testName } .Main" fork =" true" failonerror = " true " >
4040 <classpath >
4141 <pathelement location =" ${ build } /classes" />
4242 <pathelement location =" ${ build } /tests" />
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public DataBlock(ByteBuffer buf)
3131 {
3232 wr = buf ;
3333 rd = buf .duplicate ();
34+ rd .order (buf .order ());
3435 }
3536
3637 public final DataBlock reset ()
Original file line number Diff line number Diff line change 2222import java .nio .ByteOrder ;
2323import org .jsl .collider .DataBlock ;
2424
25+ interface TestFunc {
26+ void run () throws Exception ;
27+ }
28+
2529public class Main {
2630 private static void dataBlockInheritsByteOrder () throws Exception {
2731 final ByteOrder [] orders = {ByteOrder .LITTLE_ENDIAN , ByteOrder .BIG_ENDIAN };
@@ -38,13 +42,20 @@ private static void dataBlockInheritsByteOrder() throws Exception {
3842 }
3943 }
4044
41- public static void main (String [] args ) {
42- int failedTests = 0 ;
43- try { dataBlockInheritsByteOrder (); }
44- catch (final Exception ex ) {
45+ private static int runTest (TestFunc testFunc ) {
46+ try {
47+ testFunc .run ();
48+ return 0 ;
49+ } catch (final Exception ex ) {
4550 System .out .println (ex .getMessage ());
46- failedTests ++ ;
51+ return 1 ;
4752 }
53+ }
54+
55+ public static void main (String [] args ) {
56+ int failedTests = 0 ;
57+ failedTests += runTest (Main ::dataBlockInheritsByteOrder );
4858 System .out .println (failedTests + " tests failed" );
59+ System .exit ((failedTests == 0 ) ? 0 : -1 );
4960 }
5061}
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <module type =" JAVA_MODULE" version =" 4" >
3+ <component name =" NewModuleRootManager" inherit-compiler-output =" true" >
4+ <exclude-output />
5+ <content url =" file://$MODULE_DIR$" >
6+ <sourceFolder url =" file://$MODULE_DIR$/src" isTestSource =" true" />
7+ </content >
8+ <orderEntry type =" inheritedJdk" />
9+ <orderEntry type =" sourceFolder" forTests =" false" />
10+ <orderEntry type =" module" module-name =" js-collider" />
11+ </component >
12+ </module >
You can’t perform that action at this time.
0 commit comments