Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamReader.require()


    public void testMinimal() throws XMLStreamException, ConfigurationLoadException {
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }

    public void testInterface() throws Exception {
View Full Code Here


    public void testInterface() throws Exception {
        wsdlRegistry.loadDefinition("http://www.example.org", getClass().getResource("example.wsdl"), resourceLoader);
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9' interface='http://www.example.org#HelloWorld'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }

    public void testInterfaceWithLocation() throws Exception {
View Full Code Here

                "wsdli:wsdlLocation='http://www.example.org " + getClass().getResource("example.wsdl") + "' "+
                "interface='http://www.example.org#HelloWorld'"+
                "></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
    }

    protected void setUp() throws Exception {
View Full Code Here

    public void testMinimal() throws XMLStreamException, ConfigurationLoadException {
        String xml = "<wire xmlns='http://www.osoa.org/xmlns/sca/0.9'><source.uri>foo/fooService</source.uri><target.uri>bar</target.uri></wire>";
        XMLStreamReader reader = getReader(xml);
        Wire wire = (Wire) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, AssemblyConstants.WIRE.getNamespaceURI(), AssemblyConstants.WIRE.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(wire);
        assertEquals("foo", wire.getSource().getPartName());
        assertEquals("fooService", wire.getSource().getServiceName());
        assertEquals("bar", wire.getTarget().getPartName());
View Full Code Here

    public void testCompound() throws XMLStreamException, ConfigurationLoadException {
        String xml = "<wire xmlns='http://www.osoa.org/xmlns/sca/0.9'><source.uri>foo/fooService</source.uri><target.uri>bar/bazService</target.uri></wire>";
        XMLStreamReader reader = getReader(xml);
        Wire wire = (Wire) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, AssemblyConstants.WIRE.getNamespaceURI(), AssemblyConstants.WIRE.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(wire);
        assertEquals("foo", wire.getSource().getPartName());
        assertEquals("fooService", wire.getSource().getServiceName());
        assertEquals("bar", wire.getTarget().getPartName());
View Full Code Here

    public void testInterface() throws Exception {
        wsdlRegistry.loadDefinition("http://www.interfacestyles.org", getClass().getResource("interfacestyles.wsdl"), resourceLoader);
        String xml = "<interface.wsdl xmlns='http://www.osoa.org/xmlns/sca/0.9' interface='http://www.interfacestyles.org#TestInterfaceStylesService'></interface.wsdl>";
        XMLStreamReader reader = getReader(xml);
        WSDLServiceContract sc = (WSDLServiceContract) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, INTERFACE_WSDL.getNamespaceURI(), INTERFACE_WSDL.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(sc);
       
        sc.initialize(modelContext);
       
View Full Code Here

        String xml = "<externalService xmlns='http://www.osoa.org/xmlns/sca/0.9' name='test'></externalService>";
        XMLStreamReader reader = getReader(xml);
        ExternalService es = (ExternalService) registry.load(reader, loaderContext);
        assertNotNull(es);
        assertEquals("test", es.getName());
        reader.require(XMLStreamConstants.END_ELEMENT, EXTERNAL_SERVICE.getNamespaceURI(), EXTERNAL_SERVICE.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
    }

    public void testInterface() throws XMLStreamException, ConfigurationLoadException {
        String interfaceName = MockService.class.getName();
View Full Code Here

    public void testInterface() throws XMLStreamException, ConfigurationLoadException {
        String interfaceName = MockService.class.getName();
        String xml = "<externalService xmlns='http://www.osoa.org/xmlns/sca/0.9' name='test'><interface.java interface='" + interfaceName + "'/></externalService>";
        XMLStreamReader reader = getReader(xml);
        ExternalService es = (ExternalService) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, EXTERNAL_SERVICE.getNamespaceURI(), EXTERNAL_SERVICE.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(es);
        assertEquals("test", es.getName());
        ConfiguredService configuredService = es.getConfiguredService();
        JavaServiceContract serviceContract = (JavaServiceContract) configuredService.getPort().getServiceContract();
View Full Code Here

    public void testMinimal() throws XMLStreamException, ConfigurationLoadException {
        String xml = "<entryPoint xmlns='http://www.osoa.org/xmlns/sca/0.9' name='test'></entryPoint>";
        XMLStreamReader reader = getReader(xml);
        EntryPoint ep = (EntryPoint) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, ENTRY_POINT.getNamespaceURI(), ENTRY_POINT.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(ep);
        assertEquals("test", ep.getName());
    }
View Full Code Here

    public void testInterface() throws XMLStreamException, ConfigurationLoadException {
        String interfaceName = MockService.class.getName();
        String xml = "<entryPoint xmlns='http://www.osoa.org/xmlns/sca/0.9' name='test'><interface.java interface='" + interfaceName + "'/></entryPoint>";
        XMLStreamReader reader = getReader(xml);
        EntryPoint ep = (EntryPoint) registry.load(reader, loaderContext);
        reader.require(XMLStreamConstants.END_ELEMENT, ENTRY_POINT.getNamespaceURI(), ENTRY_POINT.getLocalPart());
        assertEquals(XMLStreamConstants.END_DOCUMENT, reader.next());
        assertNotNull(ep);
        assertEquals("test", ep.getName());
        ConfiguredService configuredService = ep.getConfiguredService();
        JavaServiceContract serviceContract = (JavaServiceContract) configuredService.getPort().getServiceContract();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.