From 3d3b8834b93b98cc7d7534e693e937179067eb58 Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 16 May 2009 08:44:44 +0000 Subject: Delete previous 1.5 branch thats now old and unused and will be replaced with the current 1.x trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775435 13f79535-47bb-0310-9956-ffa450edef68 --- .../WSDLInterfaceIntrospectorTestCase.java | 83 --------------- .../WSDLOperationIntrospectorTestCase.java | 117 --------------------- ...licyAnnotatedInterfaceIntrospectorTestCase.java | 87 --------------- .../introspect/WrapperStyleOperationTestCase.java | 70 ------------ 4 files changed, 357 deletions(-) delete mode 100644 branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java delete mode 100644 branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java delete mode 100644 branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java delete mode 100644 branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java (limited to 'branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect') diff --git a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java deleted file mode 100644 index dc7e1ced38..0000000000 --- a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java +++ /dev/null @@ -1,83 +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. - * - * @version $Rev$ $Date$ - */ -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 = (WSDLDefinition)documentProcessor.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.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java deleted file mode 100644 index 5b019b748f..0000000000 --- a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.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.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. - * - * @version $Rev$ $Date$ - */ -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 = (WSDLDefinition)documentProcessor.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(xsdFactory, 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().getInputWrapperInfo().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().getOutputWrapperInfo().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 = (WSDLDefinition)documentProcessor.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(xsdFactory, 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(xsdFactory, 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 = (WSDLDefinition)documentProcessor.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(xsdFactory, 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.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java deleted file mode 100644 index cf379a1b11..0000000000 --- a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java +++ /dev/null @@ -1,87 +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.PortType; -import javax.xml.namespace.QName; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.wsdl.AbstractWSDLTestCase; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.policy.Intent; - -/** - * Test case for InterfaceWSDLIntrospectorImpl. - * - * @version $Rev$ $Date$ - */ -public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWSDLTestCase { - private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType"); - private static final QName INTENT = new QName("http://example.com/stockquote.wsdl", "PolicyIntent"); - - private PortType portType; - private WSDLDefinition definition; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception { - super.setUp(); - - URL url = getClass().getResource("/policy/stockquote_policy.wsdl"); - definition = (WSDLDefinition)documentProcessor.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"); - Assert.assertTrue(contract.isConversational()); - - boolean foundIntent = false; - - for(Intent intent : contract.getRequiredIntents()) { - if(INTENT.equals(intent.getName())) { - foundIntent = true; - } - } - - Assert.assertTrue(foundIntent); - - for(Operation operation : contract.getOperations()) { - if(operation.getName().equals("cancel")) { - Assert.assertEquals(operation.getConversationSequence(), ConversationSequence.CONVERSATION_END); - } - } - - } -} diff --git a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java deleted file mode 100644 index ff18c65c69..0000000000 --- a/branches/sca-java-1.5/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java +++ /dev/null @@ -1,70 +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. - * - * @version $Rev$ $Date$ - */ -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 = (WSDLDefinition)documentProcessor.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(xsdFactory, 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 = (WSDLDefinition)documentProcessor.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(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - operation = portType.getOperation("getLastTradePrice2", null, null); - op = new WSDLOperationIntrospectorImpl(xsdFactory, operation, definition, "org.w3c.dom.Node", resolver); - Assert.assertFalse(op.isWrapperStyle()); - } - -} -- cgit v1.2.3