Skip to content

Commit

Permalink
Fix broken RepackerTests on Windows
Browse files Browse the repository at this point in the history
Update test to deal with the fact that POSIX operations aren't available
on Windows.

Fixes gh-1117
  • Loading branch information
philwebb committed Apr 14, 2015
1 parent 834276a commit c2e2bc8
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,16 @@ public void addLauncherScript() throws Exception {
LaunchScript script = new MockLauncherScript("ABC");
repackager.repackage(dest, NO_LIBRARIES, script);
byte[] bytes = FileCopyUtils.copyToByteArray(dest);
assertThat(Files.getPosixFilePermissions(dest.toPath()),
hasItem(PosixFilePermission.OWNER_EXECUTE));
assertThat(new String(bytes), startsWith("ABC"));
assertThat(hasLauncherClasses(source), equalTo(false));
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 {
Expand Down

0 comments on commit c2e2bc8

Please sign in to comment.