KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > naming > test > InternalNamingClassReplacementUnitTestCase


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.naming.test;
23
24 import junit.framework.Test;
25 import junit.framework.TestSuite;
26
27 /**
28  * InternalNamingClassReplacementUnitTestCase.java
29  * This test runs each test in EjbLingUnitTestCase twice, redeploying the ear in
30  * between runs. The purpose is to see if an application can be reloaded
31  * after use of jndi, and have the lookups work properly. The local interface
32  * lookups are very likely to work since what is bound in jndi is a reference.
33  * The remote bindings were serialized proxies when this test was written and
34  * once the class was bound once it appeared to stay bound for the
35  * lifetime of the server.
36  *
37  * Created: Wed Apr 17 09:34:15 2002
38  *
39  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
40  * @author Scott.Stark@jboss.org
41  * @version $Revision: 37406 $
42  */

43 public class InternalNamingClassReplacementUnitTestCase
44    extends EjbLinkUnitTestCase
45 {
46    public InternalNamingClassReplacementUnitTestCase(String JavaDoc name)
47    {
48       super(name);
49    }
50    
51    /**
52     * Describe <code>suite</code> method here.
53     * This is supposed to hide the deploy setup in the superclass so we can deploy twice
54     * @return a <code>Test</code> value
55     * @exception Exception if an error occurs
56     */

57    public static Test suite() throws Exception JavaDoc
58    {
59       TestSuite suite = new TestSuite();
60       suite.addTest(new TestSuite(InternalNamingClassReplacementUnitTestCase.class));
61       return suite;
62    }
63
64    public void testEjbLinkNamed() throws Exception JavaDoc
65    {
66       try
67       {
68          deploy("naming.ear");
69          super.testEjbLinkNamed();
70       }
71       finally
72       {
73          undeploy("naming.ear");
74       } // end of try-finally
75
try
76       {
77          deploy("naming.ear");
78          super.testEjbLinkNamed();
79       }
80       finally
81       {
82          undeploy("naming.ear");
83       } // end of try-finally
84

85    }
86
87    public void testEjbLinkRelative() throws Exception JavaDoc
88    {
89       try
90       {
91          deploy("naming.ear");
92          super.testEjbLinkRelative();
93       }
94       finally
95       {
96          undeploy("naming.ear");
97       } // end of try-finally
98
try
99       {
100          deploy("naming.ear");
101          super.testEjbLinkRelative();
102       }
103       finally
104       {
105          undeploy("naming.ear");
106       } // end of try-finally
107
}
108
109    public void testEjbLinkLocalNamed() throws Exception JavaDoc
110    {
111       try
112       {
113          deploy("naming.ear");
114          super.testEjbLinkLocalNamed();
115       }
116       finally
117       {
118          undeploy("naming.ear");
119       } // end of try-finally
120
try
121       {
122          deploy("naming.ear");
123          super.testEjbLinkLocalNamed();
124       }
125       finally
126       {
127          undeploy("naming.ear");
128       } // end of try-finally
129
}
130
131    public void testEjbLinkLocalRelative() throws Exception JavaDoc
132    {
133       try
134       {
135          deploy("naming.ear");
136          super.testEjbLinkLocalRelative();
137       }
138       finally
139       {
140          undeploy("naming.ear");
141       } // end of try-finally
142
try
143       {
144          deploy("naming.ear");
145          super.testEjbLinkLocalRelative();
146       }
147       finally
148       {
149          undeploy("naming.ear");
150       } // end of try-finally
151
}
152
153
154     public void testEjbNoLink() throws Exception JavaDoc
155     {
156         try
157         {
158             deploy("naming.ear");
159             super.testEjbNoLink();
160         }
161         finally
162         {
163             undeploy("naming.ear");
164         }
165
166         try
167         {
168             deploy("naming.ear");
169             super.testEjbNoLink();
170         }
171         finally
172         {
173             undeploy("naming.ear");
174         }
175     }
176
177     public void testEjbNoLinkLocal() throws Exception JavaDoc
178     {
179         try
180         {
181             deploy("naming.ear");
182             super.testEjbNoLinkLocal();
183         }
184         finally
185         {
186             undeploy("naming.ear");
187         }
188
189         try
190         {
191             deploy("naming.ear");
192             super.testEjbNoLinkLocal();
193         }
194         finally
195         {
196             undeploy("naming.ear");
197         }
198     }
199
200    public void testEjbNames() throws Exception JavaDoc
201    {
202       try
203       {
204           deploy("naming.ear");
205           super.testEjbNames();
206       }
207       finally
208       {
209           undeploy("naming.ear");
210       }
211    
212       try
213       {
214           deploy("naming.ear");
215           super.testEjbNames();
216       }
217       finally
218       {
219           undeploy("naming.ear");
220       }
221    }
222
223 }
224
Popular Tags