Source Code Cross Referenced for TestInvocation00.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » tests » interceptors » invocationcontext » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » ow2 easybeans » org.ow2.easybeans.tests.interceptors.invocationcontext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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: TestInvocation00.java 1970 2007-10-16 11:49:25Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package org.ow2.easybeans.tests.interceptors.invocationcontext;
025:
026:        import static org.ow2.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance;
027:
028:        import org.ow2.easybeans.tests.common.ejbs.base.ItfOneMethod00;
029:        import org.ow2.easybeans.tests.common.ejbs.base.invocationcontext.ItfInvocation00;
030:        import org.ow2.easybeans.tests.common.ejbs.base.invocationcontext.ItfInvocationParameter01;
031:        import org.ow2.easybeans.tests.common.ejbs.base.invocationcontext.ItfInvocationParameterTest;
032:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationContext00;
033:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationContext01;
034:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationContext02;
035:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationContext03;
036:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationParameter00;
037:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationParameter01;
038:        import org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext.SLSBInvocationParameterTest;
039:        import org.ow2.easybeans.tests.common.interceptors.invocationcontext.BeanDescriptor;
040:        import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ComplexObject00;
041:        import org.testng.annotations.Test;
042:
043:        /**
044:         * Verifies if the invocation context is following the JSR 220 spec.
045:         * @reference JSR 220 - EJB 3.0 Core - 12.5
046:         * @requirement Application Server must be running; the bean
047:         *              org.ow2.easybeans.tests.common.ejbs.stateless.SLSB*Invocation*
048:         *              must be deployed.
049:         *              (Ant task: install.jar.tests.interceptor.invocationcontext)
050:         * @setup gets the reference of SLSBInvocation*
051:         * @author Eduardo Studzinski Estima de Castro
052:         * @author Gisele Pinheiro Souza
053:         */
054:        public class TestInvocation00 {
055:
056:            /**
057:             * Constant value.
058:             */
059:            public static final int VALUE = 5000;
060:
061:            /**
062:             * Verifies if the InvocationContext in interceptor classes maintains the
063:             * same bean reference.
064:             * @input First parameter of the method must be a BeanDescriptor
065:             * @output Comparation Result the BeanDescriptor created by the Client and
066:             *         the BeanDescriptor created into the Interceptor Method.
067:             * @throws Exception if there is a problem with the test.
068:             */
069:            @Test(groups={"invocationContext"})
070:            public void testInvocation00() throws Exception {
071:                testInvocation(SLSBInvocationContext00.class);
072:            }
073:
074:            /**
075:             * Verifies if the InvocationContext in interceptor method of a bean class
076:             * maintains the same bean reference.
077:             * @input First parameter of the method must be a BeanDescriptor
078:             * @output Comparation Result the BeanDescriptor created by the Interceptor
079:             *         and the BeanDescriptor created into the bean method.
080:             * @throws Exception if there is a problem with the test.
081:             */
082:            @Test(groups={"invocationContext"})
083:            public void testInvocation01() throws Exception {
084:                testInvocation(SLSBInvocationContext01.class);
085:            }
086:
087:            /**
088:             * Verifies if the InvocationContext in interceptor method of a bean class
089:             * maintains the same bean reference.
090:             * @param beanClass bean class
091:             * @throws Exception Exception if there is a problem with the test.
092:             */
093:            private void testInvocation(final Class beanClass) throws Exception {
094:                ItfInvocation00 icBean = getBeanRemoteInstance(beanClass,
095:                        ItfInvocation00.class);
096:                icBean.check();
097:            }
098:
099:            /**
100:             * Verifies if the intercepted method parameters can be modified to a null
101:             * reference. The interceptor method is on the bean class.
102:             * @input First parameter of the method must be a ComplexObject00
103:             * @output Comparation result between the objects passed as parameters and
104:             *         the objects returned by the method.
105:             * @throws Exception if there is a problem with the test.
106:             */
107:            @Test(groups={"invocationContext","get/setParameters"})
108:            public void testParameters00() throws Exception {
109:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
110:                        SLSBInvocationParameterTest.class,
111:                        ItfInvocationParameterTest.class);
112:                bean.testNull(SLSBInvocationParameter00.class);
113:            }
114:
115:            /**
116:             * Verifies if the intercepted method parameters can be modified to a null
117:             * reference. The interceptor method is on the bean class.
118:             * @input First parameter of the method must be a ComplexObject00
119:             * @output Comparation result between the objects passed as parameters and
120:             *         the objects returned by the method.
121:             * @throws Exception if there is a problem with the test.
122:             */
123:            @Test(groups={"invocationContext","get/setParameters"})
124:            public void testParameters01() throws Exception {
125:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
126:                        SLSBInvocationParameterTest.class,
127:                        ItfInvocationParameterTest.class);
128:                bean.testNull(SLSBInvocationParameter01.class);
129:            }
130:
131:            /**
132:             * Verifies if the intercepted method parameters can be returned WITHOUT
133:             * modifications. The interceptor is a external class.
134:             * @input First parameter of the method must be a ComplexObject00
135:             * @output Comparation result between the objects passed as parameters and
136:             *         the objects returned by the method.
137:             * @throws Exception if there is a problem with the test.
138:             */
139:            @Test(groups={"invocationContext","get/setParameters"})
140:            public void testParameters02() throws Exception {
141:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
142:                        SLSBInvocationParameterTest.class,
143:                        ItfInvocationParameterTest.class);
144:                bean.testWithoutModification(SLSBInvocationParameter00.class);
145:            }
146:
147:            /**
148:             * Verifies if the intercepted method parameters can be returned WITHOUT
149:             * modifications. The interceptor is a external class.
150:             * @input First parameter of the method must be a ComplexObject00
151:             * @output Comparation result between the objects passed as parameters and
152:             *         the objects returned by the method.
153:             * @throws Exception if there is a problem with the test.
154:             */
155:            @Test(groups={"invocationContext","get/setParameters"})
156:            public void testParameters03() throws Exception {
157:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
158:                        SLSBInvocationParameterTest.class,
159:                        ItfInvocationParameterTest.class);
160:                bean.testWithoutModification(SLSBInvocationParameter01.class);
161:            }
162:
163:            /**
164:             * Verifies if the intercepted method parameters can be returned WITH
165:             * modifications. The interceptor is a external class.
166:             * @input First parameter of the method must be a ComplexObject00
167:             * @output Comparation result between the objects passed as parameters and
168:             *         the objects returned by the method.
169:             * @throws Exception if there is a problem with the test.
170:             */
171:            @SuppressWarnings("boxing")
172:            @Test(groups={"invocationContext","get/setParameters"})
173:            public void testParameters04() throws Exception {
174:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
175:                        SLSBInvocationParameterTest.class,
176:                        ItfInvocationParameterTest.class);
177:                bean.testWithModification(SLSBInvocationParameter00.class);
178:            }
179:
180:            /**
181:             * Verifies if the intercepted method parameters can be returned WITH
182:             * modifications. The interceptor is a external class.
183:             * @input First parameter of the method must be a ComplexObject00
184:             * @output Comparation result between the objects passed as parameters and
185:             *         the objects returned by the method.
186:             * @throws Exception if there is a problem with the test.
187:             */
188:            @SuppressWarnings("boxing")
189:            @Test(groups={"invocationContext","get/setParameters"})
190:            public void testParameters05() throws Exception {
191:                ItfInvocationParameterTest bean = getBeanRemoteInstance(
192:                        SLSBInvocationParameterTest.class,
193:                        ItfInvocationParameterTest.class);
194:                bean.testWithModification(SLSBInvocationParameter01.class);
195:            }
196:
197:            /**
198:             * Verifies if the context data is working following the specification.
199:             * @throws Exception if there is a problem with the test.
200:             */
201:            @Test(groups={"invocationContext","getContextData"})
202:            public void testContextData00() throws Exception {
203:                ItfInvocationParameter01 icBean = getBeanRemoteInstance(
204:                        SLSBInvocationContext02.class,
205:                        ItfInvocationParameter01.class);
206:                icBean.getObjects(null, null);
207:            }
208:
209:            /**
210:             * Verifies if the context data is working following the specification.
211:             * @throws Exception if there is a problem with the test.
212:             */
213:            @Test(groups={"invocationContext","getContextData"})
214:            @SuppressWarnings("boxing")
215:            public void testContextData01() throws Exception {
216:                ItfInvocationParameter01 icBean = getBeanRemoteInstance(
217:                        SLSBInvocationContext02.class,
218:                        ItfInvocationParameter01.class);
219:                icBean.getObjects(new ComplexObject00(), new BeanDescriptor());
220:            }
221:
222:            /**
223:             * Verifies if the context data is working following the specification.
224:             * @throws Exception if there is a problem with the test.
225:             */
226:            @Test(groups={"invocationContext","getContextData"})
227:            @SuppressWarnings("boxing")
228:            public void testContextData02() throws Exception {
229:                ItfInvocationParameter01 icBean = getBeanRemoteInstance(
230:                        SLSBInvocationContext02.class,
231:                        ItfInvocationParameter01.class);
232:                icBean.getObjects(new ComplexObject00(), new BeanDescriptor());
233:            }
234:
235:            /**
236:             * Verifies if the proceed is returning null with a void interceptor method.
237:             * @throws Exception if there is a problem with the test.
238:             */
239:            @Test(groups={"invocationContext","proceed"})
240:            public void testProceed00() throws Exception {
241:                ItfOneMethod00 icBean = getBeanRemoteInstance(
242:                        SLSBInvocationContext03.class, ItfOneMethod00.class);
243:                icBean.doOne(null);
244:            }
245:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.