KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > retest > test > DDJBossTestCase


1 package xdoclet.retest.test;
2
3 import junit.framework.TestSuite;
4 import junit.framework.Test;
5 import org.w3c.dom.Node JavaDoc;
6 import xdoclet.retest.util.XMLComparator;
7 import xdoclet.retest.util.ComparisonResultSet;
8
9 import java.io.FileNotFoundException JavaDoc;
10
11 /**
12  * @author Vincent Harcq (vincent.harcq@hubmethods.com)
13  * @created Mars 5, 2002
14  * @version $Revision: 1.3 $
15  */

16 public class DDJBossTestCase
17         extends XmlRegressionTestCase
18 {
19     public DDJBossTestCase(String JavaDoc name)
20     {
21         super(name);
22     }
23
24     public DDJBossTestCase(String JavaDoc name,String JavaDoc 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 JavaDoc
40     {
41         Node JavaDoc one = readReferenceNode("jboss.xml");
42         Node JavaDoc 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 JavaDoc
52     {
53         // For session beans we bypass this test
54
Node JavaDoc one = null;
55         try{
56             one = readReferenceNode("jaws.xml");
57         }catch (FileNotFoundException JavaDoc e){
58             return;
59         }
60         Node JavaDoc 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 JavaDoc
70     {
71         // For session beans we bypass this test
72
Node JavaDoc one = null;
73         try{
74             one = readReferenceNode("jboss-cmp.xml");
75         }catch (FileNotFoundException JavaDoc e){
76             return;
77         }
78         Node JavaDoc 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