Skip to content

Commit a4288bb

Browse files
Test error reported by jpackage when --temp arg points to existing non-empty directory
1 parent 5197f61 commit a4288bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/jdk/tools/jpackage/share/BasicTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.stream.Stream;
3737
import jdk.jpackage.test.TKit;
3838
import jdk.jpackage.test.JPackageCommand;
39+
import jdk.jpackage.test.JPackageStringBundle;
3940
import jdk.jpackage.test.JavaAppDesc;
4041
import jdk.jpackage.test.PackageTest;
4142
import jdk.jpackage.test.HelloApp;
@@ -381,7 +382,10 @@ public void testTemp(TestTempType type) throws IOException {
381382
);
382383

383384
if (TestTempType.TEMPDIR_NOT_EMPTY.equals(type)) {
384-
pkgTest.setExpectedExitCode(1).addBundleVerifier(cmd -> {
385+
pkgTest.setExpectedExitCode(1).addInitializer(cmd -> {
386+
cmd.validateOutput(JPackageStringBundle.MAIN.cannedFormattedString(
387+
"ERR_BuildRootInvalid", cmd.getArgumentValue("--temp")));
388+
}).addBundleVerifier(cmd -> {
385389
// Check jpackage didn't use the supplied directory.
386390
Path tempDir = Path.of(cmd.getArgumentValue("--temp"));
387391
TKit.assertDirectoryContent(tempDir).match(Path.of("foo.txt"));

0 commit comments

Comments
 (0)