KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > test > entity > cmp > CmpJndiEncTests


1 /**
2  * Redistribution and use of this software and associated documentation
3  * ("Software"), with or without modification, are permitted provided
4  * that the following conditions are met:
5  *
6  * 1. Redistributions of source code must retain copyright
7  * statements and notices. Redistributions must also contain a
8  * copy of this document.
9  *
10  * 2. Redistributions in binary form must reproduce the
11  * above copyright notice, this list of conditions and the
12  * following disclaimer in the documentation and/or other
13  * materials provided with the distribution.
14  *
15  * 3. The name "Exolab" must not be used to endorse or promote
16  * products derived from this Software without prior written
17  * permission of Exoffice Technologies. For written permission,
18  * please contact info@exolab.org.
19  *
20  * 4. Products derived from this Software may not be called "Exolab"
21  * nor may "Exolab" appear in their names without prior written
22  * permission of Exoffice Technologies. Exolab is a registered
23  * trademark of Exoffice Technologies.
24  *
25  * 5. Due credit should be given to the Exolab Project
26  * (http://www.exolab.org/).
27  *
28  * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
29  * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
32  * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39  * OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  * Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
42  *
43  * $Id: CmpJndiEncTests.java 1096 2004-03-26 21:41:16Z dblevins $
44  */

45 package org.openejb.test.entity.cmp;
46
47 import org.openejb.test.TestFailureException;
48
49 /**
50  * [4] Should be run as the fourth test suite of the EncCmpTestClients
51  *
52  * @author <a HREF="mailto:david.blevins@visi.com">David Blevins</a>
53  * @author <a HREF="mailto:Richard@Monson-Haefel.com">Richard Monson-Haefel</a>
54  */

55 public class CmpJndiEncTests extends CmpTestClient{
56
57     protected EncCmpHome ejbHome;
58     protected EncCmpObject ejbObject;
59     
60     public CmpJndiEncTests(){
61         super("JNDI_ENC.");
62     }
63
64     protected void setUp() throws Exception JavaDoc{
65         super.setUp();
66         Object JavaDoc obj = initialContext.lookup("client/tests/entity/cmp/EncBean");
67         ejbHome = (EncCmpHome)javax.rmi.PortableRemoteObject.narrow( obj, EncCmpHome.class);
68         ejbObject = ejbHome.create("Enc Bean");
69     }
70     
71     protected void tearDown() throws Exception JavaDoc {
72         try {
73             //ejbObject.remove();
74
} catch (Exception JavaDoc e){
75             throw e;
76         } finally {
77             super.tearDown();
78         }
79     }
80     
81     public void test01_lookupStringEntry() {
82         try{
83             ejbObject.lookupStringEntry();
84         } catch (TestFailureException e){
85             throw e.error;
86         } catch (Exception JavaDoc e){
87             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
88         }
89     }
90     
91     public void test02_lookupDoubleEntry() {
92         try{
93             ejbObject.lookupDoubleEntry();
94         } catch (TestFailureException e){
95             throw e.error;
96         } catch (Exception JavaDoc e){
97             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
98         }
99     }
100     
101     public void test03_lookupLongEntry() {
102         try{
103             ejbObject.lookupLongEntry();
104         } catch (TestFailureException e){
105             throw e.error;
106         } catch (Exception JavaDoc e){
107             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
108         }
109     }
110     
111     public void test04_lookupFloatEntry() {
112         try{
113             ejbObject.lookupFloatEntry();
114         } catch (TestFailureException e){
115             throw e.error;
116         } catch (Exception JavaDoc e){
117             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
118         }
119     }
120     
121     public void test05_lookupIntegerEntry() {
122         try{
123             ejbObject.lookupIntegerEntry();
124         } catch (TestFailureException e){
125             throw e.error;
126         } catch (Exception JavaDoc e){
127             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
128         }
129     }
130     
131     public void test06_lookupShortEntry() {
132         try{
133             ejbObject.lookupShortEntry();
134         } catch (TestFailureException e){
135             throw e.error;
136         } catch (Exception JavaDoc e){
137             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
138         }
139     }
140     
141     public void test07_lookupBooleanEntry() {
142         try{
143             ejbObject.lookupBooleanEntry();
144         } catch (TestFailureException e){
145             throw e.error;
146         } catch (Exception JavaDoc e){
147             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
148         }
149     }
150     
151     public void test08_lookupByteEntry() {
152         try{
153             ejbObject.lookupByteEntry();
154         } catch (TestFailureException e){
155             throw e.error;
156         } catch (Exception JavaDoc e){
157             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
158         }
159     }
160     
161     public void test09_lookupEntityBean() {
162         try{
163             ejbObject.lookupEntityBean();
164         } catch (TestFailureException e){
165             throw e.error;
166         } catch (Exception JavaDoc e){
167             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
168         }
169     }
170     
171     public void test10_lookupStatefulBean() {
172         try{
173             ejbObject.lookupStatefulBean();
174         } catch (TestFailureException e){
175             throw e.error;
176         } catch (Exception JavaDoc e){
177             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
178         }
179     }
180     
181     public void test11_lookupStatelessBean() {
182         try{
183             ejbObject.lookupStatelessBean();
184         } catch (TestFailureException e){
185             throw e.error;
186         } catch (Exception JavaDoc e){
187             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
188         }
189     }
190     
191     public void test12_lookupResource() {
192         try{
193             ejbObject.lookupResource();
194         } catch (TestFailureException e){
195             throw e.error;
196         } catch (Exception JavaDoc e){
197             fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
198         }
199     }
200     
201 }
202
Popular Tags