1 18 19 package org.netbeans.modules.apisupport.jnlplauncher; 20 21 import java.net.URL ; 22 import java.security.cert.CertificateEncodingException ; 23 import java.security.cert.CertificateException ; 24 import junit.framework.*; 25 import java.security.*; 26 27 32 public class FixPolicyTest extends TestCase { 33 34 private URL url = null; 35 36 public FixPolicyTest(String testName) { 37 super(testName); 38 } 39 40 public void testFixPolicy() throws Exception { 41 42 url = new URL ("http://boo.baa"); 43 System.setProperty("netbeans.jnlp.fixPolicy", "true"); 44 45 Main.fixPolicy(); 46 47 assertTrue(Policy.getPolicy().implies( 48 new ProtectionDomain( 49 new CodeSource( 50 url, 51 new java.security.cert.Certificate [0] 52 ), 53 new AllPermission().newPermissionCollection()), 54 new AllPermission() 55 )); 56 } 57 58 } 59 | Popular Tags |