KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > sessionbean > misc > TestRemoteAnnotation


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: TestRemoteAnnotation.java 979 2006-07-28 13:19:50Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.sessionbean.misc;
26
27 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.basic.ItfSessionBeanTester;
28 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.basic.SLSBSessionBeanTester;
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 annotation remote when a bean has only one interface and has the annotation without value defined.
35  * @reference JSR 220-FINAL RELEASE
36  * @requirement Application Server must be running; the beans SLSBSessionBeanTester, SLSBDeployTest and SFSBDeployTest
37  * must be deployed.
38  * @setup gets a reference of the bean SLSBSessionBeanTester.
39  * @author Gisele Pinheiro Souza
40  * @author Eduardo Studzinski Estima de Castro
41  */

42 public class TestRemoteAnnotation {
43
44     /**
45      * Bean used during the test.
46      */

47     private ItfSessionBeanTester bean;
48
49     /**
50      * Gets an instance of the bean.
51      * @throws Exception if an error occurs.
52      */

53     @BeforeMethod
54     public void setup() throws Exception JavaDoc {
55         // Gets a bean instance.
56
bean = EJBHelper.getBeanRemoteInstance(SLSBSessionBeanTester.class, ItfSessionBeanTester.class);
57     }
58
59     /**
60      * Verifies if the container sets a stateful bean interface as remote when the bean
61      * has only one interface and the annotation Remote without value. The bean
62      * was goten by annotation.
63      * @input the bean injected
64      * @output the correct method execution
65      */

66     @Test
67     public void testSFByInjection() {
68         bean.testSFSBByInjection();
69     }
70
71     /**
72      * Verifies if the container sets a stateful bean interface as remote when the bean
73      * has only one interface and the annotation Remote without value. The bean
74      * was goten by lookup.
75      * @input the bean injected
76      * @output the correct method execution
77      * @throws Exception if a lookup error occurs.
78      */

79     @Test
80     public void testSFByLookup() throws Exception JavaDoc {
81         bean.testSFSBByLookup();
82     }
83
84     /**
85      * Verifies if the container sets a stateless bean interface as remote when the bean
86      * has only one interface and the annotation Remote without value. The bean
87      * was goten by annotation.
88      * @input the bean injected
89      * @output the correct method execution
90      */

91     @Test
92     public void testSLByInjection() {
93         bean.testSLSBByInjection();
94     }
95
96     /**
97      * Verifies if the container sets a stateless bean interface as remote when the bean
98      * has only one interface and the annotation Remote without value. The bean
99      * was goten by annotation.
100      * @input the bean injected
101      * @output the correct method execution
102      * @throws Exception if a lookup error occurs.
103      */

104     @Test
105     public void testSLByLookup() throws Exception JavaDoc {
106         bean.testSLSBByLookup();
107     }
108 }
109
Popular Tags