Tweaking basedir
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1187 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
830d8691f6
commit
1090bd1ae4
|
@ -43,10 +43,12 @@ public class JettyPolicyRuntimeTest extends TestCase
|
||||||
|
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
evaluator.put("jetty.home",MavenTestingUtils.getBaseURI().toASCIIString());
|
String basedir = MavenTestingUtils.getBaseURI().toASCIIString();
|
||||||
evaluator.put("basedir",MavenTestingUtils.getBaseURI().toASCIIString());
|
|
||||||
|
|
||||||
System.out.println("basedir: " + MavenTestingUtils.getBaseURI().toASCIIString());
|
evaluator.put("jetty.home",basedir);
|
||||||
|
evaluator.put("basedir",basedir);
|
||||||
|
|
||||||
|
System.out.println("basedir: " + basedir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,8 +41,8 @@ public class JettyPolicyTest extends TestCase
|
||||||
{
|
{
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
evaluator.put("jetty.home",MavenTestingUtils.getBasedir().getAbsolutePath());
|
evaluator.put("jetty.home",MavenTestingUtils.getBaseURI().toASCIIString());
|
||||||
evaluator.put("basedir",MavenTestingUtils.getBasedir().getAbsolutePath());
|
evaluator.put("basedir",MavenTestingUtils.getBaseURI().toASCIIString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGlobalAllPermissionLoader()
|
public void testGlobalAllPermissionLoader()
|
||||||
|
@ -50,7 +50,7 @@ public class JettyPolicyTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
JettyPolicy ap =
|
JettyPolicy ap =
|
||||||
new JettyPolicy( Collections.singleton( getWorkingDirectory() + "/src/test/resources/global-all-permission.policy" ), evaluator );
|
new JettyPolicy( Collections.singleton( MavenTestingUtils.getBasedir().getAbsolutePath() + "/src/test/resources/global-all-permission.policy" ), evaluator );
|
||||||
|
|
||||||
ap.refresh();
|
ap.refresh();
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public class JettyPolicyTest extends TestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
JettyPolicy ap =
|
JettyPolicy ap =
|
||||||
new JettyPolicy( Collections.singleton( getWorkingDirectory()
|
new JettyPolicy( Collections.singleton( MavenTestingUtils.getBasedir().getAbsolutePath()
|
||||||
+ "/src/test/resources/single-codebase-file-permission.policy" ), evaluator );
|
+ "/src/test/resources/single-codebase-file-permission.policy" ), evaluator );
|
||||||
|
|
||||||
ap.refresh();
|
ap.refresh();
|
||||||
|
@ -96,7 +96,7 @@ public class JettyPolicyTest extends TestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
JettyPolicy ap =
|
JettyPolicy ap =
|
||||||
new JettyPolicy( Collections.singleton( getWorkingDirectory()
|
new JettyPolicy( Collections.singleton( MavenTestingUtils.getBasedir().getAbsolutePath()
|
||||||
+ "/src/test/resources/multiple-codebase-file-permission.policy" ), evaluator );
|
+ "/src/test/resources/multiple-codebase-file-permission.policy" ), evaluator );
|
||||||
|
|
||||||
ap.refresh();
|
ap.refresh();
|
||||||
|
@ -122,7 +122,7 @@ public class JettyPolicyTest extends TestCase
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
JettyPolicy ap =
|
JettyPolicy ap =
|
||||||
new JettyPolicy( Collections.singleton( getWorkingDirectory()
|
new JettyPolicy( Collections.singleton( MavenTestingUtils.getBasedir().getAbsolutePath()
|
||||||
+ "/src/test/resources/multiple-codebase-mixed-permission.policy" ), evaluator );
|
+ "/src/test/resources/multiple-codebase-mixed-permission.policy" ), evaluator );
|
||||||
|
|
||||||
ap.refresh();
|
ap.refresh();
|
||||||
|
@ -132,7 +132,7 @@ public class JettyPolicyTest extends TestCase
|
||||||
|
|
||||||
public void testSCLoader() throws Exception
|
public void testSCLoader() throws Exception
|
||||||
{
|
{
|
||||||
JettyPolicy ap = new JettyPolicy(Collections.singleton(getWorkingDirectory() + "/src/main/config/lib/policy/jetty.policy"),evaluator);
|
JettyPolicy ap = new JettyPolicy(Collections.singleton(MavenTestingUtils.getBasedir().getAbsolutePath() + "/src/main/config/lib/policy/jetty.policy"),evaluator);
|
||||||
|
|
||||||
ap.refresh();
|
ap.refresh();
|
||||||
ap.dump(System.out);
|
ap.dump(System.out);
|
||||||
|
@ -143,8 +143,8 @@ public class JettyPolicyTest extends TestCase
|
||||||
{
|
{
|
||||||
Set<String> files = new HashSet<String>();
|
Set<String> files = new HashSet<String>();
|
||||||
|
|
||||||
files.add( getWorkingDirectory() + "/src/test/resources/single-codebase-file-permission.policy" );
|
files.add( MavenTestingUtils.getBasedir().getAbsolutePath() + "/src/test/resources/single-codebase-file-permission.policy" );
|
||||||
files.add( getWorkingDirectory() + "/src/test/resources/single-codebase-file-permission-2.policy" );
|
files.add( MavenTestingUtils.getBasedir().getAbsolutePath() + "/src/test/resources/single-codebase-file-permission-2.policy" );
|
||||||
|
|
||||||
JettyPolicy ap = new JettyPolicy( files, evaluator );
|
JettyPolicy ap = new JettyPolicy( files, evaluator );
|
||||||
|
|
||||||
|
@ -164,19 +164,4 @@ public class JettyPolicyTest extends TestCase
|
||||||
assertFalse( pc.implies( testPerm2 ) );
|
assertFalse( pc.implies( testPerm2 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String getWorkingDirectory()
|
|
||||||
{
|
|
||||||
String cwd = System.getProperty( "basedir" );
|
|
||||||
|
|
||||||
if ( cwd == null )
|
|
||||||
{
|
|
||||||
cwd = System.getProperty( "user.dir" );
|
|
||||||
}
|
|
||||||
return cwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue