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 36
36
<sequential >
37
37
<property name =" testName" value =" " />
38
38
<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 " >
40
40
<classpath >
41
41
<pathelement location =" ${ build } /classes" />
42
42
<pathelement location =" ${ build } /tests" />
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public DataBlock(ByteBuffer buf)
31
31
{
32
32
wr = buf ;
33
33
rd = buf .duplicate ();
34
+ rd .order (buf .order ());
34
35
}
35
36
36
37
public final DataBlock reset ()
Original file line number Diff line number Diff line change 22
22
import java .nio .ByteOrder ;
23
23
import org .jsl .collider .DataBlock ;
24
24
25
+ interface TestFunc {
26
+ void run () throws Exception ;
27
+ }
28
+
25
29
public class Main {
26
30
private static void dataBlockInheritsByteOrder () throws Exception {
27
31
final ByteOrder [] orders = {ByteOrder .LITTLE_ENDIAN , ByteOrder .BIG_ENDIAN };
@@ -38,13 +42,20 @@ private static void dataBlockInheritsByteOrder() throws Exception {
38
42
}
39
43
}
40
44
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 ) {
45
50
System .out .println (ex .getMessage ());
46
- failedTests ++ ;
51
+ return 1 ;
47
52
}
53
+ }
54
+
55
+ public static void main (String [] args ) {
56
+ int failedTests = 0 ;
57
+ failedTests += runTest (Main ::dataBlockInheritsByteOrder );
48
58
System .out .println (failedTests + " tests failed" );
59
+ System .exit ((failedTests == 0 ) ? 0 : -1 );
49
60
}
50
61
}
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