1 19 20 24 25 import java.io.*; 26 import java.util.*; 27 import org.w3c.dom.*; 28 29 import badnames.*; 30 31 32 public class TestBadNames extends BaseTest { 33 public static void main(String [] argv) { 34 TestBadNames o = new TestBadNames(); 35 if (argv.length > 0) 36 o.setDocumentDir(argv[0]); 37 try { 38 o.run(); 39 } catch (Exception e) { 40 e.printStackTrace(); 41 System.exit(1); 42 } 43 System.exit(0); 44 } 45 46 public void run() throws Exception { 47 BadNames bn; 48 49 this.readDocument(); 50 51 out("creating the bean graph"); 52 bn = BadNames.createGraph(doc); 53 54 out("bean graph created"); 56 bn.write(out); 57 58 out(bn); 59 out(bn.dumpBeanNode()); 60 ElT e = bn.getElT(); 61 out("e="+e); 63 64 e = bn.newElT(); 65 bn.setElT(e); 66 out(bn.dumpBeanNode()); 67 e.setProperty2(0); 68 e.setPackage("5"); 69 e.setClass2("other c"); 70 bn.write(out); 71 } 72 } 73 | Popular Tags |