< prev index next >
test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java
Print this page
*** 207,218 ****
if (script.expectedErrorMessage != null) {
// This is the case when main class is not found nor in jar
// file nor on command line.
List<String> output = cmd
.saveConsoleOutput(true)
! .execute()
! .assertExitCodeIs(1)
.getOutput();
TKit.assertTextStream(script.expectedErrorMessage).apply(output.stream());
return;
}
--- 207,217 ----
if (script.expectedErrorMessage != null) {
// This is the case when main class is not found nor in jar
// file nor on command line.
List<String> output = cmd
.saveConsoleOutput(true)
! .execute(1)
.getOutput();
TKit.assertTextStream(script.expectedErrorMessage).apply(output.stream());
return;
}
*** 234,244 ****
cmd.appLauncherPath()))) {
List<String> output = new Executor()
.setDirectory(cmd.outputDir())
.setExecutable(cmd.appLauncherPath())
.dumpOutput().saveOutput()
! .execute().assertExitCodeIs(1).getOutput();
TKit.assertTextStream(String.format(
"Error: Could not find or load main class %s",
nonExistingMainClass)).apply(output.stream());
}
}
--- 233,243 ----
cmd.appLauncherPath()))) {
List<String> output = new Executor()
.setDirectory(cmd.outputDir())
.setExecutable(cmd.appLauncherPath())
.dumpOutput().saveOutput()
! .execute(1).getOutput();
TKit.assertTextStream(String.format(
"Error: Could not find or load main class %s",
nonExistingMainClass)).apply(output.stream());
}
}
*** 287,297 ****
Files.delete(jarFile);
new Executor().setToolProvider(JavaTool.JAR)
.addArguments("-v", "-c", "-M", "-f", jarFile.toString())
.addArguments("-C", workDir.toString(), ".")
.dumpOutput()
! .execute().assertExitCodeIsZero();
});
}
private static void explodeJar(Path jarFile, Path workDir,
Predicate<JarEntry> filter) throws IOException {
--- 286,296 ----
Files.delete(jarFile);
new Executor().setToolProvider(JavaTool.JAR)
.addArguments("-v", "-c", "-M", "-f", jarFile.toString())
.addArguments("-C", workDir.toString(), ".")
.dumpOutput()
! .execute();
});
}
private static void explodeJar(Path jarFile, Path workDir,
Predicate<JarEntry> filter) throws IOException {
< prev index next >