use of org.apache.cxf.tools.wsdlto.WSDLToJava in project cxf by apache.
the class CodeGenBugTest method testCXF1939.
@Test
public void testCXF1939() throws Exception {
String[] args = new String[] { "-d", output.getCanonicalPath(), "-impl", "-server", "-client", "-autoNameResolution", getLocation("/wsdl2java_wsdl/cxf1939/hello_world.wsdl") };
CommandInterfaceUtils.commandCommonMain();
WSDLToJava w2j = new WSDLToJava(args);
w2j.run(new ToolContext());
assertNotNull(output);
assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/Soap_PortImpl.java").exists());
assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/SoapPortImpl.java").exists());
assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/TestServiceName.java").exists());
assertTrue(new File(output, "org/apache/cxf/w2j/hello_world_soap_http/TestServiceName1.java").exists());
}
use of org.apache.cxf.tools.wsdlto.WSDLToJava in project cxf by apache.
the class CodeGenBugTest method testDefaultNSWithPkg.
@Test
public void testDefaultNSWithPkg() throws Exception {
String[] args = new String[] { "-d", output.getCanonicalPath(), "-p", "org.cxf", "-noAddressBinding", getLocation("/wsdl2java_wsdl/basic_callback.wsdl") };
CommandInterfaceUtils.commandCommonMain();
WSDLToJava w2j = new WSDLToJava(args);
w2j.run(new ToolContext());
assertNotNull(output);
File org = new File(output, "org");
assertTrue(org.exists());
File apache = new File(org, "apache");
assertTrue(apache.exists());
File cxf = new File(apache, "cxf");
assertTrue(cxf.exists());
File ws = new File(cxf, "ws");
assertTrue(ws.exists());
File address = new File(ws, "addressing");
assertTrue(address.exists());
File[] files = address.listFiles();
assertEquals(11, files.length);
cxf = new File(output, "org/cxf");
assertTrue(cxf.exists());
files = cxf.listFiles();
assertEquals(5, files.length);
}
use of org.apache.cxf.tools.wsdlto.WSDLToJava in project cxf by apache.
the class CodeGenBugTest method testDefaultLoadNSMappingON.
@Test
public void testDefaultLoadNSMappingON() throws Exception {
String[] args = new String[] { "-d", output.getCanonicalPath(), "-noAddressBinding", getLocation("/wsdl2java_wsdl/basic_callback.wsdl") };
CommandInterfaceUtils.commandCommonMain();
WSDLToJava w2j = new WSDLToJava(args);
w2j.run(new ToolContext());
assertNotNull(output);
File org = new File(output, "org");
assertTrue(org.exists());
File apache = new File(org, "apache");
assertTrue(apache.exists());
File cxf = new File(apache, "cxf");
assertTrue(cxf.exists());
File ws = new File(cxf, "ws");
assertTrue(ws.exists());
File address = new File(ws, "addressing");
assertTrue(address.exists());
File[] files = address.listFiles();
assertEquals(11, files.length);
}
use of org.apache.cxf.tools.wsdlto.WSDLToJava in project cxf by apache.
the class CodeGenBugTest method testOverloadWithAction.
@Test
public void testOverloadWithAction() throws Exception {
String[] args = new String[] { "-d", output.getCanonicalPath(), getLocation("/wsdl2java_wsdl/hello_world_overload.wsdl") };
CommandInterfaceUtils.commandCommonMain();
WSDLToJava w2j = new WSDLToJava(args);
w2j.run(new ToolContext());
assertNotNull(output);
File f = new File(output, "org/apache/cxf/w2j/hello_world_soap_http/SayHi.java");
assertTrue(f.exists());
}
use of org.apache.cxf.tools.wsdlto.WSDLToJava in project cxf by apache.
the class CodeGenBugTest method testCXF677.
@Test
public void testCXF677() throws Exception {
String[] args = new String[] { "-d", output.getCanonicalPath(), "-b", getLocation("/wsdl2java_wsdl/hello-mime-binding.xml"), getLocation("/wsdl2java_wsdl/hello-mime.wsdl") };
CommandInterfaceUtils.commandCommonMain();
WSDLToJava w2j = new WSDLToJava(args);
w2j.run(new ToolContext());
String str1 = "SOAPBinding.ParameterStyle.BARE";
String str2 = "javax.xml.ws.Holder";
String str3 = "org.apache.cxf.mime.Address";
String str4 = "http://cxf.apache.org/w2j/hello_world_mime/types";
String file = TestFileUtils.getStringFromFile(new File(output.getCanonicalPath() + "/org/apache/cxf/w2j/hello_world_mime/Hello.java"));
assertTrue(file.contains(str1));
assertTrue(file.contains(str2));
assertTrue(file.contains(str3));
assertTrue(file.contains(str4));
}
Aggregations