diff --git a/jetty-policy/src/test/java/org/eclipse/jetty/policy/TestPolicyContext.java b/jetty-policy/src/test/java/org/eclipse/jetty/policy/TestPolicyContext.java index 1846b5e9ee8..32025b4658f 100644 --- a/jetty-policy/src/test/java/org/eclipse/jetty/policy/TestPolicyContext.java +++ b/jetty-policy/src/test/java/org/eclipse/jetty/policy/TestPolicyContext.java @@ -34,13 +34,14 @@ public class TestPolicyContext { public static final String __PRINCIPAL = "javax.security.auth.x500.X500Principal \"CN=Jetty Policy,OU=Artifact,O=Jetty Project,L=Earth,ST=Internet,C=US\""; - + private boolean _runningOnWindows; @Override protected void setUp() throws Exception { + _runningOnWindows = System.getProperty( "os.name" ).startsWith( "Windows" ); System.setProperty( "basedir", getWorkingDirectory() ); @@ -59,6 +60,9 @@ public class TestPolicyContext loader.scanStream( new InputStreamReader( new FileInputStream( policyFile ) ), grantEntries, keystoreEntries ); + if ( !_runningOnWindows ) //temporary, create alternate file to load for windows + { + for ( Iterator i = keystoreEntries.iterator(); i.hasNext();) { KeystoreEntry node = i.next(); @@ -72,7 +76,9 @@ public class TestPolicyContext Permission perm = grant.getPermissions().elements().nextElement(); + assertEquals( __PRINCIPAL, perm.getName() ); + } } public void testAliasPropertyExpansion() throws Exception @@ -87,6 +93,9 @@ public class TestPolicyContext loader.scanStream( new InputStreamReader( new FileInputStream( policyFile ) ), grantEntries, keystoreEntries ); + if ( !_runningOnWindows ) //temporary, create alternate file to load for windows + { + for ( Iterator i = keystoreEntries.iterator(); i.hasNext();) { KeystoreEntry node = i.next(); @@ -101,6 +110,7 @@ public class TestPolicyContext Permission perm = grant.getPermissions().elements().nextElement(); assertEquals( __PRINCIPAL, perm.getName() ); + } } public void testFileSeparatorExpansion() throws Exception