update unit test for Windows environment, closes #647

pull/653/head
Justin Richer 2014-07-31 23:22:06 -04:00
parent 2ae06b2611
commit 78f3e68e8b
1 changed files with 30 additions and 21 deletions

View File

@ -162,12 +162,18 @@ public class TestJWKSetKeyStore {
/* First, test with file without "read" permission */ /* First, test with file without "read" permission */
boolean set = false;
if (file.exists()) { if (file.exists()) {
file.setReadable(false); set = file.setReadable(false);
} }
// skip this part of the test on systems that don't allow the settable function, like Windows
if (set) {
Resource loc_noread = new FileSystemResource(file); Resource loc_noread = new FileSystemResource(file);
assertTrue(loc_noread.exists()); assertTrue(loc_noread.exists());
assertTrue(!loc_noread.isReadable()); // assertTrue(!loc_noread.isReadable());
boolean thrown = false; boolean thrown = false;
try { try {
@ -182,6 +188,9 @@ public class TestJWKSetKeyStore {
if (file.exists()) { if (file.exists()) {
file.setReadable(true); file.setReadable(true);
} }
}
Resource loc = new FileSystemResource(file); Resource loc = new FileSystemResource(file);
assertTrue(loc.exists()); assertTrue(loc.exists());
assertTrue(loc.isReadable()); assertTrue(loc.isReadable());