81 boolean success 82 = new sun.tools.jar.Main(System.out, System.out, "jar") 83 .run(args); 84 assertTrue(success); 85 } 86 87 /** 88 * Creates app1 and its bundled libraries in applib. 89 */ 90 void buildApp1() throws Exception { 91 Path dir = Files.createDirectories(APPLIB_DIR); 92 93 // app1 uses its own copy of JAX-WS 94 boolean compiled 95 = CompilerUtils.compile(SRC_DIR.resolve("java.xml.ws"), 96 dir.resolve("java.xml.ws")); 97 assertTrue(compiled); 98 99 compiled = CompilerUtils.compile(SRC_DIR.resolve("app1"), 100 dir.resolve("app1"), 101 "-upgrademodulepath", dir.toString()); 102 assertTrue(compiled); 103 } 104 105 /** 106 * Creates app2 and its bundled libraries in applib. 107 */ 108 void buildApp2() throws Exception { 109 Path dir = Files.createDirectories(APPLIB_DIR); 110 111 // app2 uses JAX-RS 112 boolean compiled 113 = CompilerUtils.compile(SRC_DIR.resolve("java.ws.rs"), 114 dir.resolve("java.ws.rs")); 115 assertTrue(compiled); 116 117 compiled = CompilerUtils.compile(SRC_DIR.resolve("app2"), 118 dir.resolve("app2"), 119 "-mp", dir.toString()); 120 assertTrue(compiled); 121 } 122 123 124 @BeforeTest 125 public void setup() throws Exception { 126 buildContainer(); 127 buildApp1(); 128 buildApp2(); 129 } 130 131 /** 132 * Launches the container 133 */ 134 public void testContainer() throws Exception { 135 136 int exitValue 137 = executeTestJava("-mp", MLIB_DIR.toString(), 138 "-m", CONTAINER_MODULE) 139 .outputTo(System.out) 140 .errorTo(System.err) 141 .getExitValue(); 142 143 assertTrue(exitValue == 0); 144 } 145 146 } | 81 boolean success 82 = new sun.tools.jar.Main(System.out, System.out, "jar") 83 .run(args); 84 assertTrue(success); 85 } 86 87 /** 88 * Creates app1 and its bundled libraries in applib. 89 */ 90 void buildApp1() throws Exception { 91 Path dir = Files.createDirectories(APPLIB_DIR); 92 93 // app1 uses its own copy of JAX-WS 94 boolean compiled 95 = CompilerUtils.compile(SRC_DIR.resolve("java.xml.ws"), 96 dir.resolve("java.xml.ws")); 97 assertTrue(compiled); 98 99 compiled = CompilerUtils.compile(SRC_DIR.resolve("app1"), 100 dir.resolve("app1"), 101 "--upgrade-module-path", dir.toString()); 102 assertTrue(compiled); 103 } 104 105 /** 106 * Creates app2 and its bundled libraries in applib. 107 */ 108 void buildApp2() throws Exception { 109 Path dir = Files.createDirectories(APPLIB_DIR); 110 111 // app2 uses JAX-RS 112 boolean compiled 113 = CompilerUtils.compile(SRC_DIR.resolve("java.ws.rs"), 114 dir.resolve("java.ws.rs")); 115 assertTrue(compiled); 116 117 compiled = CompilerUtils.compile(SRC_DIR.resolve("app2"), 118 dir.resolve("app2"), 119 "--module-path", dir.toString()); 120 assertTrue(compiled); 121 } 122 123 124 @BeforeTest 125 public void setup() throws Exception { 126 buildContainer(); 127 buildApp1(); 128 buildApp2(); 129 } 130 131 /** 132 * Launches the container 133 */ 134 public void testContainer() throws Exception { 135 136 int exitValue 137 = executeTestJava("--module-path", MLIB_DIR.toString(), 138 "-m", CONTAINER_MODULE) 139 .outputTo(System.out) 140 .errorTo(System.err) 141 .getExitValue(); 142 143 assertTrue(exitValue == 0); 144 } 145 146 } |