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


001:        package org.apache.axis2.jaxws.description;
002:
003:        import java.net.URL;
004:        import java.util.HashMap;
005:        import java.util.List;
006:
007:        import junit.framework.TestCase;
008:
009:        import javax.jws.WebService;
010:        import javax.wsdl.Definition;
011:
012:        import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
013:        import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
014:        import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
015:        import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
016:
017:        /**
018:         * These tests are intended to test various aspects of the OperationDescription.
019:         */
020:
021:        public class OperationDescriptionTests extends TestCase {
022:
023:            /**
024:             * This test will confirm that the getBindingInputNamespace and getBindingOutputNamespace
025:             * methods of the OperationDescription function correctly.
026:             *
027:             */
028:
029:            public void testBindingNamespace() {
030:                String wsdlRelativeLocation = "test-resources/wsdl/";
031:                String wsdlFileName = "BindingNamespace.wsdl";
032:                String targetNamespace = "http://nonanonymous.complextype.test.org";
033:                String wsdlLocation = wsdlRelativeLocation + wsdlFileName;
034:
035:                // Build up a DBC, including the WSDL Definition and the annotation information for 
036:                // the impl class.
037:                DescriptionBuilderComposite dbc = new DescriptionBuilderComposite();
038:
039:                URL wsdlURL = DescriptionTestUtils.getWSDLURL(wsdlFileName);
040:                Definition wsdlDefn = DescriptionTestUtils
041:                        .createWSDLDefinition(wsdlURL);
042:                assertNotNull(wsdlDefn);
043:
044:                WebServiceAnnot webServiceAnnot = WebServiceAnnot
045:                        .createWebServiceAnnotImpl();
046:                assertNotNull(webServiceAnnot);
047:                webServiceAnnot.setWsdlLocation(wsdlLocation);
048:                webServiceAnnot.setTargetNamespace(targetNamespace);
049:                webServiceAnnot.setServiceName("EchoMessageService");
050:                webServiceAnnot.setPortName("EchoMessagePort");
051:
052:                MethodDescriptionComposite mdc = new MethodDescriptionComposite();
053:                mdc.setMethodName("echoMessage");
054:                mdc.setReturnType("java.lang.String");
055:
056:                ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
057:                pdc1.setParameterType("java.lang.String");
058:
059:                mdc.addParameterDescriptionComposite(pdc1);
060:
061:                dbc.addMethodDescriptionComposite(mdc);
062:                dbc.setWebServiceAnnot(webServiceAnnot);
063:                dbc.setClassName(BindingNSImpl.class.getName());
064:                dbc.setWsdlDefinition(wsdlDefn);
065:                dbc.setwsdlURL(wsdlURL);
066:
067:                HashMap<String, DescriptionBuilderComposite> dbcMap = new HashMap<String, DescriptionBuilderComposite>();
068:                dbcMap.put(dbc.getClassName(), dbc);
069:                List<ServiceDescription> serviceDescList = DescriptionFactory
070:                        .createServiceDescriptionFromDBCMap(dbcMap);
071:                assertEquals(1, serviceDescList.size());
072:                ServiceDescription sd = serviceDescList.get(0);
073:                assertNotNull(sd);
074:
075:                EndpointDescription[] edArray = sd.getEndpointDescriptions();
076:                assertNotNull(edArray);
077:                assertEquals(1, edArray.length);
078:                EndpointDescription ed = edArray[0];
079:                assertNotNull(ed);
080:
081:                EndpointInterfaceDescription eid = ed
082:                        .getEndpointInterfaceDescription();
083:                assertNotNull(eid);
084:
085:                OperationDescription[] odArray = eid.getOperations();
086:                assertNotNull(odArray);
087:                assertEquals(1, odArray.length);
088:                OperationDescription od = odArray[0];
089:                assertNotNull(od);
090:                assertEquals("http://org.apache.binding.ns", od
091:                        .getBindingInputNamespace());
092:                assertEquals("http://org.apache.binding.ns", od
093:                        .getBindingOutputNamespace());
094:
095:            }
096:
097:            public void testBindingNamespaceDefaults() {
098:                String wsdlRelativeLocation = "test-resources/wsdl/";
099:                String wsdlFileName = "BindingNamespaceDefaults.wsdl";
100:                String targetNamespace = "http://nonanonymous.complextype.test.org";
101:                String wsdlLocation = wsdlRelativeLocation + wsdlFileName;
102:
103:                // Build up a DBC, including the WSDL Definition and the annotation information for 
104:                // the impl class.
105:                DescriptionBuilderComposite dbc = new DescriptionBuilderComposite();
106:
107:                URL wsdlURL = DescriptionTestUtils.getWSDLURL(wsdlFileName);
108:                Definition wsdlDefn = DescriptionTestUtils
109:                        .createWSDLDefinition(wsdlURL);
110:                assertNotNull(wsdlDefn);
111:
112:                WebServiceAnnot webServiceAnnot = WebServiceAnnot
113:                        .createWebServiceAnnotImpl();
114:                assertNotNull(webServiceAnnot);
115:                webServiceAnnot.setWsdlLocation(wsdlLocation);
116:                webServiceAnnot.setTargetNamespace(targetNamespace);
117:                webServiceAnnot.setServiceName("EchoMessageService");
118:                webServiceAnnot.setPortName("EchoMessagePort");
119:
120:                MethodDescriptionComposite mdc = new MethodDescriptionComposite();
121:                mdc.setMethodName("echoMessage");
122:                mdc.setReturnType("java.lang.String");
123:
124:                ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
125:                pdc1.setParameterType("java.lang.String");
126:
127:                mdc.addParameterDescriptionComposite(pdc1);
128:
129:                dbc.addMethodDescriptionComposite(mdc);
130:                dbc.setWebServiceAnnot(webServiceAnnot);
131:                dbc.setClassName(BindingNSImpl.class.getName());
132:                dbc.setWsdlDefinition(wsdlDefn);
133:                dbc.setwsdlURL(wsdlURL);
134:                HashMap<String, DescriptionBuilderComposite> dbcMap = new HashMap<String, DescriptionBuilderComposite>();
135:                dbcMap.put(dbc.getClassName(), dbc);
136:                List<ServiceDescription> serviceDescList = DescriptionFactory
137:                        .createServiceDescriptionFromDBCMap(dbcMap);
138:                assertEquals(1, serviceDescList.size());
139:                ServiceDescription sd = serviceDescList.get(0);
140:                assertNotNull(sd);
141:
142:                EndpointDescription[] edArray = sd.getEndpointDescriptions();
143:                assertNotNull(edArray);
144:                assertEquals(1, edArray.length);
145:                EndpointDescription ed = edArray[0];
146:                assertNotNull(ed);
147:
148:                EndpointInterfaceDescription eid = ed
149:                        .getEndpointInterfaceDescription();
150:                assertNotNull(eid);
151:
152:                OperationDescription[] odArray = eid.getOperations();
153:                assertNotNull(odArray);
154:                assertEquals(1, odArray.length);
155:                OperationDescription od = odArray[0];
156:                assertNotNull(od);
157:                assertEquals("http://nonanonymous.complextype.test.org", od
158:                        .getBindingInputNamespace());
159:                assertEquals("http://nonanonymous.complextype.test.org", od
160:                        .getBindingOutputNamespace());
161:
162:            }
163:
164:            @WebService(serviceName="EchoMessageService",portName="EchoMessagePort",targetNamespace="http://nonanonymous.complextype.test.org",wsdlLocation="test-resources/wsdl/BindingNamespace.wsdl")
165:            public class BindingNSImpl {
166:                public String echoMessage(String arg) {
167:                    return arg;
168:                }
169:            }
170:
171:            @WebService(serviceName="EchoMessageService",portName="EchoMessagePort",targetNamespace="http://nonanonymous.complextype.test.org",wsdlLocation="test-resources/wsdl/BindingNamespaceDefaults.wsdl")
172:            public class BindingNSDefaultsImpl {
173:                public String echoMessage(String arg) {
174:                    return arg;
175:                }
176:            }
177:
178:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.