Source Code Cross Referenced for ServiceDescriptionImplValidationTests.java in  » Web-Services-AXIS2 » metadata » org » apache » axis2 » jaxws » description » impl » 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 » Web Services AXIS2 » metadata » org.apache.axis2.jaxws.description.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:        package org.apache.axis2.jaxws.description.impl;
020:
021:        import junit.framework.TestCase;
022:        import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
023:        import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
024:        import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
025:
026:        import javax.xml.ws.WebServiceException;
027:        import java.util.HashMap;
028:
029:        /**
030:         * 
031:         */
032:        public class ServiceDescriptionImplValidationTests extends TestCase {
033:
034:            public void testValidateImplMethodsVsSEI() {
035:
036:                DescriptionBuilderComposite seiComposite = new DescriptionBuilderComposite();
037:                seiComposite
038:                        .setClassName("org.apache.axis2.jaxws.description.impl.MySEI");
039:                MethodDescriptionComposite seiMDC = new MethodDescriptionComposite();
040:                seiMDC.setMethodName("seiMethod");
041:                seiComposite.addMethodDescriptionComposite(seiMDC);
042:
043:                DescriptionBuilderComposite implComposite = new DescriptionBuilderComposite();
044:                implComposite
045:                        .setClassName("org.apache.axis2.jaxws.description.impl.MyImpl");
046:                MethodDescriptionComposite implMDC = new MethodDescriptionComposite();
047:                implMDC.setMethodName("notSeiMethod");
048:                implComposite.addMethodDescriptionComposite(implMDC);
049:                WebServiceAnnot webServiceAnnot = WebServiceAnnot
050:                        .createWebServiceAnnotImpl();
051:                webServiceAnnot.setName(null);
052:                webServiceAnnot
053:                        .setEndpointInterface("org.apache.axis2.jaxws.description.impl.MySEI");
054:                implComposite.setWebServiceAnnot(webServiceAnnot);
055:                implComposite.setIsInterface(false);
056:
057:                HashMap<String, DescriptionBuilderComposite> dbcList = new HashMap<String, DescriptionBuilderComposite>();
058:                dbcList.put(seiComposite.getClassName(), seiComposite);
059:                dbcList.put(implComposite.getClassName(), implComposite);
060:
061:                try {
062:                    ServiceDescriptionImpl serviceDescImpl = new ServiceDescriptionImpl(
063:                            dbcList, implComposite);
064:                    fail("Should have caught exception for validation errors");
065:                } catch (WebServiceException ex) {
066:                    // Expected path
067:                } catch (Exception ex) {
068:                    fail("Caught wrong type of exception " + ex.toString());
069:                }
070:
071:            }
072:
073:            public void testValidateImplMethodsVsSEIInheritence() {
074:
075:                DescriptionBuilderComposite super SeiComposite = new DescriptionBuilderComposite();
076:                super SeiComposite
077:                        .setClassName("org.apache.axis2.jaxws.description.impl.MySuperSEI");
078:                MethodDescriptionComposite super SeiMDC = new MethodDescriptionComposite();
079:                super SeiMDC.setMethodName("superSeiMethod");
080:                super SeiComposite.addMethodDescriptionComposite(super SeiMDC);
081:
082:                DescriptionBuilderComposite seiComposite = new DescriptionBuilderComposite();
083:                seiComposite
084:                        .setClassName("org.apache.axis2.jaxws.description.impl.MySEI");
085:                MethodDescriptionComposite seiMDC = new MethodDescriptionComposite();
086:                seiMDC.setMethodName("seiMethod");
087:                seiComposite.addMethodDescriptionComposite(seiMDC);
088:                seiComposite
089:                        .setSuperClassName("org.apache.axis2.jaxws.description.impl.MySuperSEI");
090:
091:                DescriptionBuilderComposite implComposite = new DescriptionBuilderComposite();
092:                implComposite
093:                        .setClassName("org.apache.axis2.jaxws.description.impl.MyImpl");
094:                MethodDescriptionComposite implMDC = new MethodDescriptionComposite();
095:                implMDC.setMethodName("superSeiMethod");
096:                implComposite.addMethodDescriptionComposite(implMDC);
097:                WebServiceAnnot webServiceAnnot = WebServiceAnnot
098:                        .createWebServiceAnnotImpl();
099:                webServiceAnnot.setName(null);
100:                webServiceAnnot
101:                        .setEndpointInterface("org.apache.axis2.jaxws.description.impl.MySEI");
102:                implComposite.setWebServiceAnnot(webServiceAnnot);
103:                implComposite.setIsInterface(false);
104:
105:                HashMap<String, DescriptionBuilderComposite> dbcList = new HashMap<String, DescriptionBuilderComposite>();
106:                dbcList.put(seiComposite.getClassName(), seiComposite);
107:                dbcList
108:                        .put(super SeiComposite.getClassName(),
109:                                super SeiComposite);
110:                dbcList.put(implComposite.getClassName(), implComposite);
111:
112:                try {
113:                    ServiceDescriptionImpl serviceDescImpl = new ServiceDescriptionImpl(
114:                            dbcList, implComposite);
115:                    fail("Should have caught validation failure exception");
116:                } catch (WebServiceException ex) {
117:                    // Expected path
118:                } catch (Exception ex) {
119:                    fail("Caught wrong exception " + ex.toString());
120:                }
121:            }
122:
123:            // The tests below progressively setup an identical DBC, gradually setting more values until
124:            // the last one does not cause a validation error.
125:
126:            // FAILURE #1: No WebMethod annotation set on the SEI
127:            public void testInvalidDBC1() {
128:                DescriptionBuilderComposite seiComposite = new DescriptionBuilderComposite();
129:                seiComposite
130:                        .setClassName("org.apache.axis2.jaxws.description.impl.MySEI");
131:                MethodDescriptionComposite seiMDC = new MethodDescriptionComposite();
132:                seiMDC.setMethodName("seiMethod");
133:                seiComposite.addMethodDescriptionComposite(seiMDC);
134:
135:                DescriptionBuilderComposite super ImplComposite = new DescriptionBuilderComposite();
136:                super ImplComposite
137:                        .setClassName("org.apache.axis2.jaxws.description.impl.MySuperImpl");
138:                MethodDescriptionComposite super ImplMDC = new MethodDescriptionComposite();
139:                super ImplMDC.setMethodName("seiMethod");
140:                super ImplComposite.addMethodDescriptionComposite(super ImplMDC);
141:
142:                DescriptionBuilderComposite implComposite = new DescriptionBuilderComposite();
143:                implComposite
144:                        .setClassName("org.apache.axis2.jaxws.description.impl.MyImpl");
145:                MethodDescriptionComposite implMDC = new MethodDescriptionComposite();
146:                implMDC.setMethodName("notSeiMethod");
147:                implComposite.addMethodDescriptionComposite(implMDC);
148:                WebServiceAnnot webServiceAnnot = WebServiceAnnot
149:                        .createWebServiceAnnotImpl();
150:                webServiceAnnot.setName(null);
151:                webServiceAnnot
152:                        .setEndpointInterface("org.apache.axis2.jaxws.description.impl.MySEI");
153:                implComposite.setWebServiceAnnot(webServiceAnnot);
154:                implComposite.setIsInterface(false);
155:                implComposite
156:                        .setSuperClassName("org.apache.axis2.jaxws.description.impl.MySuperImpl");
157:
158:                HashMap<String, DescriptionBuilderComposite> dbcList = new HashMap<String, DescriptionBuilderComposite>();
159:                dbcList.put(seiComposite.getClassName(), seiComposite);
160:                dbcList.put(implComposite.getClassName(), implComposite);
161:                dbcList.put(super ImplComposite.getClassName(),
162:                        super ImplComposite);
163:
164:                try {
165:                    ServiceDescriptionImpl serviceDescImpl = new ServiceDescriptionImpl(
166:                            dbcList, implComposite);
167:                    fail("Did not catch expected exception");
168:                } catch (WebServiceException ex) {
169:                    // Expected path
170:                } catch (Exception ex) {
171:                    fail("Unexpected exception received " + ex.toString());
172:                }
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.