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: TestInterceptor03.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.deploymentdesc;
025:
026: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.interceptorxml.ItfIntercResourceRef;
027: import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.interceptorxml.SLSBIntercResourceRef;
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 the container inject resources for an interceptor qhen the resources are define in the deployment descriptor.
034: * @reference JSR 220 - FINAL RELEASE
035: * @requirement the bean SLSBIntercResourceRef must be deployed to make the tests,
036: * and, the deployment descriptors must be used too.
037: * @setup gets an instance of the SLSBIntercResourceRef.
038: * @author Gisele Pinheiro Souza
039: * @author Eduardo Studzinski Estima de Castro
040: */
041: public class TestInterceptor03 {
042:
043: /**
044: * Bean used to verify the interceptor definition..
045: */
046: private ItfIntercResourceRef bean;
047:
048: /**
049: * Creates the beans used during the tests.
050: * @throws Exception if an error occurs during the lookup.
051: */
052: @BeforeMethod
053: public void setup() throws Exception {
054: bean = EJBHelper
055: .getBeanRemoteInstance(SLSBIntercResourceRef.class,
056: ItfIntercResourceRef.class);
057: }
058:
059: /**
060: * Verifies if a datasource is injected in an interceptor when it is
061: * described in the deployment descriptor.
062: * @input -
063: * @output the correct method execution.
064: */
065: @Test
066: public void verifiesDataSource() {
067: bean.checkJDBC();
068: }
069:
070: /**
071: * Verifies if a queue connection factory is injected in an interceptor when it is
072: * described in the deployment descriptor.
073: * @input -
074: * @output the correct method execution.
075: */
076: @Test
077: public void verifiesJMSQueue() {
078: bean.checkJMSQueueConFactory();
079: }
080:
081: /**
082: * Verifies if a connection factory is injected in an interceptor when it is
083: * described in the deployment descriptor.
084: * @input -
085: * @output the correct method execution.
086: */
087: @Test
088: public void verifiesJMSConFactory() {
089: bean.checkJMSConFactory();
090: }
091:
092: /**
093: * Verifies if a topic connection factory is injected in an interceptor when it is
094: * described in the deployment descriptor.
095: * @input -
096: * @output the correct method execution.
097: */
098: @Test
099: public void verifiesTopicConFactory() {
100: bean.checkJMSTopicConFactory();
101: }
102:
103: /**
104: * Verifies if the EJBContext connection factory is injected in an interceptor when it is
105: * described in the deployment descriptor.
106: * @input -
107: * @output the correct method execution.
108: */
109: @Test
110: public void verifiesEJBContext() {
111: bean.checkEJBContext();
112: }
113:
114: /**
115: * Verifies if a mail session is injected in an interceptor when it is
116: * described in the deployment descriptor.
117: * @input -
118: * @output the correct method execution.
119: */
120: @Test
121: public void verifiesMailSession() {
122: bean.checkMailSession();
123: }
124:
125: /**
126: * Verifies if an URL is injected in an interceptor when it is
127: * described in the deployment descriptor.
128: * @input -
129: * @output the correct method execution.
130: */
131: @Test
132: public void verifiesURL() {
133: bean.checkUrl();
134: }
135: }
|