From 07b7dfd1a70ba222b899d9813f8c449dbf3b785f Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:28 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835124 13f79535-47bb-0310-9956-ffa450edef68 --- .../interfacedef/wsdl/AbstractWSDLTestCase.java | 67 --------- .../WSDLInterfaceIntrospectorTestCase.java | 81 ---------- .../WSDLOperationIntrospectorTestCase.java | 115 --------------- .../introspect/WrapperStyleOperationTestCase.java | 68 --------- .../sca/interfacedef/wsdl/xml/ReadTestCase.java | 128 ---------------- .../wsdl/xml/WSDLDocumentProcessorTestCase.java | 84 ----------- .../sca/interfacedef/wsdl/xml/WSDLTestCase.java | 116 --------------- .../sca/interfacedef/wsdl/xml/WriteTestCase.java | 117 --------------- .../wsdl/xml/XMLDocumentHelperTestCase.java | 53 ------- .../wsdl/xml/XSDDocumentProcessorTestCase.java | 97 ------------ .../sca/interfacedef/wsdl/xml/Calculator.composite | 55 ------- .../wsdl/xml/CalculatorComponent.constrainingType | 36 ----- .../wsdl/xml/CalculatorImpl.componentType | 33 ----- .../tuscany/sca/interfacedef/wsdl/xml/example.wsdl | 26 ---- .../interfacedef/wsdl/xml/invalid-stockquote.wsdl | 58 -------- .../tuscany/sca/interfacedef/wsdl/xml/ipo.xsd | 163 --------------------- .../sca/interfacedef/wsdl/xml/stockquote.wsdl | 58 -------- .../tuscany/sca/interfacedef/wsdl/xml/test1.wsdl | 45 ------ .../tuscany/sca/interfacedef/wsdl/xml/test1.xsd | 33 ----- .../tuscany/sca/interfacedef/wsdl/xml/test2.wsdl | 63 -------- .../wsdl/xml/unwrapped-stockquote.wsdl | 76 ---------- .../test/resources/wsdl/helloworld-interface.wsdl | 67 --------- .../test/resources/wsdl/helloworld-service.wsdl | 49 ------- .../src/test/resources/xsd/greeting.xsd | 29 ---- .../src/test/resources/xsd/helloworld.xsd | 22 --- .../src/test/resources/xsd/name.xsd | 29 ---- 26 files changed, 1768 deletions(-) delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd delete mode 100644 branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd (limited to 'branches/sca-java-1.1/modules/interface-wsdl-xml/src/test') diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java deleted file mode 100644 index 5aa28409ea..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionImpl; -import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolverExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLDocumentProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver; -import org.apache.tuscany.sca.interfacedef.wsdl.xml.XSDModelResolver; - -/** - * Test case for WSDLOperation - */ -public abstract class AbstractWSDLTestCase extends TestCase { - protected WSDLDocumentProcessor processor; - protected ModelResolver resolver; - protected WSDLFactory wsdlFactory; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - Contribution contribution = new ContributionImpl() { - }; - ModelResolverExtensionPoint modelResolvers = new DefaultModelResolverExtensionPoint(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdlFactory); - factories.addFactory(wsdl4jFactory); - resolver = new ExtensibleModelResolver(contribution, modelResolvers, factories); - contribution.setModelResolver(resolver); - modelResolvers.addResolver(WSDLDefinition.class, WSDLModelResolver.class); - modelResolvers.addResolver(XSDefinition.class, XSDModelResolver.class); - - processor = new WSDLDocumentProcessor(factories); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java deleted file mode 100644 index 966ffc25e2..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; - -/** - * Test case for InterfaceWSDLIntrospectorImpl - */ -public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - private PortType portType; - private WSDLDefinition definition; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - URL url = getClass().getResource("../xml/stockquote.wsdl"); - definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - } - - @SuppressWarnings("unchecked") - public final void testIntrospectPortType() throws InvalidInterfaceException { - WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver); - Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType"); - List operations = contract.getOperations(); - Assert.assertEquals(1, operations.size()); - Operation operation = operations.get(0); - Assert.assertEquals("getLastTradePrice", operation.getName()); - DataType> inputType = operation.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType returnType = operation.getOutputType(); - Assert.assertNotNull(returnType); - Assert.assertEquals(0, operation.getFaultTypes().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getInputChildElements().size()); - // Assert.assertEquals(1, - // operation.getWrapper().getOutputChildElements().size()); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java deleted file mode 100644 index 7b41e0f7aa..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; - -/** - * Test case for WSDLOperation - */ -public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = - new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - - @SuppressWarnings("unchecked") - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - - DataType> inputType = op.getInputType(); - Assert.assertEquals(1, inputType.getLogical().size()); - DataType type = inputType.getLogical().get(0); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName()); - - DataType outputType = op.getOutputType(); - Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"), - outputType.getLogical().getElementName()); - Assert.assertTrue(op.isWrapperStyle()); - - DataType> unwrappedInputType = op.getWrapper().getWrapperInfo().getUnwrappedInputType(); - List childTypes = unwrappedInputType.getLogical(); - Assert.assertEquals(1, childTypes.size()); - DataType childType = childTypes.get(0); - Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName()); - - childType = op.getWrapper().getWrapperInfo().getUnwrappedOutputType(); - Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("unwrapped-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(1, op.getInputType().getLogical().size()); - - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - Assert.assertEquals(2, op.getInputType().getLogical().size()); - } - - public final void testInvalidWSDL() throws Exception { - URL url = getClass().getResource("../xml/invalid-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("invalid-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - - try { - op.isWrapperStyle(); - fail("InvalidWSDLException should have been thrown"); - } catch (InvalidInterfaceException e) { - // Expected - } - - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java deleted file mode 100644 index a82a022088..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.introspect; - -import java.net.URI; -import java.net.URL; - -import javax.wsdl.Operation; -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationIntrospectorImpl; - -/** - * Test case for WSDLOperation - */ -public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - - public final void testWrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertTrue(op.isWrapperStyle()); - Assert.assertEquals(1, op.getWrapper().getInputChildElements().size()); - Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size()); - } - - public final void testUnwrappedOperation() throws Exception { - URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl"); - WSDLDefinition definition = processor.read(null, new URI("unwrapped-stockquote.wsdl"), url); - resolver.addModel(definition); - definition = resolver.resolveModel(WSDLDefinition.class, definition); - PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME); - Operation operation = portType.getOperation("getLastTradePrice1", null, null); - WSDLOperationIntrospectorImpl op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(wsdlFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java deleted file mode 100644 index 9834f3f3f2..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.binding.sca.impl.SCABindingFactoryImpl; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultIntentAttachPointTypeFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class ReadTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new SCABindingFactoryImpl(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testReadComponentType() throws Exception { - ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ComponentType componentType = componentTypeProcessor.read(reader); - assertNotNull(componentType); - - //new PrintUtil(System.out).print(componentType); - } - - public void testReadConstrainingType() throws Exception { - ConstrainingTypeProcessor constrainingTypeProcessor = new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ConstrainingType constrainingType = constrainingTypeProcessor.read(reader); - assertNotNull(constrainingType); - - //new PrintUtil(System.out).print(constrainingType); - } - - public void testReadComposite() throws Exception { - CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor); - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeProcessor.read(reader); - assertNotNull(composite); - - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new DefaultIntentAttachPointTypeFactory(), mapper, null, null); - compositeUtil.build(composite); - - //new PrintUtil(System.out).print(composite); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java deleted file mode 100644 index 5cad523218..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; -import java.util.List; - -import javax.wsdl.Import; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase { - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - super.setUp(); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testWSDL() throws Exception { - - URL url = getClass().getResource("/wsdl/helloworld-service.wsdl"); - WSDLDefinition definition = processor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url); - - Assert.assertNull(definition.getDefinition()); - Assert.assertEquals("http://helloworld", definition.getNamespace()); - URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - WSDLDefinition definition1 = processor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1); - Assert.assertNull(definition1.getDefinition()); - Assert.assertEquals("http://helloworld", definition1.getNamespace()); - - resolver.addModel(definition); - resolver.addModel(definition1); - resolver.resolveModel(WSDLDefinition.class, definition); - resolver.resolveModel(WSDLDefinition.class, definition1); - WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition); - List imports = (List)definition.getDefinition().getImports().get("http://helloworld"); - Assert.assertNotNull(imports); - Assert.assertNotNull(((Import)imports.get(0)).getDefinition()); - Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld"))); - Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService"))); - - assertNotNull(resolved.getXmlSchemaType(new QName("http://greeting", "Name"))); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java deleted file mode 100644 index 3696c8f073..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WSDLTestCase extends TestCase { - - private DefaultURLArtifactProcessorExtensionPoint documentProcessors; - private ExtensibleURLArtifactProcessor documentProcessor; - private WSDLModelResolver wsdlResolver; - - @Override - public void setUp() throws Exception { - documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint()); - documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance(); - factories.addFactory(wsdl4jFactory); - WSDLDocumentProcessor wsdlProcessor = new WSDLDocumentProcessor(factories); - documentProcessors.addArtifactProcessor(wsdlProcessor); - wsdlResolver = new WSDLModelResolver(null, factories); - } - - @Override - public void tearDown() throws Exception { - documentProcessors = null; - } - - public void testReadWSDLDocument() throws Exception { - URL url = getClass().getResource("example.wsdl"); - WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, WSDLDefinition.class); - assertNotNull(definition); - assertNull(definition.getDefinition()); - assertEquals(definition.getNamespace(), "http://www.example.org"); - } - - public void testReadWSDLImports() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - //binding is a part of test1.wsdl - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - //porttype is part of test2.wsdl - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - } - - public void testReadSameNamespaceWSDLDocument() throws Exception { - QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding"); - QName aPortType = new QName("http://helloworld", "HelloWorld"); - - URL url = getClass().getResource("test2.wsdl"); - WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, WSDLDefinition.class); - assertNotNull(test2Defn); - wsdlResolver.addModel(test2Defn); - test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn); - - //bindigs are a part of test1.wsdl so should not be found - assertNull(test2Defn.getDefinition().getBinding(aBinding)); - assertNotNull(test2Defn.getDefinition().getPortType(aPortType)); - - url = getClass().getResource("test1.wsdl"); - WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class); - assertNotNull(test1Defn); - wsdlResolver.addModel(test1Defn); - - test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn); - - assertNotNull(test1Defn.getDefinition().getPortType(aPortType)); - assertNotNull(test1Defn.getDefinition().getBinding(aBinding)); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java deleted file mode 100644 index 3a9468216f..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading/write WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WriteTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - @Override - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - staxProcessors.addArtifactProcessor(new CompositeProcessor(new ContributionFactoryImpl(), factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - WSDLInterfaceProcessor wsdlProcessor = new WSDLInterfaceProcessor(modelFactories); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - @Override - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testReadWriteComponentType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - ComponentType componentType = staxProcessor.read(is, ComponentType.class); - assertNotNull(componentType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(componentType, bos); - } - - public void testReadWriteConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingType constrainingType = staxProcessor.read(is, ConstrainingType.class); - assertNotNull(constrainingType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(constrainingType, bos); - } - - public void testReadWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - assertNotNull(composite); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java deleted file mode 100644 index e8fb4c6385..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URL; - -import junit.framework.Assert; - -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XMLDocumentHelperTestCase { - private URL wsdl; - private URL xsd; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - wsdl = getClass().getResource("/wsdl/helloworld-interface.wsdl"); - xsd = getClass().getResource("/xsd/greeting.xsd"); - } - - @Test - public void testReadTNS() throws Exception { - String tns = XMLDocumentHelper.readTargetNamespace(wsdl, XMLDocumentHelper.WSDL11, true, "targetNamespace"); - Assert.assertEquals("http://helloworld", tns); - String tns2 = XMLDocumentHelper.readTargetNamespace(xsd, XMLDocumentHelper.XSD, true, null); - Assert.assertEquals("http://greeting", tns2); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java deleted file mode 100644 index 9d4ee87ece..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessorTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.interfacedef.wsdl.xml; - -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.contribution.DefaultModelFactoryExtensionPoint; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.XSDefinition; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaObjectCollection; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * @version $Rev$ $Date$ - */ -public class XSDDocumentProcessorTestCase { - private XSDDocumentProcessor processor; - private WSDLFactory wsdlFactory; - - /** - * @throws java.lang.Exception - */ - @Before - public void setUp() throws Exception { - ModelFactoryExtensionPoint modelFactories = new DefaultModelFactoryExtensionPoint(); - wsdlFactory = new DefaultWSDLFactory(); - modelFactories.addFactory(wsdlFactory); - processor = new XSDDocumentProcessor(modelFactories); - } - - /** - * @throws java.lang.Exception - */ - @After - public void tearDown() throws Exception { - } - - @Test - public void testXSD() throws Exception { - URL url = getClass().getResource("/xsd/greeting.xsd"); - XSDefinition definition = processor.read(null, URI.create("xsd/greeting.xsd"), url); - Assert.assertNull(definition.getSchema()); - Assert.assertEquals("http://greeting", definition.getNamespace()); - URL url1 = getClass().getResource("/xsd/name.xsd"); - XSDefinition definition1 = processor.read(null, URI.create("xsd/name.xsd"), url1); - Assert.assertNull(definition1.getSchema()); - Assert.assertEquals("http://greeting", definition1.getNamespace()); - ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint(); - factories.addFactory(wsdlFactory); - XSDModelResolver resolver = new XSDModelResolver(null, factories); - resolver.addModel(definition); - XSDefinition resolved = resolver.resolveModel(XSDefinition.class, definition); - XmlSchemaObjectCollection collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 1); - XmlSchemaType type = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertNotNull(type); - resolver.addModel(definition1); - resolved = resolver.resolveModel(XSDefinition.class, definition); - collection = resolved.getSchema().getIncludes(); - Assert.assertTrue(collection.getCount() == 2); - XmlSchemaType type1 = - ((XmlSchemaInclude)collection.getItem(0)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - XmlSchemaType type2 = - ((XmlSchemaInclude)collection.getItem(1)).getSchema().getTypeByName(new QName("http://greeting", "Name")); - Assert.assertTrue(type1 != null || type2 != null); - } - -} diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite deleted file mode 100644 index 875fdf35d2..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType deleted file mode 100644 index 3eb81b61bd..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType deleted file mode 100644 index aea7046a3d..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl deleted file mode 100644 index 5e8e5dad0d..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl deleted file mode 100644 index ad81fc7867..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd deleted file mode 100644 index 49060636d1..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl deleted file mode 100644 index 39cd5547d9..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl deleted file mode 100644 index 8e26f7b4b5..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd deleted file mode 100644 index c2210f4a94..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl deleted file mode 100644 index 529b395fd5..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl deleted file mode 100644 index 666a7e4069..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl deleted file mode 100644 index b0b6644e7f..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-interface.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl deleted file mode 100644 index 0a7979e308..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/wsdl/helloworld-service.wsdl +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd deleted file mode 100644 index 635ca25bfc..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/greeting.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd deleted file mode 100644 index bb0c9bc7b7..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/helloworld.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd b/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd deleted file mode 100644 index 300de931ec..0000000000 --- a/branches/sca-java-1.1/modules/interface-wsdl-xml/src/test/resources/xsd/name.xsd +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3