1 18 package org.apache.batik.bridge; 19 20 import org.apache.batik.test.*; 21 22 import org.apache.batik.test.svg.SVGOnLoadExceptionTest; 23 24 31 public class JarNoLoadTest extends DefaultTestSuite { 32 public JarNoLoadTest() { 33 String scripts = "text/ecmascript"; 34 String [] scriptSource = {"bridge/jarCheckNoLoadAny", 35 "bridge/jarCheckNoLoadSameAsDocument", 36 "bridge/jarCheckNoLoadEmbed", 37 }; 38 boolean[] secure = {true, false}; 39 String [] scriptOrigin = {"ANY", "DOCUMENT", "EMBEDED", "NONE"}; 40 41 for (int i=0; i<scriptSource.length; i++) { 47 for (int j=0; j<secure.length; j++) { 48 for (int k=0; k<scriptOrigin.length; k++) { 49 SVGOnLoadExceptionTest t = buildTest(scripts, 50 scriptSource[i], 51 scriptOrigin[k], 52 secure[j]); 53 addTest(t); 54 } 55 } 56 } 57 58 scripts = "application/java-archive"; 65 for (int j=0; j<scriptOrigin.length; j++) { 66 for (int i=0; i<j; i++) { 67 for (int k=0; k<secure.length; k++) { 68 SVGOnLoadExceptionTest t= buildTest(scripts, scriptSource[i], 69 scriptOrigin[j], 70 secure[k]); 71 addTest(t); 72 } 73 } 74 } 75 } 76 77 SVGOnLoadExceptionTest buildTest(String scripts, String id, String origin, boolean secure) { 78 SVGOnLoadExceptionTest t = new SVGOnLoadExceptionTest(); 79 String desc = 80 "(scripts=" + scripts + 81 ")(scriptOrigin=" + origin + 82 ")(secure=" + secure + ")"; 83 84 t.setId(id + desc); 85 t.setScriptOrigin(origin); 86 t.setSecure(secure); 87 t.setScripts(scripts); 88 t.setExpectedExceptionClass("java.lang.SecurityException"); 89 90 return t; 91 } 92 93 } 94 | Popular Tags |