You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/04/09 19:23:15 UTC

svn commit: r526845 - in /incubator/tuscany/java/sca/modules/interface-wsdl-xml/src: main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java

Author: jsdelfino
Date: Mon Apr  9 10:23:15 2007
New Revision: 526845

URL: http://svn.apache.org/viewvc?view=rev&rev=526845
Log:
Added WSDL artifact processor test case.

Added:
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java   (with props)
Modified:
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java?view=diff&rev=526845&r1=526844&r2=526845
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java Mon Apr  9 10:23:15 2007
@@ -102,7 +102,7 @@
             }
         }
         
-        wsdlExtensionRegistry = wsdlFactory.newPopulatedExtensionRegistry();
+        wsdlExtensionRegistry = this.wsdlFactory.newPopulatedExtensionRegistry();
     }
     
     public WSDLDocumentProcessor() {

Added: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java?view=auto&rev=526845
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java Mon Apr  9 10:23:15 2007
@@ -0,0 +1,62 @@
+/*
+ * 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.interfacedef.wsdl.xml;
+
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.services.spi.contribution.DefaultURLArtifactProcessorRegistry;
+
+/**
+ * Test reading WSDL interfaces.
+ * 
+ * @version $Rev$ $Date$
+ */
+public class WSDLTestCase extends TestCase {
+
+    XMLInputFactory inputFactory;
+    DefaultURLArtifactProcessorRegistry registry;
+
+    public void setUp() throws Exception {
+        inputFactory = XMLInputFactory.newInstance();
+        registry = new DefaultURLArtifactProcessorRegistry();
+
+        WSDLDocumentProcessor wsdlProcessor = new WSDLDocumentProcessor();
+        registry.addArtifactProcessor(wsdlProcessor);
+    }
+
+    public void tearDown() throws Exception {
+        inputFactory = null;
+        registry = null;
+    }
+
+    public void testReadWSDLDocument() throws Exception {
+        URL url = getClass().getResource("example.wsdl");
+        WSDLDefinition definition = registry.read(url, WSDLDefinition.class);
+        assertNotNull(definition);
+        assertNotNull(definition.getDefinition());
+        assertEquals(definition.getNamespace(), "http://www.example.org");
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org