You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ms...@apache.org on 2007/01/10 22:17:15 UTC

svn commit: r494988 - in /incubator/ode/trunk/bpel-store/src/test: java/org/apache/ode/store/ resources/complexImport/ resources/complexImport/dir1/ resources/complexImport/dir1/dir11/

Author: mszefler
Date: Wed Jan 10 13:17:14 2007
New Revision: 494988

URL: http://svn.apache.org/viewvc?view=rev&rev=494988
Log:
Added test case for DeploymentUnitDir with nested wsdl/xsd imports.

Added:
    incubator/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/DeploymentUnitTest.java
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/bar.wsdl
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/deploy.xml
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/baz.xsd
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/foo.wsdl
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/foo.wsdl
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.bpel
    incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.wsdl

Added: incubator/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/DeploymentUnitTest.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/DeploymentUnitTest.java?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/DeploymentUnitTest.java (added)
+++ incubator/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/DeploymentUnitTest.java Wed Jan 10 13:17:14 2007
@@ -0,0 +1,31 @@
+package org.apache.ode.store;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+/**
+ * Test for {@link org.apache.ode.store.DeploymentUnitDir}. 
+ * @author Maciej Szefler - m s z e f l e r @ g m a i l . c o m
+ *
+ */
+public class DeploymentUnitTest  extends TestCase {
+    DeploymentUnitDir du;
+    
+    public void setUp() throws Exception {
+        File dir = new File(getClass().getResource("/complexImport/deploy.xml").getPath()).getParentFile();
+        du = new DeploymentUnitDir(dir);
+    }
+    
+    public void testRegistry() {
+        DocumentRegistry dr = du.getDocRegistry();
+        assertNotNull(dr.getDefinitionForPortType(new QName("http://ode/bpel/unit-test.wsdl","HelloPortType")));
+    }
+    
+    public void testCompile() {
+        du.compile();
+    }
+    
+}

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/bar.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/bar.wsdl?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/bar.wsdl (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/bar.wsdl Wed Jan 10 13:17:14 2007
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<wsdl:definitions 
+    targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-test.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+    
+    <wsdl:message name="HelloMessage">
+        <wsdl:part name="TestPart" type="xsd:string"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="HelloPortType">
+        <wsdl:operation name="hello">
+            <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+            <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+        </wsdl:operation>    
+    </wsdl:portType>
+    
+     <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="hello">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl"
+                    use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl" 
+                    use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="HelloService">
+		<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+     		<soap:address location="http://localhost:8080/ode/processes/helloWorld"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="HelloPartnerLinkType">
+       <plnk:role name="me" portType="tns:HelloPortType"/>
+       <plnk:role name="you" portType="tns:HelloPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
+

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/deploy.xml
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/deploy.xml?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/deploy.xml (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/deploy.xml Wed Jan 10 13:17:14 2007
@@ -0,0 +1,12 @@
+<deploy xmlns="http://ode.fivesight.com/schemas/2006/06/27/dd" 
+	xmlns:pns="http://ode/bpel/unit-test" 
+	xmlns:wns="http://ode/bpel/unit-test.wsdl">
+
+
+	<process name="pns:HelloWorld2">
+		<active>true</active>
+		<provide partnerLink="helloPartnerLink">
+			<service name="wns:HelloService" port="HelloPort"/>
+		</provide>
+	</process>
+</deploy>

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/baz.xsd
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/baz.xsd?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/baz.xsd (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/baz.xsd Wed Jan 10 13:17:14 2007
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  ~ 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.
+  -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
+	xmlns:wh="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.xsd" 
+	targetNamespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.xsd">
+
+	<xs:simpleType name="CustomerReferenceType">
+		<xs:restriction base="xs:normalizedString">
+			<xs:maxLength value="20"/>
+			<xs:pattern value="[A-D][0-9]{5}-[0-9A-Z]{7}-[a-z]{3}#*"/>
+		</xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="Item">
+		<xs:sequence>
+			<xs:element name="ProductNumber" type="xs:nonNegativeInteger"/>
+			<xs:element name="Quantity" type="xs:unsignedShort"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="ItemList">
+		<xs:sequence>
+			<xs:element name="Item" type="wh:Item" minOccurs="1" maxOccurs="unbounded" nillable="false"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="ItemShippingStatus">
+		<xs:sequence>
+			<xs:element name="ProductNumber" type="xs:nonNegativeInteger"/>
+			<xs:element name="Status" type="xs:boolean"/>
+		</xs:sequence>
+	</xs:complexType>
+
+	<xs:complexType name="ItemShippingStatusList">
+		<xs:sequence>
+			<xs:element name="ItemStatus" type="wh:ItemShippingStatus" minOccurs="1" maxOccurs="unbounded" nillable="false"/>
+		</xs:sequence>
+	</xs:complexType>
+
+</xs:schema>

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/foo.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/foo.wsdl?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/foo.wsdl (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/dir11/foo.wsdl Wed Jan 10 13:17:14 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<wsdl:definitions 
+    targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-test.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+     
+    <wsdl:import 
+      namespace="http://ode/bpel/unit-test.wsdl"
+      location="../../bar.wsdl"/>
+      
+      
+	<wsdl:types>
+     <xsd:schema targetNamespace="http://foo/bar" >
+       <xsd:import namespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Warehouse.xsd"
+        schemaLocation="baz.xsd"/>
+    </xsd:schema>
+    </wsdl:types>
+</wsdl:definitions>
+
+

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/foo.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/foo.wsdl?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/foo.wsdl (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/dir1/foo.wsdl Wed Jan 10 13:17:14 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<wsdl:definitions 
+    targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-test.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+    
+     
+    <wsdl:import 
+      namespace="http://ode/bpel/unit-test.wsdl"
+      location="dir11/foo.wsdl" />
+      
+</wsdl:definitions>
+

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.bpel
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.bpel?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.bpel (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.bpel Wed Jan 10 13:17:14 2007
@@ -0,0 +1,14 @@
+<process name="HelloWorld2"
+    targetNamespace="http://ode/bpel/unit-test" 
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:tns="http://ode/bpel/unit-test"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:test="http://ode/bpel/unit-test.wsdl">
+
+  <import location="foo.wsdl"
+     namespace="http://ode/bpel/unit-test.wsdl"
+     importType="http://schemas.xmlsoap.org/wsdl/" />
+
+  <empty/>
+</process>

Added: incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.wsdl?view=auto&rev=494988
==============================================================================
--- incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.wsdl (added)
+++ incubator/ode/trunk/bpel-store/src/test/resources/complexImport/foo.wsdl Wed Jan 10 13:17:14 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<wsdl:definitions 
+    targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-test.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+    
+    <wsdl:import 
+      namespace="http://ode/bpel/unit-test.wsdl"
+      location="dir1/foo.wsdl"/>
+</wsdl:definitions>
+