01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: TestInterceptor01.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.deploymentdesc;
25:
26: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.interceptorxml.ItfInterceptorTester01;
27: import org.ow2.easybeans.tests.common.ejbs.stateful.containermanaged.interceptorxml.SFSBInterceptorTester01;
28: import org.ow2.easybeans.tests.common.helper.EJBHelper;
29: import org.testng.annotations.BeforeMethod;
30: import org.testng.annotations.Test;
31:
32: /**
33: * Verifies if the container can deploy an bean with the interceptors defined in
34: * the deployment description. Item 12.8
35: * @reference JSR 220 - FINAL RELEASE
36: * @requirement the bean SFSBInterceptorTester01 and SFSBInterceptorXML must be
37: * deployed to make the tests, and, the deployment descriptors must
38: * be used too.
39: * @setup gets an instance of the SFSBInterceptorTester01.
40: * @author Gisele Pinheiro Souza
41: * @author Eduardo Studzinski Estima de Castro
42: */
43: public class TestInterceptor01 {
44:
45: /**
46: * Bean used to verify the interceptor definition..
47: */
48: private ItfInterceptorTester01 tester;
49:
50: /**
51: * Creates the beans used during the tests.
52: * @throws Exception if an error occurs during the lookup.
53: */
54: @BeforeMethod
55: public void setup() throws Exception {
56: tester = EJBHelper.getBeanRemoteInstance(
57: SFSBInterceptorTester01.class,
58: ItfInterceptorTester01.class);
59: }
60:
61: /**
62: * Verifies if the default interceptor defined
63: * in the deployment descriptors is called.
64: * @input -
65: * @output the correct method execution.
66: */
67: @Test
68: public void testInterceptorOrder01() {
69: tester.testInterceptorOrder01();
70: }
71:
72: /**
73: * Verifies if the interceptor defined for a method specific(defined by name
74: * and parameters) is called only for this method. The interceptor is
75: * defined to the methods with the name insertOrder2(List), so only the the
76: * method insertOrder2(List) must have the method interceptor called.
77: * @input -
78: * @output the correct method execution.
79: */
80: @Test
81: public void testInterceptorOrder02() {
82: tester.testInterceptorOrder02();
83: }
84:
85: /**
86: * Verifies the element exclude default interceptors.
87: * @input -
88: * @output the correct method execution.
89: */
90: @Test
91: public void testInterceptorOrder03() {
92: tester.testInterceptorOrder03();
93: }
94: }
|