KickJava   Java API By Example, From Geeks To Geeks.

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


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: TestSLMethodInterceptor.java 703 2006-06-21 14:33:25Z 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.ItfMethodInterceptor;
30 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptororder.SLSBMethodInterceptorTest;
31 import org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor;
32 import org.testng.annotations.BeforeMethod;
33 import org.testng.annotations.Test;
34
35 /**
36  * Verifies if the order to execute the method interceptors is correct. The
37  * correct order is: <li>Default Interceptor in the order of theirs
38  * specification.</li> <li>Interceptor Classes in the order of theirs
39  * specification.</li> <li>Interceptor Methods in the order of theirs
40  * specification.</li> <li>Interceptors annotated to a business method in the
41  * order of theirs specification.</li> <br> The bean used to the test has one
42  * interceptor.
43  * @reference JSR 220 - EJB 3.0 Core - 12.7
44  * @requirement Application Server must be running; the bean
45  * org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.SLSBMethodInterceptorTest.java
46  * must be deployed.
47  * (Ant task: install.jar.tests.interceptor.business)
48  * @setup gets the reference of SLSBMethodInterceptorTest
49  * @author Eduardo Studzinski Estima de Castro
50  * @author Gisele Pinheiro Souza
51  */

52 public class TestSLMethodInterceptor extends BaseMethodInterceptor {
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         ItfMethodInterceptor<Integer JavaDoc> bean = getBeanRemoteInstance(SLSBMethodInterceptorTest.class,
62                 ItfMethodInterceptor.class);
63         super.setBean(bean);
64     }
65
66     /**
67      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
68      */

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

78     @Override JavaDoc
79     @Test(groups = {"withInterceptor"})
80     public void interceptorMethodTest02() {
81         super.interceptorMethodTest02();
82     }
83
84     /**
85      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
86      */

87     @Override JavaDoc
88     @Test(groups = {"withInterceptor"})
89     public void interceptorMethodTest03() {
90         super.interceptorMethodTest03();
91     }
92
93     /**
94      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
95      */

96     @Override JavaDoc
97     @Test(groups = {"withInterceptor", "withInheritance"})
98     public void interceptorMethodTest04() {
99         super.interceptorMethodTest04();
100     }
101
102     /**
103      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
104      */

105     @Override JavaDoc
106     @Test(groups = {"withInterceptor", "withInheritance"})
107     public void interceptorMethodTest05() {
108         super.interceptorMethodTest05();
109     }
110
111     /**
112      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
113      */

114     @Override JavaDoc
115     @Test(groups = {"withInterceptor"})
116     public void interceptorMethodTest06() {
117         super.interceptorMethodTest06();
118     }
119
120     /**
121      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
122      */

123     @Override JavaDoc
124     @Test(groups = {"withInterceptor"})
125     public void interceptorMethodTest07() {
126         super.interceptorMethodTest07();
127     }
128
129     /**
130      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
131      */

132     @Override JavaDoc
133     @Test(groups = {"withInterceptor", "withInheritance"})
134     public void interceptorMethodTest08() {
135         super.interceptorMethodTest08();
136     }
137
138     /**
139      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
140      */

141     @Override JavaDoc
142     @Test(groups = {"withInterceptor", "withInheritance"})
143     public void interceptorMethodTest09() {
144         super.interceptorMethodTest09();
145     }
146 }
147
Popular Tags