Search in sources :

Example 1 with WSDLToProcessor

use of org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor in project cxf by apache.

the class WSDLToIDLTest method testBindingGenDefault.

@Test
public void testBindingGenDefault() throws Exception {
    String[] cmdArgs = { "-corba", "-i", "BasePortType", "-d", output.getRoot().toString(), getClass().getResource("/wsdl/simpleList.wsdl").toString() };
    String error = execute(cmdArgs);
    assertNull("WSDLToIDL Failed", error);
    File f = new File(output.getRoot(), "simpleList-corba.wsdl");
    assertTrue("simpleList-corba.wsdl should be generated", f.exists());
    WSDLToProcessor proc = new WSDLToProcessor();
    try {
        proc.parseWSDL(f.getAbsolutePath());
        Definition model = proc.getWSDLDefinition();
        assertNotNull("WSDL Definition Should not be Null", model);
        QName bindingName = new QName("http://schemas.apache.org/tests", "BaseCORBABinding");
        assertNotNull("Binding Node not found in WSDL", model.getBinding(bindingName));
    } catch (Exception e) {
        fail("WSDLToCORBA generated an invalid simpleList-corba.wsdl");
    }
}
Also used : QName(javax.xml.namespace.QName) Definition(javax.wsdl.Definition) WSDLToProcessor(org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor) File(java.io.File) Test(org.junit.Test)

Example 2 with WSDLToProcessor

use of org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor in project cxf by apache.

the class WSDLToIDLTest method testBindingGenSpecifiedFile.

@Test
public void testBindingGenSpecifiedFile() throws Exception {
    String[] cmdArgs = { "-corba", "-i", "BasePortType", "-w", "simpleList-corba_gen.wsdl", "-d", output.getRoot().toString(), getClass().getResource("/wsdl/simpleList.wsdl").toString() };
    String error = execute(cmdArgs);
    assertNull("WSDLToIDL Failed", error);
    File f = new File(output.getRoot(), "simpleList-corba_gen.wsdl");
    assertTrue("simpleList-corba_gen.wsdl should be generated", f.exists());
    WSDLToProcessor proc = new WSDLToProcessor();
    try {
        proc.parseWSDL(f.toString());
        Definition model = proc.getWSDLDefinition();
        assertNotNull("WSDL Definition Should not be Null", model);
        QName bindingName = new QName("http://schemas.apache.org/tests", "BaseCORBABinding");
        assertNotNull("Binding Node not found in WSDL", model.getBinding(bindingName));
    } catch (Exception e) {
        fail("WSDLToIDL generated an invalid simpleList-corba.wsdl");
    }
}
Also used : QName(javax.xml.namespace.QName) Definition(javax.wsdl.Definition) WSDLToProcessor(org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor) File(java.io.File) Test(org.junit.Test)

Example 3 with WSDLToProcessor

use of org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor in project cxf by apache.

the class WSDLToIDLTest method testBindAndIDLGen.

// tests generating corba and idl in default wsdl and idl files
// pass the temp directory to create the wsdl files.
@Test
public void testBindAndIDLGen() throws Exception {
    String[] cmdArgs = { "-i", "BasePortType", "-b", "BaseOneCORBABinding", "-d", output.getRoot().toString(), getClass().getResource("/wsdl/simple-binding.wsdl").toString() };
    String error = execute(cmdArgs);
    assertNull("WSDLToIDL Failed", error);
    File f1 = new File(output.getRoot(), "simple-binding-corba.wsdl");
    assertTrue("simple-binding-corba.wsdl should be generated", f1.exists());
    File f2 = new File(output.getRoot(), "simple-binding.idl");
    assertTrue("simple-binding.idl should be generated", f2.exists());
    WSDLToProcessor proc = new WSDLToProcessor();
    try {
        proc.parseWSDL(f1.getAbsolutePath());
        Definition model = proc.getWSDLDefinition();
        assertNotNull("WSDL Definition Should not be Null", model);
        QName bindingName = new QName("http://schemas.apache.org/tests", "BaseOneCORBABinding");
        assertNotNull("Binding Node not found in WSDL", model.getBinding(bindingName));
    } catch (Exception e) {
        fail("WSDLToIDL generated an invalid simple-binding-corba.wsdl");
    }
    assertTrue("Invalid Idl File Generated", f2.length() > 0);
}
Also used : QName(javax.xml.namespace.QName) Definition(javax.wsdl.Definition) WSDLToProcessor(org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)3 Definition (javax.wsdl.Definition)3 QName (javax.xml.namespace.QName)3 WSDLToProcessor (org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor)3 Test (org.junit.Test)3