33
33
* @run driver ParallelLoadTest
34
34
*/
35
35
36
+ import java .io .File ;
37
+
36
38
public class ParallelLoadTest {
37
39
public static final int MAX_CLASSES = 40 ;
38
40
@@ -47,39 +49,36 @@ public class ParallelLoadTest {
47
49
private static final int BOOT_LOOPS = Integer .parseInt (System .getProperty ("ParallelLoadTest.boot.loops" , "1" ));
48
50
49
51
public static void main (String [] args ) throws Exception {
50
- JarBuilder .build ("parallel_load" , getClassList (true ));
51
- String testJar = TestCommon .getTestJar ("parallel_load.jar" );
52
+ JarBuilder .build ("parallel_load_app" , "ParallelLoad" , "ParallelLoadThread" , "ParallelLoadWatchdog" );
53
+ JarBuilder .build ("parallel_load_classes" , getClassList ());
54
+ String appJar = TestCommon .getTestJar ("parallel_load_app.jar" );
55
+ String classesJar = TestCommon .getTestJar ("parallel_load_classes.jar" );
52
56
53
57
// (1) Load the classes from app class loader
54
- TestCommon .testDump (testJar , getClassList (false ));
58
+ String CP = appJar + File .pathSeparator + classesJar ;
59
+ TestCommon .testDump (CP , getClassList ());
55
60
for (int i = 0 ; i < APP_LOOPS ; i ++) {
56
- TestCommon .run ("-cp" , testJar , "ParallelLoad" ).assertNormalExit ();
61
+ TestCommon .run ("-cp" , CP , "ParallelLoad" ).assertNormalExit ();
57
62
}
58
63
59
64
// (2) Load the classes from boot class loader
60
- String bootcp = "-Xbootclasspath/a:" + testJar ;
61
- TestCommon .testDump (null , getClassList (false ), bootcp );
65
+ String bootcp = "-Xbootclasspath/a:" + classesJar ;
66
+ TestCommon .testDump (appJar , getClassList (), bootcp );
62
67
for (int i = 0 ; i < BOOT_LOOPS ; i ++) {
63
- TestCommon .run (bootcp ,
68
+ TestCommon .run (bootcp , "-cp" , appJar ,
64
69
// "-Xlog:class+load=debug",
65
70
"ParallelLoad" ).assertNormalExit ();
66
71
}
67
72
}
68
73
69
- private static String [] getClassList (boolean includeWatchdog ) {
70
- int extra = includeWatchdog ? 3 : 2 ;
71
- String [] classList = new String [MAX_CLASSES + extra ];
74
+ private static String [] getClassList () {
75
+ String [] classList = new String [MAX_CLASSES ];
72
76
73
77
int i ;
74
78
for (i = 0 ; i < MAX_CLASSES ; i ++) {
75
79
classList [i ] = "ParallelClass" + i ;
76
80
}
77
81
78
- classList [i ++] = "ParallelLoad" ;
79
- classList [i ++] = "ParallelLoadThread" ;
80
- if (includeWatchdog )
81
- classList [i ++] = "ParallelLoadWatchdog" ;
82
-
83
82
return classList ;
84
83
}
85
84
}
0 commit comments