1 19 20 import java.io.*; 21 import java.util.*; 22 import org.w3c.dom.*; 23 24 import top.*; 25 26 public class TestOr extends BaseTest { 27 public static void main(String [] argv) { 28 TestOr o = new TestOr(); 29 if (argv.length > 0) 30 o.setDocumentDir(argv[0]); 31 try { 32 o.run(); 33 } catch (Exception e) { 34 e.printStackTrace(); 35 System.exit(1); 36 } 37 System.exit(0); 38 } 39 40 public void run() throws Exception { 41 Top top; 42 43 this.readDocument(); 44 45 out("creating the bean graph"); 46 top = Top.read(doc); 47 48 out("bean graph created"); 50 top.write(out); 51 52 CacheMapping cm = top.getCacheMapping(); 53 cm.setServletName("Bob"); 54 check(cm.getServletName().equals("Bob"), "servlet-name is Bob"); 55 check(cm.getUrlPattern() == null, "url-pattern is null"); 56 57 cm.setUrlPattern("/foo"); 58 check(cm.getUrlPattern().equals("/foo"), "url-pattern is /foo"); 59 check(cm.getServletName() == null, "servlet-name is null"); 60 61 cm.setTimeout("100"); 62 top.write(out); 63 } 64 } 65 | Popular Tags |