use of org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer in project cxf by apache.
the class JAXWSBindingTest method setUp.
@Before
public void setUp() throws Exception {
env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
processor = new JAXWSContainer(null);
}
use of org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer in project cxf by apache.
the class CatalogTest method setUp.
@Before
public void setUp() throws Exception {
env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
processor = new JAXWSContainer(null);
}
use of org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer in project cxf by apache.
the class JavaToProcessorTest method testDocLitUseClassPathFlag.
@Test
public void testDocLitUseClassPathFlag() throws Exception {
File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
classFile.mkdir();
String oldCP = System.getProperty("java.class.path");
if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
String java9PlusFolder = output.getParent() + java.io.File.separator + "java9";
System.setProperty("java.class.path", oldCP + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
}
env.put(ToolConstants.CFG_COMPILE, ToolConstants.CFG_COMPILE);
env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
env.put(ToolConstants.CFG_PACKAGENAME, "org.apache.cxf.classpath");
env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl/hello_world_doc_lit.wsdl"));
JAXWSContainer w2jProcessor = new JAXWSContainer(null);
w2jProcessor.setContext(env);
w2jProcessor.execute();
String tns = "http://apache.org/sepecifiedTns";
String serviceName = "cxfService";
String portName = "cxfPort";
System.setProperty("java.class.path", oldCP);
// test flag
String[] args = new String[] { "-o", "java2wsdl.wsdl", "-cp", classFile.getCanonicalPath(), "-t", tns, "-servicename", serviceName, "-portname", portName, "-soap12", "-d", output.getPath(), "-wsdl", "org.apache.cxf.classpath.Greeter" };
JavaToWS.main(args);
File wsdlFile = new File(output, "java2wsdl.wsdl");
assertTrue("Generate Wsdl Fail", wsdlFile.exists());
Definition def = getDefinition(wsdlFile.getPath());
Service wsdlService = def.getService(new QName(tns, serviceName));
assertNotNull("Generate WSDL Service Error", wsdlService);
Port wsdlPort = wsdlService.getPort(portName);
assertNotNull("Generate service port error ", wsdlPort);
}
use of org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer in project cxf by apache.
the class JavaToJSProcessorTest method testDocLitUseClassPathFlag.
@Test
public void testDocLitUseClassPathFlag() throws Exception {
File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
classFile.mkdir();
String oldCP = System.getProperty("java.class.path");
if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
String java9PlusFolder = output.getParent() + java.io.File.separator + "java9";
System.setProperty("java.class.path", oldCP + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
}
env.put(ToolConstants.CFG_COMPILE, ToolConstants.CFG_COMPILE);
env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
env.put(FrontEndProfile.class, PluginLoader.getInstance().getFrontEndProfile("jaxws"));
env.put(DataBindingProfile.class, PluginLoader.getInstance().getDataBindingProfile("jaxb"));
env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath());
env.put(ToolConstants.CFG_PACKAGENAME, "org.apache.cxf.classpath");
env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes");
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl/hello_world_doc_lit.wsdl"));
JAXWSContainer w2jProcessor = new JAXWSContainer(null);
w2jProcessor.setContext(env);
w2jProcessor.execute();
System.setProperty("java.class.path", oldCP);
// test flag
String[] args = new String[] { "-o", "java2wsdl.js", "-jsutils", "-cp", classFile.getCanonicalPath(), "-d", output.getPath(), "org.apache.cxf.classpath.Greeter" };
JavaToJS.main(args);
File jsFile = new File(output, "java2wsdl.js");
assertTrue("Generate JS Fail", jsFile.exists());
}
use of org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer in project cxf by apache.
the class JAXWSContainerTest method testGetServceValidator.
@Test
public void testGetServceValidator() throws Exception {
JAXWSContainer container = new JAXWSContainer(null);
List<ServiceValidator> validators = container.getServiceValidators();
assertNotNull(validators);
assertFalse(validators.isEmpty());
}
Aggregations