001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.naming.test;
023:
024: import junit.framework.Test;
025: import junit.framework.TestSuite;
026:
027: /**
028: * InternalNamingClassReplacementUnitTestCase.java
029: * This test runs each test in EjbLingUnitTestCase twice, redeploying the ear in
030: * between runs. The purpose is to see if an application can be reloaded
031: * after use of jndi, and have the lookups work properly. The local interface
032: * lookups are very likely to work since what is bound in jndi is a reference.
033: * The remote bindings were serialized proxies when this test was written and
034: * once the class was bound once it appeared to stay bound for the
035: * lifetime of the server.
036: *
037: * Created: Wed Apr 17 09:34:15 2002
038: *
039: * @author <a href="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
040: * @author Scott.Stark@jboss.org
041: * @version $Revision: 57211 $
042: */
043: public class InternalNamingClassReplacementUnitTestCase extends
044: EjbLinkUnitTestCase {
045: public InternalNamingClassReplacementUnitTestCase(String name) {
046: super (name);
047: }
048:
049: /**
050: * Describe <code>suite</code> method here.
051: * This is supposed to hide the deploy setup in the superclass so we can deploy twice
052: * @return a <code>Test</code> value
053: * @exception Exception if an error occurs
054: */
055: public static Test suite() throws Exception {
056: TestSuite suite = new TestSuite();
057: suite.addTest(new TestSuite(
058: InternalNamingClassReplacementUnitTestCase.class));
059: return suite;
060: }
061:
062: public void testEjbLinkNamed() throws Exception {
063: try {
064: deploy("naming.ear");
065: super .testEjbLinkNamed();
066: } finally {
067: undeploy("naming.ear");
068: } // end of try-finally
069: try {
070: deploy("naming.ear");
071: super .testEjbLinkNamed();
072: } finally {
073: undeploy("naming.ear");
074: } // end of try-finally
075:
076: }
077:
078: public void testEjbLinkRelative() throws Exception {
079: try {
080: deploy("naming.ear");
081: super .testEjbLinkRelative();
082: } finally {
083: undeploy("naming.ear");
084: } // end of try-finally
085: try {
086: deploy("naming.ear");
087: super .testEjbLinkRelative();
088: } finally {
089: undeploy("naming.ear");
090: } // end of try-finally
091: }
092:
093: public void testEjbLinkLocalNamed() throws Exception {
094: try {
095: deploy("naming.ear");
096: super .testEjbLinkLocalNamed();
097: } finally {
098: undeploy("naming.ear");
099: } // end of try-finally
100: try {
101: deploy("naming.ear");
102: super .testEjbLinkLocalNamed();
103: } finally {
104: undeploy("naming.ear");
105: } // end of try-finally
106: }
107:
108: public void testEjbLinkLocalRelative() throws Exception {
109: try {
110: deploy("naming.ear");
111: super .testEjbLinkLocalRelative();
112: } finally {
113: undeploy("naming.ear");
114: } // end of try-finally
115: try {
116: deploy("naming.ear");
117: super .testEjbLinkLocalRelative();
118: } finally {
119: undeploy("naming.ear");
120: } // end of try-finally
121: }
122:
123: public void testEjbNoLink() throws Exception {
124: try {
125: deploy("naming.ear");
126: super .testEjbNoLink();
127: } finally {
128: undeploy("naming.ear");
129: }
130:
131: try {
132: deploy("naming.ear");
133: super .testEjbNoLink();
134: } finally {
135: undeploy("naming.ear");
136: }
137: }
138:
139: public void testEjbNoLinkLocal() throws Exception {
140: try {
141: deploy("naming.ear");
142: super .testEjbNoLinkLocal();
143: } finally {
144: undeploy("naming.ear");
145: }
146:
147: try {
148: deploy("naming.ear");
149: super .testEjbNoLinkLocal();
150: } finally {
151: undeploy("naming.ear");
152: }
153: }
154:
155: public void testEjbNames() throws Exception {
156: try {
157: deploy("naming.ear");
158: super .testEjbNames();
159: } finally {
160: undeploy("naming.ear");
161: }
162:
163: try {
164: deploy("naming.ear");
165: super .testEjbNames();
166: } finally {
167: undeploy("naming.ear");
168: }
169: }
170:
171: }
|