001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.test.entity.cmp2;
017:
018: import org.apache.openejb.test.TestFailureException;
019: import org.apache.openejb.test.entity.cmp.EncCmpHome;
020: import org.apache.openejb.test.entity.cmp.EncCmpObject;
021:
022: /**
023: * [4] Should be run as the fourth test suite of the EncCmpTestClients
024: */
025: public class Cmp2JndiEncTests extends Cmp2TestClient {
026:
027: protected EncCmpHome ejbHome;
028: protected EncCmpObject ejbObject;
029:
030: public Cmp2JndiEncTests() {
031: super ("JNDI_ENC.");
032: }
033:
034: protected void setUp() throws Exception {
035: super .setUp();
036: Object obj = initialContext
037: .lookup("client/tests/entity/cmp2/EncBean");
038: ejbHome = (EncCmpHome) javax.rmi.PortableRemoteObject.narrow(
039: obj, EncCmpHome.class);
040: ejbObject = ejbHome.create("Enc Bean");
041: }
042:
043: protected void tearDown() throws Exception {
044: try {
045: //ejbObject.remove();
046: } catch (Exception e) {
047: throw e;
048: } finally {
049: super .tearDown();
050: }
051: }
052:
053: public void test01_lookupStringEntry() {
054: try {
055: ejbObject.lookupStringEntry();
056: } catch (TestFailureException e) {
057: throw e.error;
058: } catch (Exception e) {
059: fail("Received Exception " + e.getClass() + " : "
060: + e.getMessage());
061: }
062: }
063:
064: public void test02_lookupDoubleEntry() {
065: try {
066: ejbObject.lookupDoubleEntry();
067: } catch (TestFailureException e) {
068: throw e.error;
069: } catch (Exception e) {
070: fail("Received Exception " + e.getClass() + " : "
071: + e.getMessage());
072: }
073: }
074:
075: public void test03_lookupLongEntry() {
076: try {
077: ejbObject.lookupLongEntry();
078: } catch (TestFailureException e) {
079: throw e.error;
080: } catch (Exception e) {
081: fail("Received Exception " + e.getClass() + " : "
082: + e.getMessage());
083: }
084: }
085:
086: public void test04_lookupFloatEntry() {
087: try {
088: ejbObject.lookupFloatEntry();
089: } catch (TestFailureException e) {
090: throw e.error;
091: } catch (Exception e) {
092: fail("Received Exception " + e.getClass() + " : "
093: + e.getMessage());
094: }
095: }
096:
097: public void test05_lookupIntegerEntry() {
098: try {
099: ejbObject.lookupIntegerEntry();
100: } catch (TestFailureException e) {
101: throw e.error;
102: } catch (Exception e) {
103: fail("Received Exception " + e.getClass() + " : "
104: + e.getMessage());
105: }
106: }
107:
108: public void test06_lookupShortEntry() {
109: try {
110: ejbObject.lookupShortEntry();
111: } catch (TestFailureException e) {
112: throw e.error;
113: } catch (Exception e) {
114: fail("Received Exception " + e.getClass() + " : "
115: + e.getMessage());
116: }
117: }
118:
119: public void test07_lookupBooleanEntry() {
120: try {
121: ejbObject.lookupBooleanEntry();
122: } catch (TestFailureException e) {
123: throw e.error;
124: } catch (Exception e) {
125: fail("Received Exception " + e.getClass() + " : "
126: + e.getMessage());
127: }
128: }
129:
130: public void test08_lookupByteEntry() {
131: try {
132: ejbObject.lookupByteEntry();
133: } catch (TestFailureException e) {
134: throw e.error;
135: } catch (Exception e) {
136: fail("Received Exception " + e.getClass() + " : "
137: + e.getMessage());
138: }
139: }
140:
141: public void test09_lookupEntityBean() {
142: try {
143: ejbObject.lookupEntityBean();
144: } catch (TestFailureException e) {
145: throw e.error;
146: } catch (Exception e) {
147: fail("Received Exception " + e.getClass() + " : "
148: + e.getMessage());
149: }
150: }
151:
152: public void test10_lookupStatefulBean() {
153: try {
154: ejbObject.lookupStatefulBean();
155: } catch (TestFailureException e) {
156: throw e.error;
157: } catch (Exception e) {
158: fail("Received Exception " + e.getClass() + " : "
159: + e.getMessage());
160: }
161: }
162:
163: public void test11_lookupStatelessBean() {
164: try {
165: ejbObject.lookupStatelessBean();
166: } catch (TestFailureException e) {
167: throw e.error;
168: } catch (Exception e) {
169: fail("Received Exception " + e.getClass() + " : "
170: + e.getMessage());
171: }
172: }
173:
174: public void test12_lookupResource() {
175: try {
176: ejbObject.lookupResource();
177: } catch (TestFailureException e) {
178: throw e.error;
179: } catch (Exception e) {
180: fail("Received Exception " + e.getClass() + " : "
181: + e.getMessage());
182: }
183: }
184:
185: public void test13_lookupPersistenceUnit() {
186: try {
187: ejbObject.lookupPersistenceUnit();
188: } catch (TestFailureException e) {
189: throw e.error;
190: } catch (Exception e) {
191: fail("Received Exception " + e.getClass() + " : "
192: + e.getMessage());
193: }
194: }
195:
196: public void test14_lookupPersistenceContext() {
197: try {
198: ejbObject.lookupPersistenceContext();
199: } catch (TestFailureException e) {
200: throw e.error;
201: } catch (Exception e) {
202: fail("Received Exception " + e.getClass() + " : "
203: + e.getMessage());
204: }
205: }
206:
207: public void test19_lookupStatelessBusinessLocal() {
208: try {
209: ejbObject.lookupStatelessBusinessLocal();
210: } catch (TestFailureException e) {
211: throw e.error;
212: } catch (Exception e) {
213: fail("Received Exception " + e.getClass() + " : "
214: + e.getMessage());
215: }
216: }
217:
218: public void test20_lookupStatelessBusinessRemote() {
219: try {
220: ejbObject.lookupStatelessBusinessRemote();
221: } catch (TestFailureException e) {
222: throw e.error;
223: } catch (Exception e) {
224: fail("Received Exception " + e.getClass() + " : "
225: + e.getMessage());
226: }
227: }
228:
229: public void test21_lookupStatefulBusinessLocal() {
230: try {
231: ejbObject.lookupStatefulBusinessLocal();
232: } catch (TestFailureException e) {
233: throw e.error;
234: } catch (Exception e) {
235: fail("Received Exception " + e.getClass() + " : "
236: + e.getMessage());
237: }
238: }
239:
240: public void test22_lookupStatefulBusinessRemote() {
241: try {
242: ejbObject.lookupStatefulBusinessRemote();
243: } catch (TestFailureException e) {
244: throw e.error;
245: } catch (Exception e) {
246: fail("Received Exception " + e.getClass() + " : "
247: + e.getMessage());
248: }
249: }
250:
251: public void test23_lookupJMSConnectionFactory() {
252: try {
253: ejbObject.lookupJMSConnectionFactory();
254: } catch (TestFailureException e) {
255: throw e.error;
256: } catch (Exception e) {
257: fail("Received Exception " + e.getClass() + " : "
258: + e.getMessage());
259: }
260: }
261: }
|