Tweaking basedir usage to be by File.toURI() not by File.getAbsolutePath(), which causes problems with paths with spaces

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1186 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Joakim Erdfelt 2010-01-07 19:32:39 +00:00
parent 509d5f6608
commit 830d8691f6
6 changed files with 15 additions and 21 deletions

View File

@ -43,10 +43,10 @@ public class JettyPolicyRuntimeTest extends TestCase
super.setUp();
evaluator.put("jetty.home",MavenTestingUtils.getBasedir().getAbsolutePath());
evaluator.put("basedir",MavenTestingUtils.getBasedir().getAbsolutePath());
System.out.println("basedir: "+MavenTestingUtils.getBasedir().getAbsolutePath());
evaluator.put("jetty.home",MavenTestingUtils.getBaseURI().toASCIIString());
evaluator.put("basedir",MavenTestingUtils.getBaseURI().toASCIIString());
System.out.println("basedir: " + MavenTestingUtils.getBaseURI().toASCIIString());
}
@Override
@ -175,7 +175,7 @@ public class JettyPolicyRuntimeTest extends TestCase
URL url = MavenTestingUtils.toTargetURL("test-policy/jetty-test-policy.jar");
System.out.println( "Test URL: " + url.toString());
System.out.println("Test URL: " + url.toString());
URLClassLoader loader ;
if (Thread.currentThread().getContextClassLoader() != null )
@ -209,7 +209,7 @@ public class JettyPolicyRuntimeTest extends TestCase
assertTrue("system property access was granted",true);
// ap.dump(System.out);
// ap.dump(System.out);
}

View File

@ -43,7 +43,7 @@ public class PolicyContextTest
{
_runningOnWindows = System.getProperty( "os.name" ).startsWith( "Windows" );
System.setProperty( "basedir", getWorkingDirectory() );
System.setProperty( "basedir", MavenTestingUtils.getBaseURI().toASCIIString() );
super.setUp();
}
@ -128,13 +128,7 @@ public class PolicyContextTest
private String getWorkingDirectory()
{
String cwd = System.getProperty( "basedir" );
if ( cwd == null )
{
cwd = System.getProperty( "user.dir" );
}
return cwd;
return MavenTestingUtils.getBasedir().getAbsolutePath();
}
}

View File

@ -1,6 +1,6 @@
keystore "file://${basedir}/target/test-policy/jetty-policy.keystore", "jks";
keystore "${basedir}/target/test-policy/jetty-policy.keystore", "jks";
grant signedBy "jetty-policy-bad", codeBase "file://${basedir}/target/test-policy/jetty-test-policy-1.0-SNAPSHOT.jar"
grant signedBy "jetty-policy-bad", codeBase "${basedir}/target/test-policy/jetty-test-policy-1.0-SNAPSHOT.jar"
{
permission java.util.PropertyPermission "${{alias:jetty-policy}}", "read";
};

View File

@ -1,4 +1,4 @@
keystore "file://${basedir}/target/test-policy/jetty-policy.keystore", "jks";
keystore "${basedir}/target/test-policy/jetty-policy.keystore", "jks";
grant principal "jetty-policy"
{

View File

@ -1,7 +1,7 @@
keystore "file://${basedir}/target/test-policy/jetty-policy-nobody.keystore", "jks";
keystore "${basedir}/target/test-policy/jetty-policy-nobody.keystore", "jks";
grant signedBy "jetty-policy", codeBase "file://${basedir}/target/test-policy/jetty-test-policy.jar"
grant signedBy "jetty-policy", codeBase "${basedir}/target/test-policy/jetty-test-policy.jar"
{
permission java.util.PropertyPermission "foo", "read";
}

View File

@ -1,6 +1,6 @@
keystore "file://${basedir}/target/test-policy/jetty-policy.keystore", "jks";
keystore "${basedir}/target/test-policy/jetty-policy.keystore", "jks";
grant signedBy "jetty-policy-bad", codeBase "file://${basedir}/target/test-policy/jetty-test-policy.jar"
grant signedBy "jetty-policy-bad", codeBase "${basedir}/target/test-policy/jetty-test-policy.jar"
{
permission java.util.PropertyPermission "foo", "read";
};