Source Code Cross Referenced for JavaToWSDLProcessorTest.java in  » ESB » celtix-1.0 » org » objectweb » celtix » tools » processors » java2 » 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 » ESB » celtix 1.0 » org.objectweb.celtix.tools.processors.java2 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.objectweb.celtix.tools.processors.java2;
002:
003:        import java.io.File;
004:
005:        import javax.wsdl.Definition;
006:        import javax.wsdl.Service;
007:        import javax.xml.namespace.QName;
008:
009:        import org.objectweb.celtix.helpers.WSDLHelper;
010:        import org.objectweb.celtix.tools.common.ToolConstants;
011:        import org.objectweb.celtix.tools.processors.ProcessorTestBase;
012:        import org.objectweb.celtix.tools.processors.wsdl2.WSDLToJavaProcessor;
013:
014:        public class JavaToWSDLProcessorTest extends ProcessorTestBase {
015:
016:            private JavaToWSDLProcessor j2wProcessor;
017:            private WSDLToJavaProcessor wj2Processor;
018:            private String tns = "org.objectweb.asyn_lit";
019:            private String serviceName = "celtixService";
020:            private WSDLHelper wsdlHelper = new WSDLHelper();
021:            private File classFile;
022:
023:            public void setUp() throws Exception {
024:                super .setUp();
025:                wj2Processor = new WSDLToJavaProcessor();
026:                j2wProcessor = new JavaToWSDLProcessor();
027:                classFile = new java.io.File(output.getCanonicalPath()
028:                        + "/classes");
029:                classFile.mkdir();
030:                System.setProperty("java.class.path", getClassPath()
031:                        + classFile.getCanonicalPath() + File.separatorChar);
032:            }
033:
034:            public void tearDown() {
035:                super .tearDown();
036:                j2wProcessor = null;
037:                wj2Processor = null;
038:            }
039:
040:            public void testAsyn() throws Exception {
041:
042:                env.put(ToolConstants.CFG_COMPILE, "compile");
043:                env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
044:                env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath()
045:                        + "/classes");
046:                env.put(ToolConstants.CFG_WSDLURL,
047:                        getLocation("/wsdl/hello_world_async.wsdl"));
048:                wj2Processor.setEnvironment(env);
049:                wj2Processor.process();
050:
051:                env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath()
052:                        + "/asyn.wsdl");
053:                env
054:                        .put(ToolConstants.CFG_CLASSNAME,
055:                                "org.objectweb.hello_world_async_soap_http.GreeterAsync");
056:                env.put(ToolConstants.CFG_TNS, tns);
057:                env.put(ToolConstants.CFG_SERVICENAME, serviceName);
058:                j2wProcessor.setEnvironment(env);
059:                j2wProcessor.process();
060:
061:                File wsdlFile = new File(output, "asyn.wsdl");
062:                assertTrue("Fail to generate wsdl file", wsdlFile.exists());
063:
064:                Definition def = wsdlHelper.getDefinition(wsdlFile);
065:                Service wsdlService = def
066:                        .getService(new QName(tns, serviceName));
067:                assertNotNull("Generate WSDL Service Error", wsdlService);
068:
069:                File schemaFile = new File(output, "schema1.xsd");
070:                assertTrue("Fail to generate schema file", schemaFile.exists());
071:
072:            }
073:
074:            public void testDocWrapparBare() throws Exception {
075:                env.put(ToolConstants.CFG_COMPILE, "compile");
076:                env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
077:                env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath()
078:                        + "/classes");
079:                env.put(ToolConstants.CFG_WSDLURL,
080:                        getLocation("/wsdl/hello_world_doc_wrapped_bare.wsdl"));
081:                wj2Processor.setEnvironment(env);
082:                wj2Processor.process();
083:
084:                env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath()
085:                        + "/doc_wrapped_bare.wsdl");
086:                env.put(ToolConstants.CFG_CLASSNAME,
087:                        "org.objectweb.hello_world_doc_wrapped_bare.Greeter");
088:                env.put(ToolConstants.CFG_TNS, tns);
089:                env.put(ToolConstants.CFG_SERVICENAME, serviceName);
090:                j2wProcessor.setEnvironment(env);
091:                j2wProcessor.process();
092:
093:                File wsdlFile = new File(output, "doc_wrapped_bare.wsdl");
094:                assertTrue("Fail to generate wsdl file", wsdlFile.exists());
095:
096:                Definition def = wsdlHelper.getDefinition(wsdlFile);
097:                Service wsdlService = def
098:                        .getService(new QName(tns, serviceName));
099:                assertNotNull("Generate WSDL Service Error", wsdlService);
100:
101:                File schemaFile = new File(output, "schema1.xsd");
102:                assertTrue("Fail to generate schema file", schemaFile.exists());
103:
104:            }
105:
106:            public void testDocLitUseClassPathFlag() throws Exception {
107:                env.put(ToolConstants.CFG_COMPILE, "compile");
108:                env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
109:                env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath()
110:                        + "/classes");
111:                env.put(ToolConstants.CFG_WSDLURL,
112:                        getLocation("/wsdl/hello_world_doc_lit.wsdl"));
113:                wj2Processor.setEnvironment(env);
114:                wj2Processor.process();
115:
116:                System.setProperty("java.class.path", "");
117:                env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath()
118:                        + "/doc_lit.wsdl");
119:                env.put(ToolConstants.CFG_CLASSNAME,
120:                        "org.objectweb.hello_world_doc_lit.Greeter");
121:                env.put(ToolConstants.CFG_TNS, tns);
122:                env.put(ToolConstants.CFG_CLASSPATH, classFile
123:                        .getCanonicalPath());
124:                env.put(ToolConstants.CFG_SERVICENAME, serviceName);
125:                j2wProcessor.setEnvironment(env);
126:                j2wProcessor.process();
127:                File wsdlFile = new File(output, "doc_lit.wsdl");
128:                assertTrue("Generate Wsdl Fail", wsdlFile.exists());
129:
130:                Definition def = wsdlHelper.getDefinition(wsdlFile);
131:                Service wsdlService = def
132:                        .getService(new QName(tns, serviceName));
133:                assertNotNull("Generate WSDL Service Error", wsdlService);
134:
135:                File schemaFile = new File(output, "schema1.xsd");
136:                assertTrue("Generate schema file Fail", schemaFile.exists());
137:
138:            }
139:
140:            public void testRPCLit() throws Exception {
141:                env.put(ToolConstants.CFG_COMPILE, "compile");
142:                env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
143:                env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath()
144:                        + "/classes");
145:                env.put(ToolConstants.CFG_WSDLURL,
146:                        getLocation("/wsdl/hello_world_rpc_lit.wsdl"));
147:                wj2Processor.setEnvironment(env);
148:                wj2Processor.process();
149:
150:                env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath()
151:                        + "/rpc_lit.wsdl");
152:                env.put(ToolConstants.CFG_CLASSNAME,
153:                        "org.objectweb.hello_world_rpclit.GreeterRPCLit");
154:                env.put(ToolConstants.CFG_TNS, tns);
155:                env.put(ToolConstants.CFG_SERVICENAME, serviceName);
156:
157:                j2wProcessor.setEnvironment(env);
158:                j2wProcessor.process();
159:                File wsdlFile = new File(output, "rpc_lit.wsdl");
160:                assertTrue(wsdlFile.exists());
161:
162:                Definition def = wsdlHelper.getDefinition(wsdlFile);
163:                Service wsdlService = def
164:                        .getService(new QName(tns, serviceName));
165:                assertNotNull("Generate WSDL Service Error", wsdlService);
166:
167:                File schemaFile = new File(output, "schema1.xsd");
168:                assertTrue(schemaFile.exists());
169:                File schemaFile2 = new File(output, "schema2.xsd");
170:                assertTrue(schemaFile2.exists());
171:            }
172:
173:            private String getLocation(String wsdlFile) {
174:                return JavaToWSDLProcessorTest.class.getResource(wsdlFile)
175:                        .getFile();
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.