Search in sources :

Example 1 with TestUtilities

use of org.apache.cxf.test.TestUtilities in project cxf by apache.

the class SchemaAddinsTest method before.

@Before
public void before() {
    testUtilities = new TestUtilities(getClass());
    testUtilities.addDefaultNamespaces();
}
Also used : TestUtilities(org.apache.cxf.test.TestUtilities) Before(org.junit.Before)

Example 2 with TestUtilities

use of org.apache.cxf.test.TestUtilities in project cxf by apache.

the class StandaloneWriteTest method before.

@Before
public void before() {
    testUtilities = new TestUtilities(getClass());
    testUtilities.addNamespace("feline", "urn:meow");
    xmlOutputFactory = XMLOutputFactory.newInstance();
    xmlInputFactory = XMLInputFactory.newInstance();
}
Also used : TestUtilities(org.apache.cxf.test.TestUtilities) Before(org.junit.Before)

Example 3 with TestUtilities

use of org.apache.cxf.test.TestUtilities in project cxf by apache.

the class TypeCreationOptionsSpringTest method testMinOccurs.

@Test
public void testMinOccurs() throws Exception {
    TestUtilities testUtilities = new TestUtilities(TypeCreationOptionsSpringTest.class);
    testUtilities.setBus(getBean(Bus.class, "cxf"));
    testUtilities.addDefaultNamespaces();
    testUtilities.addNamespace("ts", "http://cxf.org.apache/service");
    // {urn:org.apache.cxf.aegis}arrayService
    Server s = testUtilities.getServerForService(new QName("urn:org.apache.cxf.aegis", "arrayService"));
    Document wsdl = testUtilities.getWSDLDocument(s);
    assertXPathEquals("//xsd:complexType[@name='ArrayOfInt']/" + "xsd:sequence/xsd:element[@name='int']/@minOccurs", "3", wsdl);
}
Also used : Bus(org.apache.cxf.Bus) Server(org.apache.cxf.endpoint.Server) QName(javax.xml.namespace.QName) TestUtilities(org.apache.cxf.test.TestUtilities) Document(org.w3c.dom.Document) AbstractCXFSpringTest(org.apache.cxf.test.AbstractCXFSpringTest) Test(org.junit.Test)

Example 4 with TestUtilities

use of org.apache.cxf.test.TestUtilities in project cxf by apache.

the class AegisClientServerTest method testWSDL.

@Test
public void testWSDL() throws Exception {
    URL url = new URL("http://localhost:" + PORT + "/jaxwsAndAegis?wsdl");
    Document dom = StaxUtils.read(url.openStream());
    TestUtilities util = new TestUtilities(this.getClass());
    util.addDefaultNamespaces();
    util.assertInvalid("//wsdl:definitions/wsdl:types/xsd:schema/" + "xsd:complexType[@name='getRolesAsArrayResponse']/" + "xsd:sequence/xsd:element[@maxOccurs]", dom);
    util.assertValid("//wsdl:definitions/wsdl:types/xsd:schema/" + "xsd:complexType[@name='getRolesAsArrayResponse']/" + "xsd:sequence/xsd:element[@nillable='true']", dom);
    url = new URL("http://localhost:" + PORT + "/serviceWithCustomNS?wsdl");
    dom = StaxUtils.read(url.openStream());
    util.assertValid("//wsdl:definitions[@targetNamespace='http://foo.bar.com']", dom);
}
Also used : TestUtilities(org.apache.cxf.test.TestUtilities) Document(org.w3c.dom.Document) URL(java.net.URL) Test(org.junit.Test)

Example 5 with TestUtilities

use of org.apache.cxf.test.TestUtilities in project cxf by apache.

the class AegisWSDLNSTest method testGeneratedWsdlNs.

@Test
public void testGeneratedWsdlNs() throws Exception {
    URL url = new URL("http://localhost:" + PORT + "/aegisJaxWsWSDLNS?wsdl");
    Document dom = StaxUtils.read(url.openStream());
    TestUtilities util = new TestUtilities(this.getClass());
    util.addDefaultNamespaces();
    util.assertValid("//wsdl:definitions[@targetNamespace" + "='http://v1_1_2.rtf2pdf.doc.ws.daisy.marbes.cz']", dom);
    // should be a targetNamespace for "http://wo.rtf2pdf.doc.ws.daisy.marbes.cz"
    // as VO type specified in the SEI
    util.assertValid("//wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace" + "='http://wo.rtf2pdf.doc.ws.daisy.marbes.cz']", dom);
}
Also used : TestUtilities(org.apache.cxf.test.TestUtilities) Document(org.w3c.dom.Document) URL(java.net.URL) Test(org.junit.Test)

Aggregations

TestUtilities (org.apache.cxf.test.TestUtilities)6 Before (org.junit.Before)3 Test (org.junit.Test)3 Document (org.w3c.dom.Document)3 URL (java.net.URL)2 QName (javax.xml.namespace.QName)1 Bus (org.apache.cxf.Bus)1 Server (org.apache.cxf.endpoint.Server)1 AbstractCXFSpringTest (org.apache.cxf.test.AbstractCXFSpringTest)1