KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > interceptors > business > stateful > containermanaged > TestSFMethodInterceptor


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: TestSFMethodInterceptor.java 978 2006-07-28 13:19:14Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.interceptors.business.stateful.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.stateful.containermanaged.interceptororder.SFSBMethodInterceptorTest;
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
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 - 4.4.1
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 SFSBMethodInterceptorTest
49  * @author Eduardo Studzinski Estima de Castro
50  * @author Gisele Pinheiro Souza
51  */

52 public class TestSFMethodInterceptor 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(SFSBMethodInterceptorTest.class, ItfMethodInterceptor.class);
62         super.setBean(bean);
63     }
64
65     /**
66      * @see org.objectweb.easybeans.tests.interceptors.business.base.invocationorder.BaseMethodInterceptor
67      */

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

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

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

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

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

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

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

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

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