001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: TestRemoteAnnotation02.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.sessionbean.misc;
025:
026: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.basic.ItfSessionBeanTester01;
027: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.basic.SLSBSessionBeanTester02;
028: import org.ow2.easybeans.tests.common.helper.EJBHelper;
029: import org.testng.annotations.BeforeMethod;
030: import org.testng.annotations.Test;
031:
032: /**
033: * Verifies if a bean that has the annotations local and remote in the superclass can be deployed.
034: * @reference JSR 220-FINAL RELEASE
035: * @requirement Application Server must be running; the beans
036: * SLSBSessionBeanTester02, SLSBDeployTest03, SFSBDeployTest03,
037: * SLSBDeployTest04 and SFSBDeployTest04 must be deployed.
038: * @setup gets a reference of the bean SLSBSessionBeanTester02.
039: * @author Gisele Pinheiro Souza
040: * @author Eduardo Studzinski Estima de Castro
041: */
042: public class TestRemoteAnnotation02 {
043:
044: /**
045: * Bean used during the test.
046: */
047: private ItfSessionBeanTester01 bean;
048:
049: /**
050: * Gets an instance of the bean.
051: * @throws Exception if an error occurs.
052: */
053: @BeforeMethod
054: public void setup() throws Exception {
055: // Gets a bean instance.
056: bean = EJBHelper.getBeanRemoteInstance(
057: SLSBSessionBeanTester02.class,
058: ItfSessionBeanTester01.class);
059: }
060:
061: /**
062: * Verifies if stateful bean that has the local interface defined by the
063: * annotation local and does not implement the local interface can be
064: * deployed.
065: * @input -
066: * @output the correct method execution.
067: */
068: @Test
069: public void testSFLocal() {
070: bean.testSFLocal();
071: }
072:
073: /**
074: * Verifies if stateless bean that has the local interface defined by the
075: * annotation local and does not implement the local interface can be
076: * deployed.
077: * @input -
078: * @output the correct method execution.
079: */
080: @Test
081: public void testSLLocal() {
082: bean.testSLLocal();
083: }
084:
085: /**
086: * Verifies if stateful bean that has the remote interface defined by the
087: * annotation remote and does not implement the local interface can be
088: * deployed.
089: * @input -
090: * @output the correct method execution.
091: */
092: @Test
093: public void testSFRemote() {
094: bean.testSFRemote();
095: }
096:
097: /**
098: * Verifies if stateless bean that has the remote interface defined by the
099: * annotation remote and does not implement the local interface can be
100: * deployed.
101: * @input -
102: * @output the correct method execution.
103: */
104: @Test
105: public void testSLRemote() {
106: bean.testSLLocal();
107: }
108: }
|