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.bmp;
017:
018: import org.apache.openejb.test.TestFailureException;
019:
020: /**
021: * [4] Should be run as the fourth test suite of the EncBmpTestClients
022: *
023: * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
024: * @author <a href="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
025: */
026: public class BmpJndiEncTests extends BmpTestClient {
027:
028: protected EncBmpHome ejbHome;
029: protected EncBmpObject ejbObject;
030:
031: public BmpJndiEncTests() {
032: super ("JNDI_ENC.");
033: }
034:
035: protected void setUp() throws Exception {
036: super .setUp();
037: Object obj = initialContext
038: .lookup("client/tests/entity/bmp/EncBean");
039: ejbHome = (EncBmpHome) javax.rmi.PortableRemoteObject.narrow(
040: obj, EncBmpHome.class);
041: ejbObject = ejbHome.create("Enc Bean");
042: }
043:
044: protected void tearDown() throws Exception {
045: try {
046: //ejbObject.remove();
047: } catch (Exception e) {
048: throw e;
049: } finally {
050: super .tearDown();
051: }
052: }
053:
054: public void test01_lookupStringEntry() {
055: try {
056: ejbObject.lookupStringEntry();
057: } catch (TestFailureException e) {
058: throw e.error;
059: } catch (Exception e) {
060: fail("Received Exception " + e.getClass() + " : "
061: + e.getMessage());
062: }
063: }
064:
065: public void test02_lookupDoubleEntry() {
066: try {
067: ejbObject.lookupDoubleEntry();
068: } catch (TestFailureException e) {
069: throw e.error;
070: } catch (Exception e) {
071: fail("Received Exception " + e.getClass() + " : "
072: + e.getMessage());
073: }
074: }
075:
076: public void test03_lookupLongEntry() {
077: try {
078: ejbObject.lookupLongEntry();
079: } catch (TestFailureException e) {
080: throw e.error;
081: } catch (Exception e) {
082: fail("Received Exception " + e.getClass() + " : "
083: + e.getMessage());
084: }
085: }
086:
087: public void test04_lookupFloatEntry() {
088: try {
089: ejbObject.lookupFloatEntry();
090: } catch (TestFailureException e) {
091: throw e.error;
092: } catch (Exception e) {
093: fail("Received Exception " + e.getClass() + " : "
094: + e.getMessage());
095: }
096: }
097:
098: public void test05_lookupIntegerEntry() {
099: try {
100: ejbObject.lookupIntegerEntry();
101: } catch (TestFailureException e) {
102: throw e.error;
103: } catch (Exception e) {
104: fail("Received Exception " + e.getClass() + " : "
105: + e.getMessage());
106: }
107: }
108:
109: public void test06_lookupShortEntry() {
110: try {
111: ejbObject.lookupShortEntry();
112: } catch (TestFailureException e) {
113: throw e.error;
114: } catch (Exception e) {
115: fail("Received Exception " + e.getClass() + " : "
116: + e.getMessage());
117: }
118: }
119:
120: public void test07_lookupBooleanEntry() {
121: try {
122: ejbObject.lookupBooleanEntry();
123: } catch (TestFailureException e) {
124: throw e.error;
125: } catch (Exception e) {
126: fail("Received Exception " + e.getClass() + " : "
127: + e.getMessage());
128: }
129: }
130:
131: public void test08_lookupByteEntry() {
132: try {
133: ejbObject.lookupByteEntry();
134: } catch (TestFailureException e) {
135: throw e.error;
136: } catch (Exception e) {
137: fail("Received Exception " + e.getClass() + " : "
138: + e.getMessage());
139: }
140: }
141:
142: public void test09_lookupCharacterEntry() {
143: try {
144: ejbObject.lookupCharacterEntry();
145: } catch (TestFailureException e) {
146: throw e.error;
147: } catch (Exception e) {
148: fail("Received Exception " + e.getClass() + " : "
149: + e.getMessage());
150: }
151: }
152:
153: public void test10_lookupEntityBean() {
154: try {
155: ejbObject.lookupEntityBean();
156: } catch (TestFailureException e) {
157: throw e.error;
158: } catch (Exception e) {
159: fail("Received Exception " + e.getClass() + " : "
160: + e.getMessage());
161: }
162: }
163:
164: public void test11_lookupStatefulBean() {
165: try {
166: ejbObject.lookupStatefulBean();
167: } catch (TestFailureException e) {
168: throw e.error;
169: } catch (Exception e) {
170: fail("Received Exception " + e.getClass() + " : "
171: + e.getMessage());
172: }
173: }
174:
175: public void test12_lookupStatelessBean() {
176: try {
177: ejbObject.lookupStatelessBean();
178: } catch (TestFailureException e) {
179: throw e.error;
180: } catch (Exception e) {
181: fail("Received Exception " + e.getClass() + " : "
182: + e.getMessage());
183: }
184: }
185:
186: public void test13_lookupResource() {
187: try {
188: ejbObject.lookupResource();
189: } catch (TestFailureException e) {
190: throw e.error;
191: } catch (Exception e) {
192: fail("Received Exception " + e.getClass() + " : "
193: + e.getMessage());
194: }
195: }
196:
197: public void test14_lookupPersistenceUnit() {
198: try {
199: ejbObject.lookupPersistenceUnit();
200: } catch (TestFailureException e) {
201: throw e.error;
202: } catch (Exception e) {
203: fail("Received Exception " + e.getClass() + " : "
204: + e.getMessage());
205: }
206: }
207:
208: public void test15_lookupPersistenceContext() {
209: try {
210: ejbObject.lookupPersistenceContext();
211: } catch (TestFailureException e) {
212: throw e.error;
213: } catch (Exception e) {
214: fail("Received Exception " + e.getClass() + " : "
215: + e.getMessage());
216: }
217: }
218:
219: public void test19_lookupStatelessBusinessLocal() {
220: try {
221: ejbObject.lookupStatelessBusinessLocal();
222: } catch (TestFailureException e) {
223: throw e.error;
224: } catch (Exception e) {
225: fail("Received Exception " + e.getClass() + " : "
226: + e.getMessage());
227: }
228: }
229:
230: public void test20_lookupStatelessBusinessRemote() {
231: try {
232: ejbObject.lookupStatelessBusinessRemote();
233: } catch (TestFailureException e) {
234: throw e.error;
235: } catch (Exception e) {
236: fail("Received Exception " + e.getClass() + " : "
237: + e.getMessage());
238: }
239: }
240:
241: public void test21_lookupStatefulBusinessLocal() {
242: try {
243: ejbObject.lookupStatefulBusinessLocal();
244: } catch (TestFailureException e) {
245: throw e.error;
246: } catch (Exception e) {
247: fail("Received Exception " + e.getClass() + " : "
248: + e.getMessage());
249: }
250: }
251:
252: public void test22_lookupStatefulBusinessRemote() {
253: try {
254: ejbObject.lookupStatefulBusinessRemote();
255: } catch (TestFailureException e) {
256: throw e.error;
257: } catch (Exception e) {
258: fail("Received Exception " + e.getClass() + " : "
259: + e.getMessage());
260: }
261: }
262:
263: public void test23_lookupJMSConnectionFactory() {
264: try {
265: ejbObject.lookupJMSConnectionFactory();
266: } catch (TestFailureException e) {
267: throw e.error;
268: } catch (Exception e) {
269: fail("Received Exception " + e.getClass() + " : "
270: + e.getMessage());
271: }
272: }
273: }
|