113 static {
114 try {
115 File jarFile = new File(System.getProperty("test.src") + "/testcases.jar");
116 urls[0] = jarFile.toURI().toURL();
117 } catch (Exception e) {
118 e.printStackTrace();
119 }
120 }
121
122 public static void main(String args[]) {
123 WhiteBox wb = WhiteBox.getWhiteBox();
124 for(int i = 0; i < 10000; i++) {
125 loadClass(wb);
126 }
127 wb.fullGC();
128 }
129
130 public static void loadClass(WhiteBox wb) {
131 try {
132 URLClassLoader ucl = new URLClassLoader(urls);
133 ucl.loadClass("case00");
134 } catch (Exception e) {
135 e.printStackTrace();
136 }
137 }
138 }
139 }
|
113 static {
114 try {
115 File jarFile = new File(System.getProperty("test.src") + "/testcases.jar");
116 urls[0] = jarFile.toURI().toURL();
117 } catch (Exception e) {
118 e.printStackTrace();
119 }
120 }
121
122 public static void main(String args[]) {
123 WhiteBox wb = WhiteBox.getWhiteBox();
124 for(int i = 0; i < 10000; i++) {
125 loadClass(wb);
126 }
127 wb.fullGC();
128 }
129
130 public static void loadClass(WhiteBox wb) {
131 try {
132 URLClassLoader ucl = new URLClassLoader(urls);
133 Class.forName("case00", false, ucl);
134 } catch (Exception e) {
135 e.printStackTrace();
136 }
137 }
138 }
139 }
|