You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ch...@apache.org on 2006/06/27 00:00:27 UTC
svn commit: r417301 [1/2] - in /incubator/ode/scratch/bpe: bpelTests/
bpelTests/testRelativeSchemaImports/
bpelTests/testRelativeSchemaImports/account/
bpelTests/testRelativeSchemaImports/investor/
src/main/java/org/apache/ode/bpe/deployment/bpel/ src/...
Author: charper
Date: Mon Jun 26 15:00:26 2006
New Revision: 417301
URL: http://svn.apache.org/viewvc?rev=417301&view=rev
Log:
ODE-5: Implementation of Relative Schema/WSDL Import Paths
Added:
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/AccountTypes.xsd
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_1.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_2.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_3.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_4.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_5.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_6.txt
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/Investor.xsd
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.bpel
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.wsdl
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.xml
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl
incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testSchema.xsd
Modified:
incubator/ode/scratch/bpe/bpelTests/build.xml
incubator/ode/scratch/bpe/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELWSDLLocator.java
incubator/ode/scratch/bpe/src/test/java/org/apache/ode/bpe/test/BPELTests.java
Modified: incubator/ode/scratch/bpe/bpelTests/build.xml
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/build.xml?rev=417301&r1=417300&r2=417301&view=diff
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/build.xml (original)
+++ incubator/ode/scratch/bpe/bpelTests/build.xml Mon Jun 26 15:00:26 2006
@@ -1,186 +1,190 @@
-<project name="Build BPEL Jars" default="bpeltestsjar">
- <description>
- Build BPEL Jars.
- </description>
- <!-- =================================================================== -->
- <!-- jartest -->
- <!-- =================================================================== -->
- <target name="jartest">
- <jar destfile="${basedir}/test${jartest.num}/bpelTest${jartest.num}.jar">
- <fileset dir="${basedir}/..">
- <include name="bpelTests/probeService/*.wsdl"/>
- <include name="bpelTests/test${jartest.num}/*.wsdl"/>
- <include name="bpelTests/test${jartest.num}/*.bpel"/>
- <include name="bpelTests/test${jartest.num}/*.xslt"/>
- <include name="bpelTests/test${jartest.num}/*.xml"/>
- </fileset>
- </jar>
- </target>
- <!-- =================================================================== -->
- <!-- jar up the tests -->
- <!-- =================================================================== -->
- <target name="bpeltestsjar">
- <antcall target="jartest">
- <param name="jartest.num" value="1"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="3"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="4"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="5"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="6"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="7"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="8"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="9"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="10"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="12"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="13"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="14"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="15"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="16"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="17"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="benchMark2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="benchMark3"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="benchMark4"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="BPChain"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="ThrowFaultOutsideOfBP"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="Timer1"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="Timer2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="Timer3"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="Terminate"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="FlowScopes"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="ScopedCorrelationSets"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CatchForcedTerminate"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="FaultInCompensationHandler"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="FaultInFaultHandler"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="TimerOnAlarmAtRootScope"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="FaultCompHandlerInInvoke"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="LoopedCompensation"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="OOBData"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="NSDeploy"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="GetVarData"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="LocalInvoke"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="LinkInSwitch"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="Qts377278"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="PartnerLinkAssign"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="NestedSplits"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="ReplyWithFault"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CorrlCmplx"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CorrlInvokeReply"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="GraftGraftChildren"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="LoopedCompensation2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="BuildDocWithNestedNS"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="SingleRuleInCompHandler"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CatchAllNonBPError"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CatchFaultInFaultHandler"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="ThrowInScopeInFaultHandler"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="CatchFaultInFaultHandler2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="ThrowInScopeInFaultHandler2"/>
- </antcall>
- <antcall target="jartest">
- <param name="jartest.num" value="BPInvokeDeadlock"/>
- </antcall>
- </target>
-</project>
+<project name="Build BPEL Jars" default="bpeltestsjar">
+ <description>
+ Build BPEL Jars.
+ </description>
+ <!-- =================================================================== -->
+ <!-- jartest -->
+ <!-- =================================================================== -->
+ <target name="jartest">
+ <jar destfile="${basedir}/test${jartest.num}/bpelTest${jartest.num}.jar">
+ <fileset dir="${basedir}/..">
+ <include name="bpelTests/probeService/*.wsdl"/>
+ <include name="bpelTests/test${jartest.num}/*.wsdl"/>
+ <include name="bpelTests/test${jartest.num}/*.bpel"/>
+ <include name="bpelTests/test${jartest.num}/*.xslt"/>
+ <include name="bpelTests/test${jartest.num}/*.xml"/>
+ <include name="bpelTests/test${jartest.num}/**/*.xsd"/>
+ </fileset>
+ </jar>
+ </target>
+ <!-- =================================================================== -->
+ <!-- jar up the tests -->
+ <!-- =================================================================== -->
+ <target name="bpeltestsjar">
+ <antcall target="jartest">
+ <param name="jartest.num" value="1"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="3"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="4"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="5"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="6"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="7"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="8"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="9"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="10"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="12"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="13"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="14"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="15"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="16"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="17"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="benchMark2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="benchMark3"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="benchMark4"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="BPChain"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="ThrowFaultOutsideOfBP"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="Timer1"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="Timer2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="Timer3"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="Terminate"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="FlowScopes"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="ScopedCorrelationSets"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CatchForcedTerminate"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="FaultInCompensationHandler"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="FaultInFaultHandler"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="TimerOnAlarmAtRootScope"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="FaultCompHandlerInInvoke"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="LoopedCompensation"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="OOBData"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="NSDeploy"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="GetVarData"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="LocalInvoke"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="LinkInSwitch"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="Qts377278"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="PartnerLinkAssign"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="NestedSplits"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="ReplyWithFault"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CorrlCmplx"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CorrlInvokeReply"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="GraftGraftChildren"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="LoopedCompensation2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="BuildDocWithNestedNS"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="SingleRuleInCompHandler"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CatchAllNonBPError"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CatchFaultInFaultHandler"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="ThrowInScopeInFaultHandler"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="CatchFaultInFaultHandler2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="ThrowInScopeInFaultHandler2"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="BPInvokeDeadlock"/>
+ </antcall>
+ <antcall target="jartest">
+ <param name="jartest.num" value="RelativeSchemaImports"/>
+ </antcall>
+ </target>
+</project>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/AccountTypes.xsd
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/AccountTypes.xsd?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/AccountTypes.xsd (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/account/AccountTypes.xsd Mon Jun 26 15:00:26 2006
@@ -0,0 +1,19 @@
+<xsd:schema
+ targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing:account"
+ xmlns:investor="urn:sybase:bpel:testRelativeImportsProcessing:investor"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:import namespace="urn:sybase:bpel:testRelativeImportsProcessing:investor"
+ location="../investor/Investor.xsd"/>
+
+
+ <xsd:complexType name="AccountType">
+ <xsd:sequence>
+ <xsd:element name="accountId" type="xsd:integer"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="balance" type="xsd:float"/>
+ <xsd:element name="investor" type="investor:InvestorType"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_1.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_1.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_1.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_1.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,14 @@
+# Test BPEL control flow objects
+# Both control flows are set to positive the loop indcator is set to minimum.
+# Expected result = Event Start Test1.1 -> root process splits into A and B -> process B completes -> process A completes -> processes A and B merge on process C -> merge into root process -> test switch statement -> case min: set loop iterations = 5 -> test loop iterations -> 2 -> 3 -> 4 -> 5 -> 6 -> test1Process complete
+
+# Note the prefix on the part name identifies the message type ( xml = xml data; str = string data )
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.1</requestID><requestText>Event Start TestRelativeImports.1</requestText><flowIndicators><indicatorOne>yes</indicatorOne><indicatorTwo>yes</indicatorTwo></flowIndicators><loopIndicator>min</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_2.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_2.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_2.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_2.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,14 @@
+# Test BPEL control flow objects
+# Control flow one is positive and control flow two is negative the loop indcator is set to minimum.
+# Expected result = Event Start TestRelativeImports.2 -> root process splits into A and B -> process B completes -> process A completes -> merge into root process -> test switch statement -> case min: set loop iterations = 5 -> test loop iterations -> 2 -> 3 -> 4 -> 5 -> 6 -> test1Process complete
+
+# Note the prefix on the part name identifies the message type ( xml = xml data; str = string data )
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.2</requestID><requestText>Event Start TestRelativeImports.2</requestText><flowIndicators><indicatorOne>yes</indicatorOne><indicatorTwo>no</indicatorTwo></flowIndicators><loopIndicator>min</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_3.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_3.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_3.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_3.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,14 @@
+# Test BPEL control flow objects
+# Control flow one is negative and control flow two is positive the loop indcator is set to minimum.
+# Expected result = Event Start TestRelativeImports.3 -> root process splits into A and B -> process B completes -> process A completes -> merge into root process -> test switch statement -> case min: set loop iterations = 5 -> test loop iterations -> 2 -> 3 -> 4 -> 5 -> 6 -> test1Process complete
+
+# Note the prefix on the part name identifies the message type ( xml = xml data; str = string data )
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.3</requestID><requestText>Event Start TestRelativeImports.3</requestText><flowIndicators><indicatorOne>no</indicatorOne><indicatorTwo>yes</indicatorTwo></flowIndicators><loopIndicator>min</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_4.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_4.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_4.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_4.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,14 @@
+# Test BPEL control flow objects
+# Both control flows are set to negative the loop indcator is set to minimum.
+# Expected result = Event Start TestRelativeImports.4 -> root process splits into A and B -> process B completes -> process A completes -> merge into root process -> test switch statement -> case min: set loop iterations = 5 -> test loop iterations -> 2 -> 3 -> 4 -> 5 -> 6 -> test1Process complete
+
+# Note the prefix on the part name identifies the message type ( xml = xml data; str = string data )
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.4</requestID><requestText>Event Start TestRelativeImports.4</requestText><flowIndicators><indicatorOne>no</indicatorOne><indicatorTwo>no</indicatorTwo></flowIndicators><loopIndicator>min</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_5.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_5.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_5.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_5.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,12 @@
+# Test BPEL control flow objects
+# Both control flows are set to positive the loop indcator is set to maximum.
+# Expected result = Event Start TestRelativeImports.5 -> root process splits into A and B -> process B completes -> process A completes -> processes A and B merge on process C -> merge into root process -> test switch statement -> case max: set loop iterations = 10 -> test loop iterations -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 11 -> test1Process complete
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.5</requestID><requestText>Event Start TestRelativeImports.5</requestText><flowIndicators><indicatorOne>yes</indicatorOne><indicatorTwo>yes</indicatorTwo></flowIndicators><loopIndicator>max</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_6.txt
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_6.txt?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_6.txt (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/data1_6.txt Mon Jun 26 15:00:26 2006
@@ -0,0 +1,14 @@
+# Test BPEL control flow objects
+# Both control flows are set to positive the loop indcator is set to default.
+# Expected result = Event Start TestRelativeImports.6 -> root process splits into A and B -> process B completes -> process A completes -> processes A and B merge on process C -> merge into root process -> test switch statement -> otherwise: set loop iterations = 0 -> test loop iterations -> test1Process complete
+
+# Note the prefix on the part name identifies the message type ( xml = xml data; str = string data )
+
+target.name.space=urn:sybase:bpel:testRelativeImportsProcessing
+port.type=testRelativeImportsPT
+operation=request
+
+part1=xml.requestMessageData
+
+xml.requestMessageData=<testMessage><requestID>Start TestRelativeImports.6</requestID><requestText>Event Start TestRelativeImports.6</requestText><flowIndicators><indicatorOne>yes</indicatorOne><indicatorTwo>yes</indicatorTwo></flowIndicators><loopIndicator>default</loopIndicator></testMessage>
+
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/Investor.xsd
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/Investor.xsd?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/Investor.xsd (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/investor/Investor.xsd Mon Jun 26 15:00:26 2006
@@ -0,0 +1,18 @@
+<xsd:schema
+ targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing:account"
+ xmlns:investor="urn:sybase:bpel:testRelativeImportsProcessing:investor"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:import namespace="urn:sybase:bpel:testRelativeImportsProcessing:investor"
+ location="../investor/Investor.xsd"/>
+
+
+ <xsd:complexType name="InvestorType">
+ <xsd:sequence>
+ <xsd:element name="investorId" type="xsd:integer"/>
+ <xsd:element name="firstName" type="xsd:string"/>
+ <xsd:element name="lastName" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.bpel
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.bpel?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.bpel (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.bpel Mon Jun 26 15:00:26 2006
@@ -0,0 +1,327 @@
+<process name="test1Process"
+ targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing"
+ xmlns:tns="urn:sybase:bpel:testRelativeImportsProcessing"
+ suppressJoinFailure="yes"
+ xmlns:prb="urn:sybase:bpel:testProbe"
+ xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+
+<!-- test control flow elements -->
+<!-- sequence -->
+<!-- flow ( links ) -->
+<!-- swith -->
+<!-- while -->
+
+ <partnerLinks>
+ <partnerLink name="request" partnerLinkType="tns:testRelativeImportsRequest" myRole="testRelativeImportsService"/>
+ <partnerLink name="probe" partnerLinkType="tns:probeRequest" partnerRole="probeService"/>
+ </partnerLinks>
+
+ <variables>
+ <variable name="request"
+ messageType="tns:requestMessage"/>
+ <variable name="probeInput"
+ messageType="prb:probeMessage"/>
+ <variable name="reply"
+ messageType="tns:replyMessage"/>
+ <variable name="internalState"
+ messageType="tns:internalProcessData"/>
+ </variables>
+
+ <sequence>
+ <flow>
+ <links>
+ <link name="receive-to-assign1"/>
+ <link name="assign1-to-probe1"/>
+ <link name="assign1-to-probe2"/>
+ <link name="probe1-to-probe3"/>
+ <link name="probe2-to-probe3"/>
+ </links>
+
+ <receive name="receive1" partnerLink="request"
+ portType="tns:testRelativeImportsPT"
+ operation="request" variable="request"
+ createInstance="yes">
+ <source linkName="receive-to-assign1"/>
+
+ </receive>
+
+
+ <!-- Copy input variables to internal accumulators -->
+ <!-- After the copy the process splits into two execution paths -->
+
+ <sequence>
+ <target linkName="receive-to-assign1"/>
+ <source linkName="assign1-to-probe1"/>
+ <source linkName="assign1-to-probe2"/>
+
+ <assign name="assign1">
+
+ <copy>
+ <from variable="request" part="requestMessageData" query="/testMessage/requestID"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ <copy>
+ <from variable="request" property="tns:testProbeData"/>
+ <to variable="probeInput" part="probeData"/>
+ </copy>
+ </assign>
+
+ <assign>
+ <copy>
+ <from expression="'root process splits into A and B'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe2" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+
+
+
+ <!-- probe1 outbound status is dependent on the request input testFlow1 -->
+
+ <sequence>
+ <target linkName="assign1-to-probe1"/>
+ <source linkName="probe1-to-probe3"
+ transitionCondition="getVariableProperty('request', 'tns:testFlow1') = 'yes'"/>
+
+ <assign>
+ <copy>
+ <from expression="'process A completes'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe3" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+
+ <!-- probe2 outbound status is dependent on the request input testFlow2 -->
+
+ <sequence>
+ <target linkName="assign1-to-probe2"/>
+ <source linkName="probe2-to-probe3"
+ transitionCondition="getVariableData('request', 'requestMessageData', '/testMessage/flowIndicators/indicatorTwo') = 'yes'"/>
+
+ <assign>
+ <copy>
+ <from expression="'process B completes'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe4" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+
+ <!-- The split execution path from assign1 joins on probe3 -->
+ <!-- Probe3 will only fire if the transition condition from probe1 and probe2 both evaluate to true -->
+
+ <sequence joinCondition="getLinkStatus('probe1-to-probe3') and getLinkStatus('probe2-to-probe3')">
+ <target linkName="probe1-to-probe3"/>
+ <target linkName="probe2-to-probe3"/>
+
+ <assign>
+ <copy>
+ <from expression="'processes A and B merge on process C'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe5" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+
+ </flow>
+
+ <assign>
+ <copy>
+ <from expression="'merge into root process'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe6" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+
+ <!-- from the input data loopIndicator set the number of loop interations -->
+
+ <assign>
+ <copy>
+ <from expression="'test switch statement'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe7" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ <switch>
+ <case condition="getVariableProperty('request', 'tns:loopInd') = 'min'">
+ <sequence>
+ <assign name="flow1-min-assign">
+ <copy>
+ <from expression="5"/>
+ <to variable="internalState" part="loop1"/>
+ </copy>
+ <copy>
+ <from expression="'case min: set loop iterations = 5'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+ <invoke name="probe8" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+ </sequence>
+ </case>
+ <case condition="getVariableData('request', 'requestMessageData', '/testMessage/loopIndicator') = 'max'">
+ <sequence>
+ <assign name="flow1-max-assign">
+ <copy>
+ <from expression="10"/>
+ <to variable="internalState" part="loop1"/>
+ </copy>
+ <copy>
+ <from expression="'case max: set loop iterations = 10'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+ <invoke name="probe9" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+ </case>
+ <otherwise>
+ <sequence>
+ <assign name="flow1-default-assign">
+ <copy>
+ <from expression="0"/>
+ <to variable="internalState" part="loop1"/>
+ </copy>
+ <copy>
+ <from expression="'otherwise: set loop iterations = 0'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+ <invoke name="probe10" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+ </otherwise>
+ </switch>
+
+ <assign name="while-increment-initialize">
+ <copy>
+ <from expression="0"/>
+ <to variable="internalState" part="loop1Counter"/>
+ </copy>
+ <copy>
+ <from expression="'test loop iterations'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe10" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ <while condition="getVariableData('internalState','loop1Counter') < getVariableData('internalState','loop1')">
+ <sequence>
+ <assign name="while-increment">
+ <copy>
+ <from expression="getVariableData('internalState','loop1Counter') + 1"/>
+ <to variable="internalState" part="loop1Counter"/>
+ </copy>
+ <copy>
+ <from expression="getVariableData('internalState','loop1Counter') + 1"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+ <invoke name="probe11" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ </sequence>
+ </while>
+
+ <!-- copy internal accumulators to the reply message -->
+
+ <assign>
+ <copy>
+ <from expression="'testRelativeImportsProcess complete'"/>
+ <to variable="probeInput" part="probeName"/>
+ </copy>
+ </assign>
+
+ <invoke name="probe12" partnerLink="probe"
+ portType="prb:probeMessagePT"
+ operation="probe"
+ inputVariable="probeInput"
+ outputVariable="probeInput">
+ </invoke>
+
+ <assign name="assign2">
+ <copy>
+ <from variable="probeInput" part="probeName"/>
+ <to variable="reply" part="replyID"/>
+ </copy>
+ <copy>
+ <from variable="probeInput" part="probeData"/>
+ <to variable="reply" part="replyText"/>
+ </copy>
+ </assign>
+
+ <reply name="reply" partnerLink="request" portType="tns:testRelativeImportsPT"
+ operation="request" variable="reply">
+ </reply>
+
+
+ </sequence>
+</process>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.wsdl?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.wsdl (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.wsdl Mon Jun 26 15:00:26 2006
@@ -0,0 +1,62 @@
+<!-- The public service interface for test1.bpel -->
+
+<definitions
+ targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing"
+ xmlns:tns="urn:sybase:bpel:testRelativeImportsProcessing"
+ xmlns:typens="urn:sybase:bpel:testRelativeImportsProcessing:types"
+ xmlns:prb="urn:sybase:bpel:testProbe"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+
+ <import namespace="urn:sybase:bpel:testRelativeImportsProcessing:types"
+ location="bpelTests/testRelativeSchemaImports/testSchema.xsd"/>
+ <import namespace="urn:sybase:bpel:testRelativeImportsProcessing"
+ location="bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl"/>
+ <import namespace="urn:sybase:bpel:testProbe"
+ location="bpelTests/probeService/probeService.wsdl"/>
+
+
+
+ <bpws:property name="testProbeData" type="xsd:string"/>
+ <bpws:propertyAlias propertyName="tns:testProbeData" messageType="tns:requestMessage" part="requestMessageData" query="/testMessage/requestText"/>
+
+ <bpws:property name="testFlow1" type="xsd:boolean"/>
+ <bpws:propertyAlias propertyName="tns:testFlow1" messageType="tns:requestMessage" part="requestMessageData" query="/testMessage/flowIndicators/indicatorOne"/>
+
+ <bpws:property name="loopInd" type="xsd:string"/>
+ <bpws:propertyAlias propertyName="tns:loopInd" messageType="tns:requestMessage" part="requestMessageData" query="/testMessage/loopIndicator"/>
+
+ <message name="requestMessage">
+ <part name="requestMessageData" type="typens:testMessage"/>
+ </message>
+
+ <message name="replyMessage">
+ <part name="replyID" type="xsd:string"/>
+ <part name="replyText" type="xsd:string"/>
+ </message>
+
+ <!-- portType supported by the test2 process -->
+
+ <portType name="testRelativeImportsPT">
+ <operation name="request">
+ <input message="requestMessage"/>
+ <output message="replyMessage"/>
+ </operation>
+ </portType>
+
+ <plnk:partnerLinkType name="testRelativeImportsRequest">
+ <plnk:role name="testRelativeImportsService">
+ <plnk:portType name="testRelativeImportsPT"/>
+ </plnk:role>
+ </plnk:partnerLinkType>
+
+ <plnk:partnerLinkType name="probeRequest">
+ <plnk:role name="probeService">
+ <plnk:portType name="prb:probeMessagePT"/>
+ </plnk:role>
+ </plnk:partnerLinkType>
+
+
+</definitions>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.xml
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.xml?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.xml (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImports.xml Mon Jun 26 15:00:26 2006
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<BPEBinding xmlns="http://ode.apache.org/bpe/binding/bpe" xmlns:prb="urn:sybase:bpel:testProbe">
+ <ActionBindings>
+ <binding name="BPEBinding1" nameSpace="urn:sybase:bpel:testProbe" portType="probeMessagePT">
+ <operation name="probe">
+ <action implementation="org.apache.ode.bpe.action.external.ProbeAction" prb:rootSourcePart="probeName" prb:targetPart="probeData"/>
+ </operation>
+ </binding>
+ </ActionBindings>
+</BPEBinding>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testRelativeImportsDefinitions.wsdl Mon Jun 26 15:00:26 2006
@@ -0,0 +1,15 @@
+<!-- The WSDL contains message definitions that are internal to the business -->
+<!-- process. ( i.e. counters, accumulators, bpe deployment mappings, etc ... ) -->
+
+
+<definitions targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing"
+ xmlns:tns="urn:sybase:bpel:testRelativeImportsProcessing"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <message name="internalProcessData">
+ <part name="loop1Counter" type="xsd:int"/>
+ <part name="loop1" type="xsd:int"/>
+ </message>
+
+</definitions>
Added: incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testSchema.xsd
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testSchema.xsd?rev=417301&view=auto
==============================================================================
--- incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testSchema.xsd (added)
+++ incubator/ode/scratch/bpe/bpelTests/testRelativeSchemaImports/testSchema.xsd Mon Jun 26 15:00:26 2006
@@ -0,0 +1,24 @@
+<xsd:schema
+ targetNamespace="urn:sybase:bpel:testRelativeImportsProcessing:types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:import namespace="urn:sybase:bpel:testRelativeImportsProcessing:account"
+ location="accounts/AccountTypes.xsd"/>
+
+ <xsd:complexType name="flowIndicator">
+ <xsd:sequence>
+ <xsd:element name="indicatorOne" type="xsd:boolean"/>
+ <xsd:element name="indicatorTwo" type="xsd:boolean"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="testMessage">
+ <xsd:sequence>
+ <xsd:element name="requestID" type="xsd:string"/>
+ <xsd:element name="requestText" type="xsd:string"/>
+ <xsd:element name="flowIndicators" type="typens:flowIndicator"/>
+ <xsd:element name="loopIndicator" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
Modified: incubator/ode/scratch/bpe/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELWSDLLocator.java
URL: http://svn.apache.org/viewvc/incubator/ode/scratch/bpe/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELWSDLLocator.java?rev=417301&r1=417300&r2=417301&view=diff
==============================================================================
--- incubator/ode/scratch/bpe/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELWSDLLocator.java (original)
+++ incubator/ode/scratch/bpe/src/main/java/org/apache/ode/bpe/deployment/bpel/BPELWSDLLocator.java Mon Jun 26 15:00:26 2006
@@ -1,112 +1,165 @@
-/*
- * Copyright 2006 The Apache Software Foundation.
- *
- * Licensed 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.
-*/
-/*
- * Created on May 14, 2003
- */
-package org.apache.ode.bpe.deployment.bpel;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.wsdl.xml.WSDLLocator;
-
-import org.xml.sax.InputSource;
-
-import org.apache.ode.bpe.lang.ResourceGetter;
-
-/**
- *
- * Imported WSDL documents are dereferenced by the WSDL API - JSR110. Because all linked WSDL
- * documents are found in a jar file a WSDLLocator is required to find documents stored in
- * an internal document hashmap. Supporting WSDL documents are pulled from the deployment
- * jar into an internal HashMap.
- *
- * @author waterman
- */
-class BPELWSDLLocator implements WSDLLocator {
-
- private static final Logger logger = Logger.getLogger(BPELWSDLLocator.class.getName());
-
- private InputSource m_source;
- private HashMap m_supportDoc;
- private String m_bpelURI;
- private String m_latestURI;
-
- BPELWSDLLocator(String bpelURI, InputSource source, HashMap supportDoc) {
- m_source = source;
- m_supportDoc = supportDoc;
- m_bpelURI = bpelURI;
- }
- /**
- * @see javax.wsdl.xml.WSDLLocator#getBaseInputSource()
- */
- public InputSource getBaseInputSource() {
- return m_source;
- }
-
- /**
- * @see javax.wsdl.xml.WSDLLocator#getBaseURI()
- */
- public String getBaseURI() {
- return m_bpelURI;
- }
-
- /**
- * @see javax.wsdl.xml.WSDLLocator#getImportInputSource(java.lang.String, java.lang.String)
- */
- public InputSource getImportInputSource(String arg0, String arg1) {
-
- // Strip away any prefix path. May need to come back and revisit this if
- // deployment package contains a heirarchy.
- //m_latestURI = arg1.substring(arg1.lastIndexOf("/")+1);
- m_latestURI = arg1;
-
- InputSource is = null;
-
- // lookup the document from the internal map collection
- byte[] data = (byte[])m_supportDoc.get(m_latestURI.toLowerCase());
-
- if ( data != null ) {
- try {
-
- // Create a SAX InputSource from the document byte array
- ByteArrayInputStream bais = new ByteArrayInputStream(data);
- is = new InputSource(bais);
- bais.close();
- } catch (IOException e) {
- logger.log(Level.SEVERE,ResourceGetter.getFormatted("BPEL_IOERR",new Object[] {arg0, m_latestURI.toLowerCase()}),e);
- }
- }
-
-
- if ( is == null ) {
- logger.log(Level.SEVERE,ResourceGetter.getFormatted("DEPLOY_WSDL_NOTFOUND",new Object[] {m_bpelURI,m_latestURI.toLowerCase()}));
- }
-
- return is;
- }
-
- /**
- * @see javax.wsdl.xml.WSDLLocator#getLatestImportURI()
- */
- public String getLatestImportURI() {
- return m_latestURI;
- }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+*/
+/*
+ * Created on May 14, 2003
+ */
+package org.apache.ode.bpe.deployment.bpel;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.wsdl.xml.WSDLLocator;
+
+import org.xml.sax.InputSource;
+
+import org.apache.ode.bpe.lang.ResourceGetter;
+
+/**
+ *
+ * Imported WSDL documents are dereferenced by the WSDL API - JSR110. Because all linked WSDL
+ * documents are found in a jar file a WSDLLocator is required to find documents stored in
+ * an internal document hashmap. Supporting WSDL documents are pulled from the deployment
+ * jar into an internal HashMap.
+ *
+ * @author waterman
+ */
+class BPELWSDLLocator implements WSDLLocator {
+
+ private static final Logger logger = Logger.getLogger(BPELWSDLLocator.class.getName());
+
+ private InputSource m_source;
+ private HashMap m_supportDoc;
+ private String m_bpelURI;
+ private String m_latestURI;
+
+ BPELWSDLLocator(String bpelURI, InputSource source, HashMap supportDoc) {
+ m_source = source;
+ m_supportDoc = supportDoc;
+ m_bpelURI = bpelURI;
+ }
+ /**
+ * @see javax.wsdl.xml.WSDLLocator#getBaseInputSource()
+ */
+ public InputSource getBaseInputSource() {
+ return m_source;
+ }
+
+ /**
+ * @see javax.wsdl.xml.WSDLLocator#getBaseURI()
+ */
+ public String getBaseURI() {
+ return m_bpelURI;
+ }
+
+ /**
+ * Calculate the absolute path with respect to the root of the main bpel file
+ * from a relative schema location given the parent location as an absolute
+ * path (without preceding /).
+ *
+ * @param parentLocation
+ * @param importLocation
+ * @return
+ */
+ private String getQualifiedImportPath(String parentLocation, String importLocation) {
+ // check to see if the import location is in the map
+ if (m_supportDoc.containsKey(importLocation.toLowerCase())) {
+ return importLocation;
+ }
+
+ // check to see if we have an absolute path
+ if (importLocation.startsWith("/")) {
+ return importLocation;
+ }
+
+ String path;
+
+ // remove the last component of the path
+ int index = parentLocation.lastIndexOf("/");
+ if (index == -1) {
+ return importLocation;
+ } else {
+ path = parentLocation.substring(0, index);
+ }
+
+ // split the path components on the import location for processing
+ String[] components = importLocation.split("/");
+ for (int i = 0; i < components.length; i++) {
+ if (components[i].equals(".")) {
+ continue;
+ } else if (components[i].equals("..")) {
+ index = path.lastIndexOf("/");
+ if (index == -1) {
+ path = "";
+ } else {
+ path = path.substring(0, index);
+ }
+ } else {
+ if (path.length() > 0) {
+ path = path + "/";
+ }
+ path = path + components[i];
+ }
+ }
+
+ logger.info("Relative path: " + path);
+
+ return path;
+ }
+
+ /**
+ * @see javax.wsdl.xml.WSDLLocator#getImportInputSource(java.lang.String, java.lang.String)
+ */
+ public InputSource getImportInputSource(String parentLocation, String importLocation) {
+ logger.info("parentLocation: " + parentLocation + " importLocation: " + importLocation);
+
+ m_latestURI = getQualifiedImportPath(parentLocation, importLocation);
+
+ InputSource is = null;
+
+ // lookup the document from the internal map collection
+ byte[] data = (byte[])m_supportDoc.get(m_latestURI.toLowerCase());
+
+ if ( data != null ) {
+ try {
+
+ // Create a SAX InputSource from the document byte array
+ ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ is = new InputSource(bais);
+ bais.close();
+ } catch (IOException e) {
+ logger.log(Level.SEVERE,ResourceGetter.getFormatted("BPEL_IOERR",new Object[] {parentLocation, m_latestURI.toLowerCase()}),e);
+ }
+ }
+
+
+ if ( is == null ) {
+ logger.log(Level.SEVERE,ResourceGetter.getFormatted("DEPLOY_WSDL_NOTFOUND",new Object[] {m_bpelURI,m_latestURI.toLowerCase()}));
+ }
+
+ return is;
+ }
+
+ /**
+ * @see javax.wsdl.xml.WSDLLocator#getLatestImportURI()
+ */
+ public String getLatestImportURI() {
+ return m_latestURI;
+ }
+
+}