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: TestSFMethodInterceptor.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.interceptors.business.stateful.containermanaged;
025:
026: import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028: import org.ow2.easybeans.tests.common.ejbs.base.ItfMethodInterceptor;
029: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.interceptororder.SFSBMethodInterceptorTest;
030: import org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor;
031: import org.testng.annotations.BeforeMethod;
032: import org.testng.annotations.Test;
033:
034: /**
035: * Verifies if the order to execute the method interceptors is
036: * correct. The correct order is:
037: * <li>Default Interceptor in the order of theirs specification.</li>
038: * <li>Interceptor Classes in the order of theirs specification.</li>
039: * <li>Interceptor Methods in the order of theirs specification.</li>
040: * <li>Interceptors annotated to a business method in the order of theirs specification.</li>
041: * <br> The bean used to the test has one interceptor.
042: * @reference JSR 220 - EJB 3.0 Core - 4.4.1
043: * @requirement Application Server must be running; the bean
044: * org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.SLSBMethodInterceptorTest.java
045: * must be deployed.
046: * (Ant task: install.jar.tests.interceptor.business)
047: * @setup gets the reference of SFSBMethodInterceptorTest
048: * @author Eduardo Studzinski Estima de Castro
049: * @author Gisele Pinheiro Souza
050: */
051: public class TestSFMethodInterceptor extends BaseMethodInterceptor {
052:
053: /**
054: * Gets bean instance used in the tests.
055: * @throws Exception if there is a problem with the bean initialization.
056: */
057: @SuppressWarnings("unchecked")
058: @BeforeMethod
059: public void startUp() throws Exception {
060: ItfMethodInterceptor<Integer> bean = getBeanRemoteInstance(
061: SFSBMethodInterceptorTest.class,
062: ItfMethodInterceptor.class);
063: super .setBean(bean);
064: }
065:
066: /**
067: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
068: */
069: @Override
070: @Test(groups={"withoutInterceptor"})
071: public void interceptorMethodTest00() {
072: super .interceptorMethodTest00();
073: }
074:
075: /**
076: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
077: */
078: @Override
079: @Test(groups={"withInterceptor"})
080: public void interceptorMethodTest02() {
081: super .interceptorMethodTest02();
082: }
083:
084: /**
085: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
086: */
087: @Override
088: @Test(groups={"withInterceptor"})
089: public void interceptorMethodTest03() {
090: super .interceptorMethodTest03();
091: }
092:
093: /**
094: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
095: */
096: @Override
097: @Test(groups={"withInterceptor","withInheritance"})
098: public void interceptorMethodTest04() {
099: super .interceptorMethodTest04();
100: }
101:
102: /**
103: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
104: */
105: @Override
106: @Test(groups={"withInterceptor","withInheritance"})
107: public void interceptorMethodTest05() {
108: super .interceptorMethodTest05();
109: }
110:
111: /**
112: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
113: */
114: @Override
115: @Test(groups={"withInterceptor"})
116: public void interceptorMethodTest06() {
117: super .interceptorMethodTest06();
118: }
119:
120: /**
121: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
122: */
123: @Override
124: @Test(groups={"withInterceptor"})
125: public void interceptorMethodTest07() {
126: super .interceptorMethodTest07();
127: }
128:
129: /**
130: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
131: */
132: @Override
133: @Test(groups={"withInterceptor","withInheritance"})
134: public void interceptorMethodTest08() {
135: super .interceptorMethodTest08();
136: }
137:
138: /**
139: * @see org.ow2.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
140: */
141: @Override
142: @Test(groups={"withInterceptor","withInheritance"})
143: public void interceptorMethodTest09() {
144: super.interceptorMethodTest09();
145: }
146: }
|