1 19 35 36 import java.io.*; 37 import java.util.*; 38 import org.w3c.dom.*; 39 40 import webapp.*; 41 42 43 public class TestWebApp extends BaseTest { 44 public static void main(String [] argv) { 45 TestWebApp o = new TestWebApp(); 46 if (argv.length > 0) 47 o.setDocumentDir(argv[0]); 48 try { 49 o.run(); 50 } catch (Exception e) { 51 e.printStackTrace(); 52 System.exit(1); 53 } 54 System.exit(0); 55 } 56 57 public void run() throws Exception { 58 WebApp webApp; 59 60 this.readDocument(); 61 62 out("creating the bean graph"); 63 webApp = WebApp.read(doc); 64 65 out("bean graph created"); 67 webApp.write(out); 68 69 out("Setting distributable to true"); 70 webApp.setDistributable(true); 71 webApp.write(out); 72 73 out("Adding filters"); 74 FilterType filter = new FilterType(); 75 filter.addDisplayName("filter BLUE"); 76 filter.addDisplayNameXmlLang("en"); 77 webApp.addFilter(filter); 78 filter = new FilterType(); 79 filter.addDisplayName("filter GREEN"); 80 webApp.setFilter2(filter); 81 webApp.write(out); 82 83 WebApp copy1 = new WebApp(webApp); 84 copy1.write(out); 85 } 86 } 87 | Popular Tags |