fix up the test-policy

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@691 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jesse McConnell 2009-08-11 16:42:14 +00:00
parent 266b3ccbcc
commit b559f19527
2 changed files with 12 additions and 2 deletions

View File

@ -71,7 +71,8 @@
<type>jar</type> <type>jar</type>
<overWrite>true</overWrite> <overWrite>true</overWrite>
<includes>**</includes> <includes>**</includes>
<outputDirectory>${jetty.test.policy.loc}</outputDirectory> <outputDirectory>${jetty.test.policy.loc}</outputDirectory>
<destFileName>jetty-test-policy.jar</destFileName>
</artifactItem> </artifactItem>
</artifactItems> </artifactItems>
</configuration> </configuration>

View File

@ -162,17 +162,22 @@ public class TestJettyPolicyRuntime extends TestCase
{ {
if ( !_runningOnWindows ) //temporary, create alternate file to load for windows if ( !_runningOnWindows ) //temporary, create alternate file to load for windows
{ {
System.out.println( "test" );
JettyPolicy ap = JettyPolicy ap =
new JettyPolicy( Collections.singleton( getWorkingDirectory() new JettyPolicy( Collections.singleton( getWorkingDirectory()
+ "/src/test/resources/jetty-certificate.policy" ), evaluator ); + "/src/test/resources/jetty-certificate.policy" ), evaluator );
// ap.dump( System.out );
ap.refresh(); ap.refresh();
Policy.setPolicy( ap ); Policy.setPolicy( ap );
System.setSecurityManager( new SecurityManager() ); System.setSecurityManager( new SecurityManager() );
URL url = new URL("file://" + getWorkingDirectory() + "/target/test-policy/jetty-test-policy-1.0.jar"); URL url = new URL("file://" + getWorkingDirectory() + "/target/test-policy/jetty-test-policy.jar");
URLClassLoader loader ; URLClassLoader loader ;
if (Thread.currentThread().getContextClassLoader() != null ) if (Thread.currentThread().getContextClassLoader() != null )
@ -227,12 +232,16 @@ public class TestJettyPolicyRuntime extends TestCase
public void testBadCertificateLoader() public void testBadCertificateLoader()
throws Exception throws Exception
{ {
if ( !_runningOnWindows ) //temporary, create alternate file to load for windows if ( !_runningOnWindows ) //temporary, create alternate file to load for windows
{ {
JettyPolicy ap = JettyPolicy ap =
new JettyPolicy( Collections.singleton( getWorkingDirectory() new JettyPolicy( Collections.singleton( getWorkingDirectory()
+ "/src/test/resources/jetty-bad-certificate.policy" ), evaluator ); + "/src/test/resources/jetty-bad-certificate.policy" ), evaluator );
ap.refresh(); ap.refresh();
Policy.setPolicy( ap ); Policy.setPolicy( ap );