KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > ejb2view > TestEjb2Lifecycle


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: TestEjb2Lifecycle.java 977 2006-07-28 13:18:26Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.ejb2view;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.ejb2view.ItfEjb2ClientLifecycle;
28 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.ejb2view.SFSBEjb2ClientLifecycle;
29 import org.objectweb.easybeans.tests.common.helper.EJBHelper;
30 import org.testng.annotations.BeforeMethod;
31 import org.testng.annotations.Test;
32
33 /**
34  * Verifies the compatibility between the ejb 2.1 and the ejb 3.0. More
35  * specifically, it verifies if the callback methods are called when the bean
36  * implements the interface sessionBeans.
37  * @reference JSR 220-FINAL RELEASE
38  * @requirement Application Server must be running; the beans
39  * SFSBEjb2ClientLifecycle and SimpleEjb2LifecyleBean must be
40  * deployed.
41  * @setup gets a reference of the bean SFSBEjb2ClientLifecycle.
42  * @author Gisele Pinheiro Souza
43  * @author Eduardo Studzinski Estima de Castro
44  */

45 public class TestEjb2Lifecycle {
46
47     /**
48      * Bean that access the bean with ejb 2.1 remote view.
49      */

50     private ItfEjb2ClientLifecycle bean;
51
52     /**
53      * Gets an instance of the bean.
54      * @throws Exception if an error occurs.
55      */

56     @BeforeMethod
57     public void setup() throws Exception JavaDoc {
58         // Gets a bean instance.
59
bean = EJBHelper.getBeanRemoteInstance(SFSBEjb2ClientLifecycle.class, ItfEjb2ClientLifecycle.class);
60     }
61
62     /**
63      * Verifies if the ejbPassivate method is called. The test was not
64      * implemented yet.
65      * @input -
66      * @output -
67      */

68     @Test
69     public void testEjbPassivate() {
70         bean.verifyPassivate();
71     }
72
73     /**
74      * Verifies if the ejbActivate method is called. The test was not
75      * implemented yet.
76      * @input -
77      * @output -
78      */

79     @Test
80     public void testEjbActivate() {
81         bean.verifyActivate();
82     }
83
84     /**
85      * Verifies if the ejbRemove is called. The method remove creates log in the
86      * database to register the call.
87      * @input -
88      * @output the correct method execution. The log in the database is
89      * verified.
90      * @throws Exception if an error occurs.
91      */

92     @Test
93     public void testEjbRemove() throws Exception JavaDoc {
94         bean.verifyRemove();
95     }
96 }
97
Popular Tags