Fix broken RepackerTests on Windows
Update test to deal with the fact that POSIX operations aren't available on Windows. Fixes gh-1117
This commit is contained in:
parent
834276aa2b
commit
c2e2bc879e
|
@ -402,11 +402,16 @@ public class RepackagerTests {
|
||||||
LaunchScript script = new MockLauncherScript("ABC");
|
LaunchScript script = new MockLauncherScript("ABC");
|
||||||
repackager.repackage(dest, NO_LIBRARIES, script);
|
repackager.repackage(dest, NO_LIBRARIES, script);
|
||||||
byte[] bytes = FileCopyUtils.copyToByteArray(dest);
|
byte[] bytes = FileCopyUtils.copyToByteArray(dest);
|
||||||
assertThat(Files.getPosixFilePermissions(dest.toPath()),
|
|
||||||
hasItem(PosixFilePermission.OWNER_EXECUTE));
|
|
||||||
assertThat(new String(bytes), startsWith("ABC"));
|
assertThat(new String(bytes), startsWith("ABC"));
|
||||||
assertThat(hasLauncherClasses(source), equalTo(false));
|
assertThat(hasLauncherClasses(source), equalTo(false));
|
||||||
assertThat(hasLauncherClasses(dest), equalTo(true));
|
assertThat(hasLauncherClasses(dest), equalTo(true));
|
||||||
|
try {
|
||||||
|
assertThat(Files.getPosixFilePermissions(dest.toPath()),
|
||||||
|
hasItem(PosixFilePermission.OWNER_EXECUTE));
|
||||||
|
}
|
||||||
|
catch (UnsupportedOperationException ex) {
|
||||||
|
// Probably running the test on Windows
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasLauncherClasses(File file) throws IOException {
|
private boolean hasLauncherClasses(File file) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue