From 79f3c4804c2c9a71116993767671700bdbea6981 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 13 Nov 2008 03:27:28 +0000 Subject: Add the missing AbstractWSDLTestCase git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@713623 13f79535-47bb-0310-9956-ffa450edef68 --- .../wsdl/xml/AbstractWSDLTestCase.java | 69 ++++++++++++++++++++++ .../wsdl/xml/WSDLDocumentProcessorTestCase.java | 1 - 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java (limited to 'branches/sca-equinox/modules/interface-wsdl-xml/src/test/java') diff --git a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java new file mode 100644 index 0000000000..5cafcccea1 --- /dev/null +++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java @@ -0,0 +1,69 @@ +/* + * 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 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.interfacedef.wsdl.WSDLFactory; +import org.apache.tuscany.sca.xsd.XSDFactory; + +/** + * Test case for WSDLOperation. + * + * @version $Rev$ $Date$ + */ +public abstract class AbstractWSDLTestCase extends TestCase { + protected URLArtifactProcessor 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/xml/WSDLDocumentProcessorTestCase.java b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java index 2d3a3a54ff..6574bbd7c4 100644 --- a/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java +++ b/branches/sca-equinox/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java @@ -28,7 +28,6 @@ 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; -- cgit v1.2.3