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:
parent
266b3ccbcc
commit
b559f19527
|
@ -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>
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue