1 18 package org.apache.batik.bridge; 19 20 import org.apache.batik.test.*; 21 22 29 public class EcmaLoadTest extends DefaultTestSuite { 30 public EcmaLoadTest() { 31 String scripts = "text/ecmascript"; 32 String [] scriptSource = {"ecmaCheckLoadAny", 33 "ecmaCheckLoadSameAsDocument", 34 "ecmaCheckLoadEmbed", 35 "ecmaCheckLoadEmbedAttr", 36 }; 37 boolean[] secure = {true, false}; 38 String [][] scriptOrigin = {{"any"}, 39 {"any", "document"}, 40 {"any", "document", "embeded"}, 41 {"any", "document", "embeded"}, 42 };; 43 44 48 for (int i=0; i<scriptSource.length; i++) { 56 for (int j=0; j<scriptOrigin[i].length; j++) { 57 for (int k=0; k<secure.length; k++) { 58 ScriptSelfTest t= buildTest(scripts, scriptSource[i], 59 scriptOrigin[i][j], 60 secure[k]); 61 addTest(t); 62 } 63 } 64 } 65 } 66 67 ScriptSelfTest buildTest(String scripts, String id, String origin, boolean secure) { 68 ScriptSelfTest t = new ScriptSelfTest(); 69 String desc = 70 "(scripts=" + scripts + 71 ")(scriptOrigin=" + origin + 72 ")(secure=" + secure + ")"; 73 74 t.setId(id + desc); 75 t.setScriptOrigin(origin); 76 t.setSecure(secure); 77 t.setScripts(scripts); 78 79 return t; 80 } 81 82 } 83 | Popular Tags |