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: TestRemoteAnnotation01.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.SLSBSessionBeanTester01;
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, but it does not
034: * implement the interface can be deployed.
035: * @reference JSR 220-FINAL RELEASE
036: * @requirement Application Server must be running; the beans
037: * SLSBSessionBeanTester01, SLSBDeployTest01, SFSBDeployTest01,
038: * SLSBDeployTest02 and SFSBDeployTest02 must be deployed.
039: * @setup gets a reference of the bean SLSBSessionBeanTester.
040: * @author Gisele Pinheiro Souza
041: * @author Eduardo Studzinski Estima de Castro
042: */
043: public class TestRemoteAnnotation01 {
044:
045: /**
046: * Bean used during the test.
047: */
048: private ItfSessionBeanTester01 bean;
049:
050: /**
051: * Gets an instance of the bean.
052: * @throws Exception if an error occurs.
053: */
054: @BeforeMethod
055: public void setup() throws Exception {
056: // Gets a bean instance.
057: bean = EJBHelper.getBeanRemoteInstance(
058: SLSBSessionBeanTester01.class,
059: ItfSessionBeanTester01.class);
060: }
061:
062: /**
063: * Verifies if stateful bean that has the local interface defined by the
064: * annotation local and does not implement the local interface can be
065: * deployed.
066: * @input -
067: * @output the correct method execution.
068: */
069: @Test
070: public void testSFLocal() {
071: bean.testSFLocal();
072: }
073:
074: /**
075: * Verifies if stateless bean that has the local interface defined by the
076: * annotation local and does not implement the local interface can be
077: * deployed.
078: * @input -
079: * @output the correct method execution.
080: */
081: @Test
082: public void testSLLocal() {
083: bean.testSLLocal();
084: }
085:
086: /**
087: * Verifies if stateful bean that has the remote interface defined by the
088: * annotation remote and does not implement the local interface can be
089: * deployed.
090: * @input -
091: * @output the correct method execution.
092: */
093: @Test
094: public void testSFRemote() {
095: bean.testSFRemote();
096: }
097:
098: /**
099: * Verifies if stateless bean that has the remote interface defined by the
100: * annotation remote and does not implement the local interface can be
101: * deployed.
102: * @input -
103: * @output the correct method execution.
104: */
105: @Test
106: public void testSLRemote() {
107: bean.testSLLocal();
108: }
109: }
|