01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.ejb2view;
25:
26: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.ejb2view.ItfEjb2ClientLifecycle;
27: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.ejb2view.SFSBEjb2ClientLifecycle;
28: import org.ow2.easybeans.tests.common.helper.EJBHelper;
29: import org.testng.annotations.BeforeMethod;
30: import org.testng.annotations.Test;
31:
32: /**
33: * Verifies the compatibility between the ejb 2.1 and the ejb 3.0. More
34: * specifically, it verifies if the callback methods are called when the bean
35: * implements the interface sessionBeans.
36: * @reference JSR 220-FINAL RELEASE
37: * @requirement Application Server must be running; the beans
38: * SFSBEjb2ClientLifecycle and SimpleEjb2LifecyleBean must be
39: * deployed.
40: * @setup gets a reference of the bean SFSBEjb2ClientLifecycle.
41: * @author Gisele Pinheiro Souza
42: * @author Eduardo Studzinski Estima de Castro
43: */
44: public class TestEjb2Lifecycle {
45:
46: /**
47: * Bean that access the bean with ejb 2.1 remote view.
48: */
49: private ItfEjb2ClientLifecycle bean;
50:
51: /**
52: * Gets an instance of the bean.
53: * @throws Exception if an error occurs.
54: */
55: @BeforeMethod
56: public void setup() throws Exception {
57: // Gets a bean instance.
58: bean = EJBHelper.getBeanRemoteInstance(
59: SFSBEjb2ClientLifecycle.class,
60: ItfEjb2ClientLifecycle.class);
61: }
62:
63: /**
64: * Verifies if the ejbPassivate method is called. The test was not
65: * implemented yet.
66: * @input -
67: * @output -
68: */
69: @Test
70: public void testEjbPassivate() {
71: bean.verifyPassivate();
72: }
73:
74: /**
75: * Verifies if the ejbActivate method is called. The test was not
76: * implemented yet.
77: * @input -
78: * @output -
79: */
80: @Test
81: public void testEjbActivate() {
82: bean.verifyActivate();
83: }
84:
85: /**
86: * Verifies if the ejbRemove is called. The method remove creates log in the
87: * database to register the call.
88: * @input -
89: * @output the correct method execution. The log in the database is
90: * verified.
91: * @throws Exception if an error occurs.
92: */
93: @Test
94: public void testEjbRemove() throws Exception {
95: bean.verifyRemove();
96: }
97: }
|