KickJava   Java API By Example, From Geeks To Geeks.

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


1 package xdoclet.retest.test;
2
3 import xdoclet.retest.util.ClassComparator;
4 import xdoclet.retest.util.ComparisonResultSet;
5 import xdoclet.retest.util.InterfaceComparator;
6 import junit.framework.TestCase;
7 import junit.framework.Test;
8 import junit.framework.TestSuite;
9
10 /**
11  * @author Vincent Harcq (vincent.harcq@hubmethods.com)
12  * @created Mars 5, 2002
13  * @version $Revision: 1.2 $
14  */

15 public class EnterpriseJavaBeanRegressionTestCase
16 extends XDocletRegressionTestCase
17 {
18
19     public EnterpriseJavaBeanRegressionTestCase(String JavaDoc name)
20     {
21         super(name);
22     }
23
24     public EnterpriseJavaBeanRegressionTestCase(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 EnterpriseJavaBeanRegressionTestCase("testHome",getClassName()));
33         suite.addTest(new EnterpriseJavaBeanRegressionTestCase("testRemote",getClassName()));
34         suite.addTest(new EnterpriseJavaBeanRegressionTestCase("testLocalHome",getClassName()));
35         suite.addTest(new EnterpriseJavaBeanRegressionTestCase("testLocal",getClassName()));
36         return suite;
37     }
38
39     public void testHome()
40     throws Exception JavaDoc
41     {
42         InterfaceComparator comparator;
43         ComparisonResultSet res;
44         Class JavaDoc gen = Thread.currentThread().getContextClassLoader().loadClass(genBase+ ".interfaces." + getClassName() + "Home");
45         Class JavaDoc ref = Thread.currentThread().getContextClassLoader().loadClass(refBase+ ".interfaces." + getClassName() + "Home");
46         comparator = new InterfaceComparator(ref,gen);
47         res = comparator.compare();
48         if (res.error()) System.out.println(res.toString());
49         assertTrue("Home Interface comparison failed "+res, ! res.error());
50     }
51
52     public void testLocalHome()
53     throws Exception JavaDoc
54     {
55         InterfaceComparator comparator;
56         ComparisonResultSet res;
57         Class JavaDoc ref = Thread.currentThread().getContextClassLoader().loadClass(refBase+ ".interfaces." + getClassName() + "LocalHome");
58         Class JavaDoc gen = Thread.currentThread().getContextClassLoader().loadClass(genBase+ ".interfaces." + getClassName() + "LocalHome");
59         comparator = new InterfaceComparator(ref,gen);
60         res = comparator.compare();
61         if (res.error()) System.out.println(res.toString());
62         assertTrue("Home Interface comparison failed "+res, ! res.error());
63     }
64
65     public void testRemote()
66     throws Exception JavaDoc
67     {
68         InterfaceComparator comparator;
69         ComparisonResultSet res;
70         Class JavaDoc ref = Class.forName(refBase+ ".interfaces." + getClassName() );
71         Class JavaDoc gen = Class.forName(genBase+ ".interfaces." + getClassName());
72         comparator = new InterfaceComparator(ref,gen);
73         res = comparator.compare();
74         if (res.error()) System.out.println(res.toString());
75         assertTrue("Remote Interface comparison failed "+res, ! res.error());
76     }
77
78     public void testLocal()
79     throws Exception JavaDoc
80     {
81         InterfaceComparator comparator;
82         ComparisonResultSet res;
83         Class JavaDoc ref = Class.forName(refBase+ ".interfaces." + getClassName() + "Local");
84         Class JavaDoc gen = Class.forName(genBase+ ".interfaces." + getClassName() + "Local");
85         comparator = new InterfaceComparator(ref,gen);
86         res = comparator.compare();
87         if (res.error()) System.out.println(res.toString());
88         assertTrue("Home Interface comparison failed "+res, ! res.error());
89     }
90
91 }
92
Popular Tags