KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > entity > listeners > TestListeners06


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: TestListeners06.java 977 2006-07-28 13:18:26Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.entity.listeners;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.listeners.ItfListenerTester;
28 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.listeners.SLSBListenerTester06;
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 if the container can manage listeners, when a class that has a
35  * listener defined in the superclass and has more listeners defined in
36  * the entity class. The item tested is the 3.5.4.
37  * @reference JSR 220-PROPOSED FINAL
38  * @requirement Application Server must be running; the bean
39  * SLSBListenerTester06 must be deployed.
40  * @setup gets the reference of SLSBListenerTester06
41  * @author Gisele Pinheiro Souza
42  * @author Eduardo Studzinski Estima de Castro
43  */

44 public class TestListeners06 {
45
46
47     /**
48      * The bean used during the tests.
49      */

50     private ItfListenerTester sfsbListenerTester;
51
52     /**
53      * Creates the stateless bean used during the tests.
54      * @throws Exception if an error occurs during the lookup.
55      */

56     @BeforeMethod
57     public void setup() throws Exception JavaDoc {
58          sfsbListenerTester = EJBHelper.getBeanRemoteInstance(SLSBListenerTester06.class,
59                 ItfListenerTester.class);
60      }
61
62     /**
63      * Verifies if the container call in order the superclass listeners and the
64      * listeners in the class.The callback method tested are PrePersist and the
65      * PostPersist.
66      * @input -
67      * @output the correct method execution
68      */

69     @Test
70     public void testPersistWithThreeListeners(){
71         sfsbListenerTester.testPersistCallbackMethods();
72     }
73
74     /**
75      * Verifies if the container call in order the superclass listeners and the
76      * listeners in the class.The callback method tested are PreRemove and the
77      * PostRemove.
78      * @input -
79      * @output the correct method execution
80      */

81     @Test
82     public void testRemoveWithWithThreeListeners(){
83         sfsbListenerTester.testRemoveCallbackMethods();
84     }
85
86     /**
87      * Verifies if the container call in order the superclass listeners and the
88      * listeners in the class.The callback method tested are PreUpdate and the
89      * PostUpdate.
90      * @input -
91      * @output the correct method execution
92      */

93     @Test
94     public void testUpdateWithThreeListeners(){
95         sfsbListenerTester.testUpdateCallbackMethods();
96     }
97
98     /**
99      * Verifies if the container call in order the superclass listeners and the
100      * listeners in the class.The callback method tested is the PostLoad.
101      * @input -
102      * @output the correct method execution
103      */

104     @Test
105     public void testRefreshWithThreeListeners(){
106         sfsbListenerTester.testLoadCallbackMethods();
107     }
108 }
109
Popular Tags