1 package xdoclet.retest.test; 2 3 import junit.framework.TestSuite; 4 import junit.framework.Test; 5 import org.w3c.dom.Node ; 6 import xdoclet.retest.util.XMLComparator; 7 import xdoclet.retest.util.ComparisonResultSet; 8 9 import java.io.FileNotFoundException ; 10 11 16 public class DDJBossTestCase 17 extends XmlRegressionTestCase 18 { 19 public DDJBossTestCase(String name) 20 { 21 super(name); 22 } 23 24 public DDJBossTestCase(String name,String cn) 25 { 26 super(name,cn); 27 } 28 29 public Test getSuite() 30 { 31 TestSuite suite = new TestSuite(); 32 suite.addTest(new DDJBossTestCase("testJbossXml",getClassName())); 33 suite.addTest(new DDJBossTestCase("testJawsXml",getClassName())); 34 suite.addTest(new DDJBossTestCase("testJBossCmpXml",getClassName())); 35 return suite; 36 } 37 38 public void testJbossXml() 39 throws Exception 40 { 41 Node one = readReferenceNode("jboss.xml"); 42 Node two = readGeneratedNode("jboss.xml"); 43 XMLComparator comp = new XMLComparator(one,two); 44 comp.setAttributeValidation(false); 45 ComparisonResultSet res = comp.compare(); 46 if (res.error()) System.out.println(res.toString()); 47 assertTrue("ejb-jar.xml comparison failed "+res, ! res.error()); 48 } 49 50 public void testJawsXml() 51 throws Exception 52 { 53 Node one = null; 55 try{ 56 one = readReferenceNode("jaws.xml"); 57 }catch (FileNotFoundException e){ 58 return; 59 } 60 Node two = readGeneratedNode("jaws.xml"); 61 XMLComparator comp = new XMLComparator(one,two); 62 comp.setAttributeValidation(false); 63 ComparisonResultSet res = comp.compare(); 64 if (res.error()) System.out.println(res.toString()); 65 assertTrue("ejb-jar.xml comparison failed "+res, ! res.error()); 66 } 67 68 public void testJBossCmpXml() 69 throws Exception 70 { 71 Node one = null; 73 try{ 74 one = readReferenceNode("jboss-cmp.xml"); 75 }catch (FileNotFoundException e){ 76 return; 77 } 78 Node two = readGeneratedNode("jboss-cmp.xml"); 79 XMLComparator comp = new XMLComparator(one,two); 80 comp.setAttributeValidation(false); 81 ComparisonResultSet res = comp.compare(); 82 if (res.error()) System.out.println(res.toString()); 83 assertTrue("ejb-jar.xml comparison failed "+res, ! res.error()); 84 } 85 86 87 } 88 | Popular Tags |