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>
<overWrite>true</overWrite>
<includes>**</includes>
<outputDirectory>${jetty.test.policy.loc}</outputDirectory>
<outputDirectory>${jetty.test.policy.loc}</outputDirectory>
<destFileName>jetty-test-policy.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>

View File

@ -162,17 +162,22 @@ public class TestJettyPolicyRuntime extends TestCase
{
if ( !_runningOnWindows ) //temporary, create alternate file to load for windows
{
System.out.println( "test" );
JettyPolicy ap =
new JettyPolicy( Collections.singleton( getWorkingDirectory()
+ "/src/test/resources/jetty-certificate.policy" ), evaluator );
// ap.dump( System.out );
ap.refresh();
Policy.setPolicy( ap );
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 ;
if (Thread.currentThread().getContextClassLoader() != null )
@ -227,12 +232,16 @@ public class TestJettyPolicyRuntime extends TestCase
public void testBadCertificateLoader()
throws Exception
{
if ( !_runningOnWindows ) //temporary, create alternate file to load for windows
{
JettyPolicy ap =
new JettyPolicy( Collections.singleton( getWorkingDirectory()
+ "/src/test/resources/jetty-bad-certificate.policy" ), evaluator );
ap.refresh();
Policy.setPolicy( ap );