Search in sources :

Example 1 with JAXWSContainer

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);
}
Also used : JAXWSContainer(org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer) Before(org.junit.Before)

Example 2 with JAXWSContainer

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);
}
Also used : JAXWSContainer(org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer) Before(org.junit.Before)

Example 3 with JAXWSContainer

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);
}
Also used : QName(javax.xml.namespace.QName) Port(javax.wsdl.Port) Definition(javax.wsdl.Definition) JAXWSContainer(org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer) Service(javax.wsdl.Service) File(java.io.File) Test(org.junit.Test)

Example 4 with JAXWSContainer

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());
}
Also used : JAXWSContainer(org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer) File(java.io.File) Test(org.junit.Test)

Example 5 with JAXWSContainer

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());
}
Also used : ServiceValidator(org.apache.cxf.tools.validator.ServiceValidator) JAXWSContainer(org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer) Test(org.junit.Test)

Aggregations

JAXWSContainer (org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer)8 Test (org.junit.Test)6 File (java.io.File)3 URISyntaxException (java.net.URISyntaxException)2 QName (javax.xml.namespace.QName)2 ToolContext (org.apache.cxf.tools.common.ToolContext)2 JavaException (org.apache.cxf.tools.common.model.JavaException)2 JavaInterface (org.apache.cxf.tools.common.model.JavaInterface)2 JavaMethod (org.apache.cxf.tools.common.model.JavaMethod)2 JavaModel (org.apache.cxf.tools.common.model.JavaModel)2 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 Definition (javax.wsdl.Definition)1 Port (javax.wsdl.Port)1 Service (javax.wsdl.Service)1 FrontEndGenerator (org.apache.cxf.tools.common.FrontEndGenerator)1 JavaPort (org.apache.cxf.tools.common.model.JavaPort)1 JavaServiceClass (org.apache.cxf.tools.common.model.JavaServiceClass)1 ServiceValidator (org.apache.cxf.tools.validator.ServiceValidator)1 FrontEndProfile (org.apache.cxf.tools.wsdlto.core.FrontEndProfile)1