summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/modules/interface-wsdl-xml
diff options
context:
space:
mode:
Diffstat (limited to 'branches/sca-equinox/modules/interface-wsdl-xml')
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/META-INF/MANIFEST.MF45
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java6
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java3
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java4
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java68
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java83
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java117
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java87
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java70
-rw-r--r--branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java14
10 files changed, 32 insertions, 465 deletions
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/META-INF/MANIFEST.MF b/branches/sca-equinox/modules/interface-wsdl-xml/META-INF/MANIFEST.MF
index a41df60f4b..b2a155183c 100644
--- a/branches/sca-equinox/modules/interface-wsdl-xml/META-INF/MANIFEST.MF
+++ b/branches/sca-equinox/modules/interface-wsdl-xml/META-INF/MANIFEST.MF
@@ -10,25 +10,32 @@ Bnd-LastModified: 1225397292156
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: Apache Tuscany SCA WSDL Interface XML Model
-Import-Package: javax.wsdl,javax.wsdl.extensions,javax.wsdl.extensions
- .schema,javax.wsdl.factory,javax.wsdl.xml,javax.xml.namespace,javax.x
- ml.stream,org.apache.tuscany.sca.contribution;version="1.4",org.apach
- e.tuscany.sca.contribution.namespace;version="1.4",org.apache.tuscany
- .sca.contribution.processor;version="1.4",org.apache.tuscany.sca.cont
- ribution.resolver;version="1.4",org.apache.tuscany.sca.core;version="
- 1.4",org.apache.tuscany.sca.interfacedef;version="1.4",org.apache.tus
- cany.sca.interfacedef.wsdl;version="1.4",org.apache.tuscany.sca.monit
- or;version="1.4",org.apache.tuscany.sca.xsd;version="1.4",org.apache.
- tuscany.sca.xsd.xml;version="1.4",org.apache.ws.commons.schema,org.w3
- c.dom,org.xml.sax,org.apache.tuscany.sca.interfacedef.util;version="1
- .4";resolution:=optional,org.apache.tuscany.sca.definitions;version="
- 1.4";resolution:=optional,org.apache.tuscany.sca.interfacedef.wsdl.im
- pl;resolution:=optional,org.apache.tuscany.sca.policy;version="1.4";r
- esolution:=optional,junit.framework;resolution:=optional,org.apache.t
- uscany.sca.assembly.builder;version="1.4";resolution:=optional,org.ap
- ache.tuscany.sca.assembly;version="1.4";resolution:=optional,org.apac
- he.tuscany.sca.assembly.builder.impl;resolution:=optional,org.junit;r
- esolution:=optional
+Import-Package: javax.wsdl,
+ javax.wsdl.extensions,
+ javax.wsdl.extensions.schema,
+ javax.wsdl.factory,
+ javax.wsdl.xml,
+ javax.xml.namespace,
+ javax.xml.stream,
+ junit.framework;resolution:=optional,
+ org.apache.tuscany.sca.assembly;version="1.4";resolution:=optional,
+ org.apache.tuscany.sca.assembly.builder;version="1.4";resolution:=optional,
+ org.apache.tuscany.sca.contribution;version="1.4",
+ org.apache.tuscany.sca.contribution.namespace;version="1.4",
+ org.apache.tuscany.sca.contribution.processor;version="1.4",
+ org.apache.tuscany.sca.contribution.resolver;version="1.4",
+ org.apache.tuscany.sca.core;version="1.4",
+ org.apache.tuscany.sca.definitions;version="1.4.0";resolution:=optional,
+ org.apache.tuscany.sca.interfacedef;version="1.4",
+ org.apache.tuscany.sca.interfacedef.wsdl;version="1.4",
+ org.apache.tuscany.sca.monitor;version="1.4",
+ org.apache.tuscany.sca.policy;version="1.4";resolution:=optional,
+ org.apache.tuscany.sca.xsd;version="1.4",
+ org.apache.tuscany.sca.xsd.xml;version="1.4",
+ org.apache.ws.commons.schema,
+ org.junit;resolution:=optional,
+ org.w3c.dom,
+ org.xml.sax
Bundle-SymbolicName: org.apache.tuscany.sca.interface.wsdl.xml
Bundle-DocURL: http://www.apache.org/
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
index f9ddda6d98..82d18ca319 100644
--- a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
+++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
@@ -20,17 +20,15 @@ package org.apache.tuscany.sca.interfacedef.wsdl.xml;
import javax.xml.namespace.QName;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-
/**
* Constants for WSDL.
*
* @version $Rev$ $Date$
*/
public interface WSDLConstants {
-
+ String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
String INTERFACE_WSDL = "interface.wsdl";
- QName INTERFACE_WSDL_QNAME = new QName(Constants.SCA10_NS, "interface.wsdl");
+ QName INTERFACE_WSDL_QNAME = new QName(SCA10_NS, "interface.wsdl");
String INTERFACE = "interface";
String CALLBACK_INTERFACE = "callbackInterface";
String WSDL_LOCATION = "wsdlLocation";
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
index 7f9f6b0146..8331215067 100644
--- a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
+++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
@@ -43,9 +43,8 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.monitor.impl.ProblemImpl;
-import org.apache.tuscany.sca.xsd.XSDefinition;
import org.apache.tuscany.sca.xsd.XSDFactory;
+import org.apache.tuscany.sca.xsd.XSDefinition;
/**
* An ArtifactProcessor for WSDL documents.
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
index 6a364fe164..d40aac9434 100644
--- a/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
@@ -27,7 +27,6 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
-import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
@@ -43,7 +42,6 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
import org.apache.tuscany.sca.monitor.Monitor;
import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.monitor.impl.ProblemImpl;
/**
*
@@ -162,7 +160,7 @@ public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfa
public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
// Write an <interface.wsdl>
- writer.writeStartElement(Constants.SCA10_NS, INTERFACE_WSDL);
+ writer.writeStartElement(WSDLConstants.SCA10_NS, INTERFACE_WSDL);
// Write interface name
WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.java
deleted file mode 100644
index 8ed7ba395b..0000000000
--- a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/AbstractWSDLTestCase.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;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-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.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev$ $Date$
- */
-public abstract class AbstractWSDLTestCase extends TestCase {
- protected URLArtifactProcessor<Object> documentProcessor;
- protected ModelResolver resolver;
- protected WSDLFactory wsdlFactory;
- protected XSDFactory xsdFactory;
-
- /**
- * @see junit.framework.TestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- xsdFactory = modelFactories.getFactory(XSDFactory.class);
-
- ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- Contribution contribution = contributionFactory.createContribution();
- ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
- contribution.setModelResolver(resolver);
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
- }
-
-}
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/branches/sca-equinox/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-equinox/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<Operation> operations = contract.getOperations();
- Assert.assertEquals(1, operations.size());
- Operation operation = operations.get(0);
- Assert.assertEquals("getLastTradePrice", operation.getName());
- DataType<List<DataType>> inputType = operation.getInputType();
- Assert.assertEquals(1, inputType.getLogical().size());
- DataType<XMLType> 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-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
deleted file mode 100644
index c392b92f8a..0000000000
--- a/branches/sca-equinox/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<List<DataType>> inputType = op.getInputType();
- Assert.assertEquals(1, inputType.getLogical().size());
- DataType<XMLType> type = inputType.getLogical().get(0);
- Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());
-
- DataType<XMLType> outputType = op.getOutputType();
- Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
- outputType.getLogical().getElementName());
- Assert.assertTrue(op.isWrapperStyle());
-
- DataType<List<DataType>> unwrappedInputType = op.getWrapper().getWrapperInfo().getUnwrappedInputType();
- List<DataType> childTypes = unwrappedInputType.getLogical();
- Assert.assertEquals(1, childTypes.size());
- DataType<XMLType> 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 = (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-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/branches/sca-equinox/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-equinox/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-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/branches/sca-equinox/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-equinox/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());
- }
-
-}
diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
index 21e8e44046..7f17f7463f 100644
--- a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
+++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
@@ -26,22 +26,17 @@ 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.SCABindingFactory;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
-import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
/**
* Test reading WSDL interfaces.
@@ -62,12 +57,7 @@ public class ReadTestCase extends TestCase {
staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- SCABindingFactory scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
- IntentAttachPointTypeFactory attachPointTypeFactory = modelFactories.getFactory(IntentAttachPointTypeFactory.class);
- compositeBuilder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, attachPointTypeFactory, mapper);
+ compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
}
public void testReadComponentType() throws Exception {