tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r512736 - in /incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src: main/java/org/apache/tuscany/idl/wsdl/ test/java/org/apache/tuscany/idl/wsdl/
Date Wed, 28 Feb 2007 12:48:05 GMT
Author: antelder
Date: Wed Feb 28 04:48:04 2007
New Revision: 512736

URL: http://svn.apache.org/viewvc?view=rev&rev=512736
Log:
Add method to the wsdl registry to get the wsdl definition for a namespace

Modified:
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java
    incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java?view=diff&rev=512736&r1=512735&r2=512736
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java
Wed Feb 28 04:48:04 2007
@@ -86,4 +86,6 @@
      * @return
      */
     XMLSchemaRegistry getSchemaRegistry();
+
+    Definition getDefinition(String wsdlNamespace);
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java?view=diff&rev=512736&r1=512735&r2=512736
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java
Wed Feb 28 04:48:04 2007
@@ -26,6 +26,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
 import javax.wsdl.Definition;
 import javax.wsdl.Import;
 import javax.wsdl.PortType;
@@ -199,6 +200,15 @@
             schemaRegistry = new XMLSchemaRegistryImpl();
         }
         return schemaRegistry;
+    }
+
+    public Definition getDefinition(String wsdlNamespace) {
+        List<Definition> definitions = definitionsByNamespace.get(wsdlNamespace);
+        if (definitions == null || definitions.size() < 1) {
+            return null;
+        } else {
+            return definitions.get(0);
+        }
     }
 
 }

Modified: incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java?view=diff&rev=512736&r1=512735&r2=512736
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java
Wed Feb 28 04:48:04 2007
@@ -68,6 +68,17 @@
         }
     }
 
+    public void testGetDefinition() {
+        try {
+            wsdlRegistry.loadDefinition(NS + ' ' + exampleWsdl, cl);
+            Assert.assertNotNull(wsdlRegistry.getDefinition(NS));
+        } catch (IOException e) {
+            Assert.fail(e.getMessage());
+        } catch (WSDLException e) {
+            Assert.fail(e.getMessage());
+        }
+    }
+
     protected void setUp() throws Exception {
         super.setUp();
         wsdlRegistry = new WSDLDefinitionRegistryImpl();



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


Mime
View raw message