< prev index next >

test/tools/launcher/modules/addreads/AddReadsTestWarningError.java

Print this page




 151     @Test(dataProvider = "illFormedAddReads")
 152     public void testIllFormedAddReads(String value, String msg) throws Exception {
 153         int exitValue =
 154             executeTestJava("--add-reads", value,
 155                             "--module-path", MODS_DIR.toString(),
 156                             "-m", M4_MAIN)
 157                 .outputTo(System.out)
 158                 .errorTo(System.out)
 159                 .shouldContain(msg)
 160                 .getExitValue();
 161 
 162         assertTrue(exitValue != 0);
 163     }
 164 
 165 
 166     @DataProvider(name = "unknownNames")
 167     public Object[][] unknownNames() {
 168         return new Object[][]{
 169 
 170             // source not found
 171             {"DoesNotExist=m2",    "WARNING: Unknown module: DoesNotExist specified in --add-reads"},
 172 
 173             // target not found
 174             {"m2=DoesNotExist",    "WARNING: Unknown module: DoesNotExist specified in --add-reads"},
 175 
 176             // bad names
 177             {"m*=m2",              "WARNING: Unknown module: m* specified in --add-reads"},
 178             {"m2=m!",              "WARNING: Unknown module: m! specified in --add-reads"},
 179 
 180         };
 181     }
 182 
 183     @Test(dataProvider = "unknownNames")
 184     public void testUnknownNames(String value, String msg) throws Exception {
 185         int exitValue =
 186             executeTestJava("--add-reads", value,
 187                             "--module-path", MODS_DIR.toString(),
 188                             "-m", M4_MAIN)
 189                 .outputTo(System.out)
 190                 .errorTo(System.out)
 191                 .shouldContain(msg)
 192                 .getExitValue();
 193 
 194         assertTrue(exitValue == 0);
 195     }
 196 
 197 
 198     @DataProvider(name = "missingArguments")




 151     @Test(dataProvider = "illFormedAddReads")
 152     public void testIllFormedAddReads(String value, String msg) throws Exception {
 153         int exitValue =
 154             executeTestJava("--add-reads", value,
 155                             "--module-path", MODS_DIR.toString(),
 156                             "-m", M4_MAIN)
 157                 .outputTo(System.out)
 158                 .errorTo(System.out)
 159                 .shouldContain(msg)
 160                 .getExitValue();
 161 
 162         assertTrue(exitValue != 0);
 163     }
 164 
 165 
 166     @DataProvider(name = "unknownNames")
 167     public Object[][] unknownNames() {
 168         return new Object[][]{
 169 
 170             // source not found
 171             {"DoesNotExist=m2",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},
 172 
 173             // target not found
 174             {"m2=DoesNotExist",    "WARNING: Unknown module: DoesNotExist specified to --add-reads"},
 175 
 176             // bad names
 177             {"m*=m2",              "WARNING: Unknown module: m* specified to --add-reads"},
 178             {"m2=m!",              "WARNING: Unknown module: m! specified to --add-reads"},
 179 
 180         };
 181     }
 182 
 183     @Test(dataProvider = "unknownNames")
 184     public void testUnknownNames(String value, String msg) throws Exception {
 185         int exitValue =
 186             executeTestJava("--add-reads", value,
 187                             "--module-path", MODS_DIR.toString(),
 188                             "-m", M4_MAIN)
 189                 .outputTo(System.out)
 190                 .errorTo(System.out)
 191                 .shouldContain(msg)
 192                 .getExitValue();
 193 
 194         assertTrue(exitValue == 0);
 195     }
 196 
 197 
 198     @DataProvider(name = "missingArguments")


< prev index next >