KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > interceptors > business > stateless > containermanaged > TestSLClassInterceptor01


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: TestSLClassInterceptor01.java 360 2006-04-19 07:51:41Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.interceptors.business.stateless.containermanaged;
26
27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
28
29 import org.objectweb.easybeans.tests.common.ejbs.base.ItfClassInterceptor;
30 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptororder.SLSBClassInterceptorTest01;
31 import org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01;
32 import org.testng.annotations.BeforeMethod;
33 import org.testng.annotations.Test;
34
35 /**
36  * Verifies if the order to execute the class and method interceptors is
37  * correct. The correct order is:
38  * <li>Default Interceptor in the order of theirs specification.</li>
39  * <li>Interceptor Classes in the order of theirs specification.</li>
40  * <li>Interceptor Methods in the order of theirs specification.</li>
41  * <li>Interceptors annotated to a business method in the order of theirs specification.</li>
42  * <br> The bean used to the test has one interceptor.
43  * @reference JSR 220 - EJB 3.0 Core - 12.3.1
44  * @requirement Application Server must be running; the bean
45  * org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.SLSBClassInterceptorTest01.java
46  * must be deployed.
47  * (Ant task: install.jar.tests.interceptor.business)
48  * @setup gets the reference of SLSBClassInterceptorTest01
49  * @author Gisele Pinheiro Souza
50  * @author Eduardo Studzinski Estima de Castro
51  */

52 public class TestSLClassInterceptor01 extends BaseClassInterceptor01{
53
54     /**
55      * Gets bean instance used in the tests.
56      * @throws Exception if there is a problem with the bean initialization.
57      */

58     @SuppressWarnings JavaDoc("unchecked")
59     @BeforeMethod
60     public void startUp() throws Exception JavaDoc{
61         ItfClassInterceptor<Integer JavaDoc> bean = getBeanRemoteInstance(SLSBClassInterceptorTest01.class, ItfClassInterceptor.class);
62         super.setBean(bean);
63     }
64
65     /**
66      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
67      *
68      */

69     @Override JavaDoc
70     @Test(groups = {"onlyClassInterceptor"})
71     public void testClassInterCallOrder00() {
72         super.testClassInterCallOrder00();
73     }
74
75     /**
76      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
77      *
78      */

79     @Override JavaDoc
80     @Test(groups = {"excludeDefaultInterceptor", "onlyClassInterceptor"})
81     public void testClassInterCallOrder01() {
82         super.testClassInterCallOrder01();
83     }
84
85     /**
86      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
87      *
88      */

89     @Override JavaDoc
90     @Test(groups = {"excludeClassInterceptor", "onlyClassInterceptor"})
91     public void testClassInterCallOrder02() {
92         super.testClassInterCallOrder02();
93     }
94
95     /**
96      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
97      *
98      */

99     @Override JavaDoc
100     @Test(groups = {"methodInterceptor", "excludeClassInterceptor"})
101     public void testClassInterCallOrder03() {
102         super.testClassInterCallOrder03();
103     }
104
105     /**
106      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
107      *
108      */

109     @Override JavaDoc
110     @Test(groups = {"excludeClassInterceptor", "methodInterceptor", "withInheritance"})
111     public void testClassInterCallOrder04() {
112         super.testClassInterCallOrder04();
113     }
114
115     /**
116      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
117      *
118      */

119     @Override JavaDoc
120     @Test(groups = {"methodInterceptor", "withInheritance"})
121     public void testClassInterCallOrder05() {
122         super.testClassInterCallOrder05();
123     }
124
125     /**
126      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseClassInterceptor01
127      *
128      */

129     @Override JavaDoc
130     @Test(groups = {"methodInterceptor"})
131     public void testClassInterCallOrder06() {
132         super.testClassInterCallOrder06();
133     }
134 }
135
Popular Tags