riftsaw SVN: r1313 - in trunk/integration-tests: src/test/java/org/jboss/soa/bpel/tests/testcases and 4 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-24 07:06:08 -0500 (Thu, 24 Feb 2011)
New Revision: 1313
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw318TestCase.java
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.bpel
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.wsdl
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/deploy.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/build.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_request1.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_response1.xml
Modified:
trunk/integration-tests/build.xml
Log:
RIFTSAW-318 - test case to check for variable inline initialization.
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2011-02-24 11:47:25 UTC (rev 1312)
+++ trunk/integration-tests/build.xml 2011-02-24 12:06:08 UTC (rev 1313)
@@ -208,6 +208,7 @@
<ant antfile="src/test/resources/testcases/RiftSaw_299_peer/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_299_ws/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_312/build.xml" />
+ <ant antfile="src/test/resources/testcases/RiftSaw_318/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_326/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_345/build.xml" />
Added: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw318TestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw318TestCase.java (rev 0)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw318TestCase.java 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.testcases;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Test case for running the RiftSaw_318 testcase.
+ */
+public class RiftSaw318TestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "RiftSaw_318";
+
+ public RiftSaw318TestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(RiftSaw318TestCase.class,
+ TEST_NAME, "RiftSaw_318-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+ String result=sendSOAPMessage("hello_request1.xml",
+ "http://localhost:8080/RiftSaw_318WS");
+
+ result = processResult(result);
+
+ assertMessageFromFile(result, "hello_response1.xml");
+ }
+}
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.bpel
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.bpel (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.bpel 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,71 @@
+<!--
+ ~ 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.
+ -->
+<process name="HelloWorld"
+ targetNamespace="http://www.jboss.org/bpel/examples"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:tns="http://www.jboss.org/bpel/examples"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+
+ <import location="HelloWorld.wsdl"
+ namespace="http://www.jboss.org/bpel/examples/wsdl"
+ importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ <variable name="tagText" type="xsd:string">
+ <from>' World Init'</from>
+ </variable>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,$tagText)</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+</process>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.wsdl
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.wsdl (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/HelloWorld.wsdl 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,67 @@
+<?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.
+ -->
+<wsdl:definitions
+ targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://www.jboss.org/bpel/examples/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:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <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://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+ namespace="http://www.jboss.org/bpel/examples/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/RiftSaw_318WS"/>
+ </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: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/deploy.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/deploy.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/bpel/deploy.xml 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:bpl="http://www.jboss.org/bpel/examples"
+ xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/build.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/build.xml 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,30 @@
+<project name="RiftSaw_318" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="version" value="1" />
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="test.dir" value="${basedir}/src/test/resources/testcases/${ant.project.name}" />
+
+ <property name="sample.jar.name" value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <jar basedir="${test.dir}/bpel" destfile="${deploy.dir}/${ant.project.name}/${sample.jar.name}" />
+
+ <copy todir="${deploy.dir}/${ant.project.name}">
+ <fileset dir="${test.dir}/messages"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+</project>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_request1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_request1.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_request1.xml 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_response1.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_318/messages/hello_response1.xml 2011-02-24 12:06:08 UTC (rev 1313)
@@ -0,0 +1 @@
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:helloResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><TestPart>Hello World Init</TestPart></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
13 years, 10 months
riftsaw SVN: r1312 - in branches/ODE/RiftSaw-ODE-trunk: bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-24 06:47:25 -0500 (Thu, 24 Feb 2011)
New Revision: 1312
Added:
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java
Modified:
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java
branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
Log:
RIFTSAW-318. Reworked ODE-236 patch for ODE2 to work with ODE1.4.
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -153,7 +153,7 @@
__log.debug("Copy verified OK: " + ocopy);
}
- private OAssign.RValue compileFrom(From from, Object requestedResultType) {
+ public OAssign.RValue compileFrom(From from, Object requestedResultType) {
assert from != null;
try {
if (from.isExtensionVal()) {
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -65,6 +65,7 @@
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.compiler.bom.Expression11;
import org.apache.ode.bpel.compiler.bom.FaultHandler;
+import org.apache.ode.bpel.compiler.bom.From;
import org.apache.ode.bpel.compiler.bom.Import;
import org.apache.ode.bpel.compiler.bom.LinkSource;
import org.apache.ode.bpel.compiler.bom.LinkTarget;
@@ -1170,14 +1171,6 @@
try {
compile(oscope, src, new Runnable() {
public void run() {
- for (Variable var : src.getVariables()) {
- try {
- compile(var);
- } catch (CompilationException ce) {
- recoveredFromError(var, ce);
- }
- }
-
for (CorrelationSet cset : src.getCorrelationSetDecls()) {
try {
compile(cset);
@@ -1194,6 +1187,15 @@
}
}
+ // Changed order in case variable initialization based on partner link
+ for (Variable var : src.getVariables()) {
+ try {
+ compile(var);
+ } catch (CompilationException ce) {
+ recoveredFromError(var, ce);
+ }
+ }
+
if (!src.getEvents().isEmpty() || !src.getAlarms().isEmpty()) {
oscope.eventHandler = new OEventHandler(_oprocess);
oscope.eventHandler.debugInfo = createDebugInfo(src, "Event Handler for " + src);
@@ -1432,10 +1434,22 @@
}
OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
+
+ //madars.vitolins _at gmail.com 2009.03.25 Inline variable initialization
+ //reusing 'compileFrom()' from AssignGenerator
+ AssignGenerator agen = new AssignGenerator();
+ agen.setContext(this);
+
ovar.name = src.getName();
ovar.declaringScope = oscope;
ovar.debugInfo = createDebugInfo(src, null);
+ From varfromSpec=src.getFrom();
+ if (varfromSpec!=null)
+ ovar.from=agen.compileFrom(varfromSpec, varType);
+ else
+ ovar.from=null;
+
ovar.extVar = compileExtVar(src);
oscope.addLocalVariable(ovar);
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -113,4 +113,14 @@
public String getRelated() {
return getAttribute(ExtensibilityQNames.EXTVAR_RELATED, null);
}
+
+ /**
+ * Get the 'from' specification.
+ *
+ * @return the 'from' specification
+ */
+ public From getFrom() {
+ return getFirstChild(From.class);
+ }
+
}
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -22,6 +22,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -53,7 +54,12 @@
public OEventHandler eventHandler;
/** Variables declared within the scope. */
- public final HashMap<String,Variable> variables = new HashMap<String,Variable>();
+ /* madars.vitolins _at gmail.com 2009.04.11 Inline variable initialization
+ * We need LinkedHashMap because order of variables are significant!
+ * So that next variable can be initialized from previous (if previous is inline initialized)
+ * LinkedHashMap acts like HashMap but it keeps the order
+ */
+ public final LinkedHashMap<String,Variable> variables = new LinkedHashMap<String,Variable>();
/** OCorrelation sets declared within the scope. */
public final Map<String,CorrelationSet> correlationSets = new HashMap<String, CorrelationSet>();
@@ -177,6 +183,10 @@
/** If not-null indicates that this variable has an external representation. */
public OExtVar extVar;
+ //madars.vitolins _at gmail.com 2009.03.25
+ //Inline variable initialization
+ /** Handler of from-spec */
+ public OAssign.RValue from;
public Variable(OProcess owner, OVarType type) {
super(owner);
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -81,9 +81,11 @@
FaultData faultData = null;
- for (OAssign.Copy aCopy : oassign.copy) {
+ AssignHelper assignHelper = new AssignHelper(_self, _scopeFrame, _linkFrame);
+
+ for (OAssign.Copy aCopy : oassign.copy) {
try {
- copy(aCopy);
+ assignHelper.copy(aCopy);
} catch (FaultException fault) {
if (aCopy.ignoreMissingFromData) {
if (fault.getQName().equals(getOAsssign().getOwner().constants.qnSelectionFailure) &&
@@ -124,616 +126,4 @@
private OAssign getOAsssign() {
return (OAssign) _self.o;
}
-
- private Node evalLValue(OAssign.LValue to) throws FaultException, ExternalVariableModuleException {
- final BpelRuntimeContext napi = getBpelRuntimeContext();
- Node lval = null;
- if (!(to instanceof OAssign.PartnerLinkRef)) {
- VariableInstance lvar;
- try {
- lvar = _scopeFrame.resolve(to.getVariable());
- } catch (RuntimeException e) {
- __log.error("iid: " + getBpelRuntimeContext().getPid() + " error evaluating lvalue");
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, e.getMessage());
- }
- if (lvar == null) {
- String msg = __msgs.msgEvalException(to.toString(), "Could not resolve variable in current scope");
- if (__log.isDebugEnabled()) __log.debug(to + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
- if (!napi.isVariableInitialized(lvar)) {
- Document doc = DOMUtils.newDocument();
- Node val = to.getVariable().type.newInstance(doc);
- if (val.getNodeType() == Node.TEXT_NODE) {
- Element tempwrapper = doc.createElementNS(null, "temporary-simple-type-wrapper");
- doc.appendChild(tempwrapper);
- tempwrapper.appendChild(val);
- val = tempwrapper;
- } else doc.appendChild(val);
- // Only external variables need to be initialized, others are new and going to be overwtitten
- if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val);
- else lval = val;
- } else
- lval = fetchVariableData(lvar, true);
- }
- return lval;
- }
-
- /**
- * Get the r-value. There are several possibilities:
- * <ul>
- * <li>a message is selected - an element representing the whole message is
- * returned.</li>
- * <li>a (element) message part is selected - the element is returned.
- * </li>
- * <li>a (typed) message part is select - a wrapper element is returned.
- * </li>
- * <li>an attribute is selected - an attribute node is returned. </li>
- * <li>a text node/string expression is selected - a text node is returned.
- * </li>
- * </ul>
- *
- * @param from
- *
- * @return Either {@link Element}, {@link org.w3c.dom.Text}, or
- * {@link org.w3c.dom.Attr} node representing the r-value.
- *
- * @throws FaultException
- * DOCUMENTME
- * @throws UnsupportedOperationException
- * DOCUMENTME
- * @throws IllegalStateException
- * DOCUMENTME
- */
- private Node evalRValue(OAssign.RValue from) throws FaultException, ExternalVariableModuleException {
- if (__log.isDebugEnabled())
- __log.debug("Evaluating FROM expression \"" + from + "\".");
-
- Node retVal;
- if (from instanceof DirectRef) {
- OAssign.DirectRef dref = (OAssign.DirectRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(dref.variable));
- Node data = fetchVariableData(
- _scopeFrame.resolve(dref.variable), false);
- retVal = DOMUtils.findChildByName((Element)data, dref.elName);
- } else if (from instanceof OAssign.VariableRef) {
- OAssign.VariableRef varRef = (OAssign.VariableRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(varRef.variable));
- Node data = fetchVariableData(_scopeFrame.resolve(varRef.variable), false);
- retVal = evalQuery(data, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location, getEvaluationContext());
- } else if (from instanceof OAssign.PropertyRef) {
- OAssign.PropertyRef propRef = (OAssign.PropertyRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(propRef.variable));
- Node data = fetchVariableData(_scopeFrame.resolve(propRef.variable), false);
- retVal = evalQuery(data, propRef.propertyAlias.part,
- propRef.propertyAlias.location, getEvaluationContext());
- } else if (from instanceof OAssign.PartnerLinkRef) {
- OAssign.PartnerLinkRef pLinkRef = (OAssign.PartnerLinkRef) from;
- PartnerLinkInstance pLink = _scopeFrame.resolve(pLinkRef.partnerLink);
- Node tempVal =pLinkRef.isMyEndpointReference ?
- getBpelRuntimeContext().fetchMyRoleEndpointReferenceData(pLink)
- : getBpelRuntimeContext().fetchPartnerRoleEndpointReferenceData(pLink);
- if (__log.isDebugEnabled())
- __log.debug("RValue is a partner link, corresponding endpoint "
- + tempVal.getClass().getName() + " has value " + DOMUtils.domToString(tempVal));
- retVal = tempVal;
- } else if (from instanceof OAssign.Expression) {
- List<Node> l;
- OExpression expr = ((OAssign.Expression) from).expression;
- try {
- l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr, getEvaluationContext());
- } catch (EvaluationException e) {
- String msg = __msgs.msgEvalException(from.toString(), e.getMessage());
- if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
- if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
- if (l.size() == 0) {
- String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
- if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg, new Throwable("ignoreMissingFromData"));
- } else if (l.size() > 1) {
- String msg = __msgs.msgRValueMultipleNodesSelected(expr.toString());
- if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
- retVal = (Node) l.get(0);
- } else if (from instanceof OAssign.Literal) {
- String literal = ((OAssign.Literal) from).getXmlLiteral();
- Element literalRoot;
- try {
- literalRoot = DOMUtils.stringToDOM(literal);
- } catch (Exception e) {
- throw new RuntimeException("XML literal parsing failed " + literal, e);
- }
- assert literalRoot.getLocalName().equals("literal");
- // We'd like a single text node...
-
- literalRoot.normalize();
- retVal = literalRoot.getFirstChild();
-
- // Adjust for whitespace before an element.
- if (retVal != null && retVal.getNodeType() == Node.TEXT_NODE
- && retVal.getTextContent().trim().length() == 0
- && retVal.getNextSibling() != null) {
- retVal = retVal.getNextSibling();
- }
-
- if (retVal == null) {
- // Special case, no children --> empty TII
- retVal = literalRoot.getOwnerDocument().createTextNode("");
- } else if (retVal.getNodeType() == Node.ELEMENT_NODE) {
- // Make sure there is no more elements.
- Node x = retVal.getNextSibling();
- while (x != null) {
- if (x.getNodeType() == Node.ELEMENT_NODE) {
- String msg = __msgs.msgLiteralContainsMultipleEIIs();
- if (__log.isDebugEnabled())
- __log.debug(from + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
- msg);
-
- }
- x = x.getNextSibling();
- }
- } else if (retVal.getNodeType() == Node.TEXT_NODE) {
- // Make sure there are no elements following this text node.
- Node x = retVal.getNextSibling();
- while (x != null) {
- if (x.getNodeType() == Node.ELEMENT_NODE) {
- String msg = __msgs.msgLiteralContainsMixedContent();
- if (__log.isDebugEnabled())
- __log.debug(from + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
- msg);
-
- }
- x = x.getNextSibling();
- }
-
- }
-
- if (retVal == null) {
- String msg = __msgs.msgLiteralMustContainTIIorEII();
- if (__log.isDebugEnabled())
- __log.debug(from + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
- msg);
- }
- } else {
- String msg = __msgs
- .msgInternalError("Unknown RVALUE type: " + from);
- if (__log.isErrorEnabled())
- __log.error(from + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
-
- // Now verify we got something.
- if (retVal == null) {
- String msg = __msgs.msgEmptyRValue();
- if (__log.isDebugEnabled())
- __log.debug(from + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
-
- // Now check that we got the right thing.
- switch (retVal.getNodeType()) {
- case Node.TEXT_NODE:
- case Node.ATTRIBUTE_NODE:
- case Node.ELEMENT_NODE:
- case Node.CDATA_SECTION_NODE:
- break;
- default:
- String msg = __msgs.msgInvalidRValue();
- if (__log.isDebugEnabled())
- __log.debug(from + ": " + msg);
-
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
-
- }
-
- return retVal;
- }
-
- private void copy(OAssign.Copy ocopy) throws FaultException, ExternalVariableModuleException {
-
- if (__log.isDebugEnabled())
- __log.debug("Assign.copy(" + ocopy + ")");
-
- ScopeEvent se;
-
- // Check for message to message - copy, we can do this efficiently in
- // the database.
- if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
- .isMessageRef())
- || (ocopy.from instanceof VariableRef && ((VariableRef) ocopy.from)
- .isMessageRef())) {
-
- if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
- .isMessageRef())
- && ocopy.from instanceof VariableRef
- && ((VariableRef) ocopy.from).isMessageRef()) {
-
- final VariableInstance lval = _scopeFrame.resolve(ocopy.to
- .getVariable());
- final VariableInstance rval = _scopeFrame
- .resolve(((VariableRef) ocopy.from).getVariable());
- Element lvalue = (Element) fetchVariableData(rval, false);
- initializeVariable(lval, lvalue);
- se = new VariableModificationEvent(lval.declaration.name);
- ((VariableModificationEvent)se).setNewValue(lvalue);
- } else {
- // This really should have been caught by the compiler.
- __log
- .fatal("Message/Non-Message Assignment, should be caught by compiler:"
- + ocopy);
- throw new FaultException(
- ocopy.getOwner().constants.qnSelectionFailure,
- "Message/Non-Message Assignment: " + ocopy);
- }
- } else {
- // Conventional Assignment logic.
- Node rvalue = evalRValue(ocopy.from);
- Node lvalue = evalLValue(ocopy.to);
- if (__log.isDebugEnabled()) {
- __log.debug("lvalue after eval " + lvalue);
- if (lvalue != null) __log.debug("content " + DOMUtils.domToString(lvalue));
- }
-
- // Get a pointer within the lvalue.
- Node lvaluePtr = lvalue;
- boolean headerAssign = false;
- if (ocopy.to instanceof OAssign.DirectRef) {
- DirectRef dref = ((DirectRef) ocopy.to);
- Element el = DOMUtils.findChildByName((Element)lvalue, dref.elName);
- if (el == null) {
- el = (Element) ((Element)lvalue).appendChild(lvalue.getOwnerDocument()
- .createElementNS(dref.elName.getNamespaceURI(), dref.elName.getLocalPart()));
- }
- lvaluePtr = el;
- } else if (ocopy.to instanceof OAssign.VariableRef) {
- VariableRef varRef = ((VariableRef) ocopy.to);
- if (varRef.headerPart != null) headerAssign = true;
- lvaluePtr = evalQuery(lvalue, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location,
- new EvaluationContextProxy(varRef.getVariable(), lvalue));
- } else if (ocopy.to instanceof OAssign.PropertyRef) {
- PropertyRef propRef = ((PropertyRef) ocopy.to);
- lvaluePtr = evalQuery(lvalue, propRef.propertyAlias.part,
- propRef.propertyAlias.location,
- new EvaluationContextProxy(propRef.getVariable(),
- lvalue));
- } else if (ocopy.to instanceof OAssign.LValueExpression) {
- LValueExpression lexpr = (LValueExpression) ocopy.to;
- lexpr.setInsertMissingToData(ocopy.insertMissingToData);
- lvaluePtr = evalQuery(lvalue, null, lexpr.expression,
- new EvaluationContextProxy(lexpr.getVariable(), lvalue));
- if (__log.isDebugEnabled())
- __log.debug("lvaluePtr expr res " + lvaluePtr);
- }
-
- // For partner link assignmenent, the whole content is assigned.
- if (ocopy.to instanceof OAssign.PartnerLinkRef) {
- OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.to);
- PartnerLinkInstance plval = _scopeFrame
- .resolve(pLinkRef.partnerLink);
- replaceEndpointRefence(plval, rvalue);
- se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
- } else {
- // Sneakily converting the EPR if it's not the format expected by the lvalue
- if (ocopy.from instanceof OAssign.PartnerLinkRef) {
- rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
- if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
- rvalue = ((Document)rvalue).getDocumentElement();
- }
-
- Node parentNode = lvaluePtr.getParentNode();
- if (headerAssign && parentNode != null && "message".equals(parentNode.getNodeName()) && rvalue.getNodeType()==Node.ELEMENT_NODE ) {
- lvalue = copyInto((Element)lvalue, (Element) lvaluePtr, (Element) rvalue);
- } else if (rvalue.getNodeType() == Node.ELEMENT_NODE && lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
- lvalue = replaceElement((Element)lvalue, (Element) lvaluePtr, (Element) rvalue,
- ocopy.keepSrcElementName);
- } else {
- lvalue = replaceContent(lvalue, lvaluePtr, rvalue.getTextContent());
- }
- final VariableInstance lval = _scopeFrame.resolve(ocopy.to.getVariable());
- if (__log.isDebugEnabled())
- __log.debug("ASSIGN Writing variable '" + lval.declaration.name +
- "' value '" + DOMUtils.domToString(lvalue) +"'");
- commitChanges(lval, lvalue);
- se = new VariableModificationEvent(lval.declaration.name);
- ((VariableModificationEvent)se).setNewValue(lvalue);
- }
- }
-
- if (ocopy.debugInfo != null)
- se.setLineNo(ocopy.debugInfo.startLine);
- sendEvent(se);
- }
-
- @Override
- Node fetchVariableData(VariableInstance variable, boolean forWriting)
- throws FaultException {
- try {
- return super.fetchVariableData(variable, forWriting);
- } catch (FaultException fe) {
- if (forWriting) {
- fe = new FaultException(fe.getQName(), fe.getMessage(), new Throwable("throwUninitializedToVariable"));
- }
- throw fe;
- }
- }
-
- private void replaceEndpointRefence(PartnerLinkInstance plval, Node rvalue) throws FaultException {
- if (rvalue.getNodeType() == Node.ATTRIBUTE_NODE){
- rvalue = rvalue.getOwnerDocument().createTextNode(((Attr) rvalue).getValue());
- }
- // Eventually wrapping with service-ref element if we've been directly assigned some
- // value that isn't wrapped.
- if (rvalue.getNodeType() == Node.TEXT_NODE ||
- (rvalue.getNodeType() == Node.ELEMENT_NODE && !rvalue.getLocalName().equals("service-ref"))) {
- Document doc = DOMUtils.newDocument();
- Element serviceRef = doc.createElementNS(Namespaces.WSBPEL2_0_FINAL_SERVREF, "service-ref");
- doc.appendChild(serviceRef);
- serviceRef.appendChild(doc.importNode(rvalue, true));
- rvalue = serviceRef;
- }
-
- getBpelRuntimeContext().writeEndpointReference(plval, (Element)rvalue);
- }
-
- private Element replaceElement(Element lval, Element ptr, Element src,
- boolean keepSrcElement) {
- Document doc = ptr.getOwnerDocument();
- Node parent = ptr.getParentNode();
- if (keepSrcElement) {
- Element replacement = (Element)doc.importNode(src, true);
- parent.replaceChild(replacement, ptr);
- return (lval == ptr) ? replacement : lval;
- }
-
- Element replacement = doc.createElementNS(ptr.getNamespaceURI(), ptr.getTagName());
- NodeList nl = src.getChildNodes();
- for (int i = 0; i < nl.getLength(); ++i)
- replacement.appendChild(doc.importNode(nl.item(i), true));
- NamedNodeMap attrs = src.getAttributes();
- for (int i = 0; i < attrs.getLength(); ++i) {
- Attr attr = (Attr)attrs.item(i);
- if (!attr.getName().startsWith("xmlns")) {
- replacement.setAttributeNodeNS((Attr)doc.importNode(attrs.item(i), true));
- // Case of qualified attribute values, we're forced to add corresponding namespace declaration manually
- int colonIdx = attr.getValue().indexOf(":");
- if (colonIdx > 0) {
- String prefix = attr.getValue().substring(0, colonIdx);
- String attrValNs = src.lookupPrefix(prefix);
- if (attrValNs != null)
- replacement.setAttributeNS(DOMUtils.NS_URI_XMLNS, "xmlns:"+ prefix, attrValNs);
- }
- }
- }
- parent.replaceChild(replacement, ptr);
- DOMUtils.copyNSContext(ptr, replacement);
-
- return (lval == ptr) ? replacement : lval;
- }
-
- private Element copyInto(Element lval, Element ptr, Element src) {
- ptr.appendChild(ptr.getOwnerDocument().importNode(src, true));
- return lval;
- }
-
- /**
- * isInsert flag desginates this as an 'element' type insertion, which
- * requires insert the actual element value, rather than it's children
- *
- * @return
- * @throws FaultException
- */
- private Node replaceContent(Node lvalue, Node lvaluePtr, String rvalue)
- throws FaultException {
- Document d = lvaluePtr.getOwnerDocument();
-
- if (__log.isDebugEnabled()) {
- __log.debug("lvaluePtr type " + lvaluePtr.getNodeType());
- __log.debug("lvaluePtr " + DOMUtils.domToString(lvaluePtr));
- __log.debug("lvalue " + lvalue);
- __log.debug("rvalue " + rvalue);
- }
-
- switch (lvaluePtr.getNodeType()) {
- case Node.ELEMENT_NODE:
-
- // Remove all the children.
- while (lvaluePtr.hasChildNodes())
- lvaluePtr.removeChild(lvaluePtr.getFirstChild());
-
- // Append a new text node.
- lvaluePtr.appendChild(d.createTextNode(rvalue));
-
- // If lvalue is a text, removing all lvaluePtr children had just removed it
- // so we need to rebuild it as a child of lvaluePtr
- if (lvalue instanceof Text)
- lvalue = lvaluePtr.getFirstChild();
- break;
-
- case Node.TEXT_NODE:
-
- Node newval = d.createTextNode(rvalue);
- // Replace ourselves .
- lvaluePtr.getParentNode().replaceChild(newval, lvaluePtr);
-
- // A little kludge, let our caller know that the root element has changed.
- // (used for assignment to a simple typed variable)
- if (lvalue.getNodeType() == Node.ELEMENT_NODE) {
- // No children, adding an empty text children to point to
- if (lvalue.getFirstChild() == null) {
- Text txt = lvalue.getOwnerDocument().createTextNode("");
- lvalue.appendChild(txt);
- }
- if (lvalue.getFirstChild().getNodeType() == Node.TEXT_NODE)
- lvalue = lvalue.getFirstChild();
- }
- if (lvalue.getNodeType() == Node.TEXT_NODE && ((Text) lvalue).getWholeText().equals(
- ((Text) lvaluePtr).getWholeText()))
- lvalue = lvaluePtr = newval;
- break;
-
- case Node.ATTRIBUTE_NODE:
-
- ((Attr) lvaluePtr).setValue(rvalue);
- break;
-
- default:
- // This could occur if the expression language selects something
- // like
- // a PI or a CDATA.
- String msg = __msgs.msgInvalidLValue();
- if (__log.isDebugEnabled())
- __log.debug(lvaluePtr + ": " + msg);
- throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
- }
-
- return lvalue;
- }
-
- private Node evalQuery(Node data, OMessageVarType.Part part,
- OExpression expression, EvaluationContext ec) throws FaultException {
- assert data != null;
-
- if (part != null) {
- QName partName = new QName(null, part.name);
- Node qualLVal = DOMUtils.findChildByName((Element) data, partName);
- if (part.type instanceof OElementVarType) {
- QName elName = ((OElementVarType) part.type).elementType;
- qualLVal = DOMUtils.findChildByName((Element) qualLVal, elName);
- } else if (part.type == null) {
- // Special case of header parts never referenced in the WSDL def
- if (qualLVal != null && qualLVal.getNodeType() == Node.ELEMENT_NODE
- && ((Element)qualLVal).getAttribute("headerPart") != null
- && DOMUtils.getTextContent(qualLVal) == null)
- qualLVal = DOMUtils.getFirstChildElement((Element) qualLVal);
- // The needed part isn't there, dynamically creating it
- if (qualLVal == null) {
- qualLVal = data.getOwnerDocument().createElementNS(null, part.name);
- ((Element)qualLVal).setAttribute("headerPart", "true");
- data.appendChild(qualLVal);
- }
- }
- data = qualLVal;
- }
-
- if (expression != null) {
- // Neat little trick....
- try {
- data = ec.evaluateQuery(data, expression);
- } catch (EvaluationException e) {
- String msg = __msgs.msgEvalException(expression.toString(), e.getMessage());
- if (__log.isDebugEnabled()) __log.debug(expression + ": " + msg);
- if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
- throw new FaultException(getOAsssign().getOwner().constants.qnSubLanguageExecutionFault, msg);
- }
- }
-
- return data;
- }
-
- private class EvaluationContextProxy implements EvaluationContext {
-
- private Variable _var;
-
- private Node _varNode;
-
- private Node _rootNode;
-
- private EvaluationContext _ctx;
-
-
- private EvaluationContextProxy(Variable var, Node varNode) {
- _var = var;
- _varNode = varNode;
- _ctx = getEvaluationContext();
- }
-
- public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException {
- if (variable.name.equals(_var.name)) {
- if (part == null) return _varNode;
- return _ctx.getPartData((Element)_varNode, part);
-
- } else
- return _ctx.readVariable(variable, part);
-
- } /**
- * @see org.apache.ode.bpel.explang.EvaluationContext#readMessageProperty(org.apache.ode.bpel.o.OScope.Variable,
- * org.apache.ode.bpel.o.OProcess.OProperty)
- */
- public String readMessageProperty(Variable variable, OProperty property)
- throws FaultException {
- return _ctx.readMessageProperty(variable, property);
- }
-
- /**
- * @see org.apache.ode.bpel.explang.EvaluationContext#isLinkActive(org.apache.ode.bpel.o.OLink)
- */
- public boolean isLinkActive(OLink olink) throws FaultException {
- return _ctx.isLinkActive(olink);
- }
-
- /**
- * @see org.apache.ode.bpel.explang.EvaluationContext#getRootNode()
- */
- public Node getRootNode() {
- return _rootNode;
- }
-
- /**
- * @see org.apache.ode.bpel.explang.EvaluationContext#evaluateQuery(org.w3c.dom.Node,
- * org.apache.ode.bpel.o.OExpression)
- */
- public Node evaluateQuery(Node root, OExpression expr)
- throws FaultException {
- _rootNode = root;
- try {
- return getBpelRuntimeContext().getExpLangRuntime()
- .evaluateNode(expr, this);
- } catch (org.apache.ode.bpel.explang.EvaluationException e) {
- throw new InvalidProcessException("Expression Failed: " + expr,
- e);
- }
- }
-
- public Node getPartData(Element message, Part part) throws FaultException {
- return _ctx.getPartData(message,part);
- }
-
- public Long getProcessId() {
- return _ctx.getProcessId();
- }
-
- public boolean narrowTypes() {
- return false;
- }
-
- public URI getBaseResourceURI() {
- return _ctx.getBaseResourceURI();
- }
-
- public Node getPropertyValue(QName propertyName) {
- return _ctx.getPropertyValue(propertyName);
- }
-
- public QName getProcessQName() {
- return _ctx.getProcessQName();
- }
-
- public Date getCurrentEventDateTime() {
- return Calendar.getInstance().getTime();
- }
- }
-
}
Added: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java (rev 0)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -0,0 +1,805 @@
+/*
+ * 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.ode.bpel.runtime;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evt.PartnerLinkModificationEvent;
+import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.evt.VariableModificationEvent;
+import org.apache.ode.bpel.explang.EvaluationContext;
+import org.apache.ode.bpel.explang.EvaluationException;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OAssign;
+import org.apache.ode.bpel.o.OAssign.DirectRef;
+import org.apache.ode.bpel.o.OAssign.LValueExpression;
+import org.apache.ode.bpel.o.OAssign.PropertyRef;
+import org.apache.ode.bpel.o.OAssign.VariableRef;
+import org.apache.ode.bpel.o.OElementVarType;
+import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.o.OMessageVarType;
+import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.o.OProcess.OProperty;
+import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.Namespaces;
+import org.apache.ode.utils.msg.MessageBundle;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+import org.xml.sax.SAXException;
+
+import javax.xml.namespace.QName;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Assign activity run-time template.
+ */
+class AssignHelper extends ACTIVITY {
+ private static final long serialVersionUID = 1L;
+
+ private static final Log __log = LogFactory.getLog(AssignHelper.class);
+
+ private static final ASSIGNMessages __msgs = MessageBundle
+ .getMessages(ASSIGNMessages.class);
+
+ public AssignHelper(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
+ super(self, scopeFrame, linkFrame);
+ }
+
+ /**
+ * Initializes single variable by using it's 'from-spec'
+ * @param var
+ * @author madars.vitolins _at gmail.com, 2009.04.17
+ */
+ public void initVar(Variable var) throws FaultException,
+ ExternalVariableModuleException {
+ if (__log.isDebugEnabled())
+ __log.debug("Initializing variable [" + var.name + "]");
+
+ // Init variable from another variable
+ if (var.type instanceof OMessageVarType
+ && var.from instanceof OAssign.VariableRef
+ && ((OAssign.VariableRef) var.from).isMessageRef()) {
+ final VariableInstance lval = _scopeFrame.resolve(var);
+ final VariableInstance rval = _scopeFrame
+ .resolve(((OAssign.VariableRef) var.from).getVariable());
+ Element lvalue = (Element) fetchVariableData(rval, false);
+ initializeVariable(lval, lvalue);
+ } else {
+ Node rvalue = evalRValue(var.from);
+ Node lvalue = evalLValue(var);
+ // Dump r-value
+ if (__log.isDebugEnabled()) {
+ __log.debug("rvalue after eval " + rvalue);
+ if (rvalue != null)
+ __log.debug("content " + DOMUtils.domToString(rvalue));
+ }
+ // Dump l-value
+ if (__log.isDebugEnabled()) {
+ __log.debug("lvalue after eval " + rvalue);
+ if (lvalue != null)
+ __log.debug("content " + DOMUtils.domToString(lvalue));
+ }
+
+ Node lvaluePtr = lvalue;
+ // Sneakily converting the EPR if it's not the format expected by
+ // the lvalue
+ if (var.from instanceof OAssign.PartnerLinkRef) {
+ rvalue = getBpelRuntimeContext().convertEndpointReference(
+ (Element) rvalue, lvaluePtr);
+ if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
+ rvalue = ((Document) rvalue).getDocumentElement();
+ }
+
+ if (rvalue.getNodeType() == Node.ELEMENT_NODE
+ && lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
+ lvalue = replaceElement((Element) lvalue,
+ (Element) lvaluePtr, (Element) rvalue, true);
+ } else {
+ lvalue = replaceContent(lvalue, lvaluePtr, rvalue
+ .getTextContent());
+ }
+ final VariableInstance lval = _scopeFrame.resolve(var);
+ if (__log.isDebugEnabled())
+ __log.debug("SCOPE initialized variable '"
+ + lval.declaration.name + "' value '"
+ + DOMUtils.domToString(lvalue) + "'");
+
+ // Commit changes!
+ commitChanges(lval, lvalue);
+ }
+ }// initVar()
+
+ public void run() {
+ String errMsg="AssignHelper cannot be ran as ACTIVITY";
+ __log.error(errMsg);
+ _self.parent.failure(errMsg, null);
+ }
+
+ protected Log log() {
+ return __log;
+ }
+
+ private OActivity getOActivity() {
+ return (OActivity) _self.o;
+ }
+
+ private Node evalLValue(OAssign.LValue to) throws FaultException, ExternalVariableModuleException {
+ final BpelRuntimeContext napi = getBpelRuntimeContext();
+ Node lval = null;
+ if (!(to instanceof OAssign.PartnerLinkRef)) {
+ VariableInstance lvar;
+ try {
+ lvar = _scopeFrame.resolve(to.getVariable());
+ } catch (RuntimeException e) {
+ __log.error("iid: " + getBpelRuntimeContext().getPid() + " error evaluating lvalue");
+ throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, e.getMessage());
+ }
+ if (lvar == null) {
+ String msg = __msgs.msgEvalException(to.toString(), "Could not resolve variable in current scope");
+ if (__log.isDebugEnabled()) __log.debug(to + ": " + msg);
+ throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+ if (!napi.isVariableInitialized(lvar)) {
+ Document doc = DOMUtils.newDocument();
+ Node val = to.getVariable().type.newInstance(doc);
+ if (val.getNodeType() == Node.TEXT_NODE) {
+ Element tempwrapper = doc.createElementNS(null, "temporary-simple-type-wrapper");
+ doc.appendChild(tempwrapper);
+ tempwrapper.appendChild(val);
+ val = tempwrapper;
+ } else doc.appendChild(val);
+ // Only external variables need to be initialized, others are new and going to be overwtitten
+ if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val);
+ else lval = val;
+ } else
+ lval = fetchVariableData(lvar, true);
+ }
+ return lval;
+ }
+
+ /**
+ * Assumes that variable is variable not kind of partner links.
+ *
+ * @param var
+ * @return
+ * @throws FaultException
+ * @throws ExternalVariableModuleException
+ * @author madars.vitolins _at gmail.com
+ */
+ public Node evalLValue(Variable var) throws FaultException,
+ ExternalVariableModuleException {
+ final BpelRuntimeContext napi = getBpelRuntimeContext();
+ Node lval = null;
+ VariableInstance lvar = _scopeFrame.resolve(var);
+ if (!napi.isVariableInitialized(lvar)) {
+ Document doc = DOMUtils.newDocument();
+ Node val = var.type.newInstance(doc);
+ if (val.getNodeType() == Node.TEXT_NODE) {
+ Element tempwrapper = doc.createElementNS(null,
+ "temporary-simple-type-wrapper");
+ doc.appendChild(tempwrapper);
+ tempwrapper.appendChild(val);
+ val = tempwrapper;
+ } else
+ doc.appendChild(val);
+ // Only external variables need to be initialized, others are new
+ // and going to be overwritten
+ if (lvar.declaration.extVar != null)
+ lval = initializeVariable(lvar, val);
+ else
+ lval = val;
+ } else
+ lval = fetchVariableData(lvar, true);
+ return lval;
+ }
+
+ /**
+ * Get the r-value. There are several possibilities:
+ * <ul>
+ * <li>a message is selected - an element representing the whole message is
+ * returned.</li>
+ * <li>a (element) message part is selected - the element is returned.
+ * </li>
+ * <li>a (typed) message part is select - a wrapper element is returned.
+ * </li>
+ * <li>an attribute is selected - an attribute node is returned. </li>
+ * <li>a text node/string expression is selected - a text node is returned.
+ * </li>
+ * </ul>
+ *
+ * @param from
+ *
+ * @return Either {@link Element}, {@link org.w3c.dom.Text}, or
+ * {@link org.w3c.dom.Attr} node representing the r-value.
+ *
+ * @throws FaultException
+ * DOCUMENTME
+ * @throws UnsupportedOperationException
+ * DOCUMENTME
+ * @throws IllegalStateException
+ * DOCUMENTME
+ */
+ private Node evalRValue(OAssign.RValue from) throws FaultException, ExternalVariableModuleException {
+ if (__log.isDebugEnabled())
+ __log.debug("Evaluating FROM expression \"" + from + "\".");
+
+ Node retVal;
+ if (from instanceof DirectRef) {
+ OAssign.DirectRef dref = (OAssign.DirectRef) from;
+ sendVariableReadEvent(_scopeFrame.resolve(dref.variable));
+ Node data = fetchVariableData(
+ _scopeFrame.resolve(dref.variable), false);
+ retVal = DOMUtils.findChildByName((Element)data, dref.elName);
+ } else if (from instanceof OAssign.VariableRef) {
+ OAssign.VariableRef varRef = (OAssign.VariableRef) from;
+ sendVariableReadEvent(_scopeFrame.resolve(varRef.variable));
+ Node data = fetchVariableData(_scopeFrame.resolve(varRef.variable), false);
+ retVal = evalQuery(data, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location, getEvaluationContext());
+ } else if (from instanceof OAssign.PropertyRef) {
+ OAssign.PropertyRef propRef = (OAssign.PropertyRef) from;
+ sendVariableReadEvent(_scopeFrame.resolve(propRef.variable));
+ Node data = fetchVariableData(_scopeFrame.resolve(propRef.variable), false);
+ retVal = evalQuery(data, propRef.propertyAlias.part,
+ propRef.propertyAlias.location, getEvaluationContext());
+ } else if (from instanceof OAssign.PartnerLinkRef) {
+ OAssign.PartnerLinkRef pLinkRef = (OAssign.PartnerLinkRef) from;
+ PartnerLinkInstance pLink = _scopeFrame.resolve(pLinkRef.partnerLink);
+ Node tempVal =pLinkRef.isMyEndpointReference ?
+ getBpelRuntimeContext().fetchMyRoleEndpointReferenceData(pLink)
+ : getBpelRuntimeContext().fetchPartnerRoleEndpointReferenceData(pLink);
+ if (__log.isDebugEnabled())
+ __log.debug("RValue is a partner link, corresponding endpoint "
+ + tempVal.getClass().getName() + " has value " + DOMUtils.domToString(tempVal));
+ retVal = tempVal;
+ } else if (from instanceof OAssign.Expression) {
+ List<Node> l;
+ OExpression expr = ((OAssign.Expression) from).expression;
+ try {
+ l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr, getEvaluationContext());
+ } catch (EvaluationException e) {
+ String msg = __msgs.msgEvalException(from.toString(), e.getMessage());
+ if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
+ if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
+ throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+ if (l.size() == 0) {
+ String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
+ if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
+ throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, msg, new Throwable("ignoreMissingFromData"));
+ } else if (l.size() > 1) {
+ String msg = __msgs.msgRValueMultipleNodesSelected(expr.toString());
+ if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
+ throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+ retVal = (Node) l.get(0);
+ } else if (from instanceof OAssign.Literal) {
+ String literal = ((OAssign.Literal) from).getXmlLiteral();
+ Element literalRoot;
+ try {
+ literalRoot = DOMUtils.stringToDOM(literal);
+ } catch (Exception e) {
+ throw new RuntimeException("XML literal parsing failed " + literal, e);
+ }
+ assert literalRoot.getLocalName().equals("literal");
+ // We'd like a single text node...
+
+ literalRoot.normalize();
+ retVal = literalRoot.getFirstChild();
+
+ // Adjust for whitespace before an element.
+ if (retVal != null && retVal.getNodeType() == Node.TEXT_NODE
+ && retVal.getTextContent().trim().length() == 0
+ && retVal.getNextSibling() != null) {
+ retVal = retVal.getNextSibling();
+ }
+
+ if (retVal == null) {
+ // Special case, no children --> empty TII
+ retVal = literalRoot.getOwnerDocument().createTextNode("");
+ } else if (retVal.getNodeType() == Node.ELEMENT_NODE) {
+ // Make sure there is no more elements.
+ Node x = retVal.getNextSibling();
+ while (x != null) {
+ if (x.getNodeType() == Node.ELEMENT_NODE) {
+ String msg = __msgs.msgLiteralContainsMultipleEIIs();
+ if (__log.isDebugEnabled())
+ __log.debug(from + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure,
+ msg);
+
+ }
+ x = x.getNextSibling();
+ }
+ } else if (retVal.getNodeType() == Node.TEXT_NODE) {
+ // Make sure there are no elements following this text node.
+ Node x = retVal.getNextSibling();
+ while (x != null) {
+ if (x.getNodeType() == Node.ELEMENT_NODE) {
+ String msg = __msgs.msgLiteralContainsMixedContent();
+ if (__log.isDebugEnabled())
+ __log.debug(from + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure,
+ msg);
+
+ }
+ x = x.getNextSibling();
+ }
+
+ }
+
+ if (retVal == null) {
+ String msg = __msgs.msgLiteralMustContainTIIorEII();
+ if (__log.isDebugEnabled())
+ __log.debug(from + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure,
+ msg);
+ }
+ } else {
+ String msg = __msgs
+ .msgInternalError("Unknown RVALUE type: " + from);
+ if (__log.isErrorEnabled())
+ __log.error(from + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+
+ // Now verify we got something.
+ if (retVal == null) {
+ String msg = __msgs.msgEmptyRValue();
+ if (__log.isDebugEnabled())
+ __log.debug(from + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+
+ // Now check that we got the right thing.
+ switch (retVal.getNodeType()) {
+ case Node.TEXT_NODE:
+ case Node.ATTRIBUTE_NODE:
+ case Node.ELEMENT_NODE:
+ case Node.CDATA_SECTION_NODE:
+ break;
+ default:
+ String msg = __msgs.msgInvalidRValue();
+ if (__log.isDebugEnabled())
+ __log.debug(from + ": " + msg);
+
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure, msg);
+
+ }
+
+ return retVal;
+ }
+
+ protected void copy(OAssign.Copy ocopy) throws FaultException, ExternalVariableModuleException {
+
+ if (__log.isDebugEnabled())
+ __log.debug("Assign.copy(" + ocopy + ")");
+
+ ScopeEvent se;
+
+ // Check for message to message - copy, we can do this efficiently in
+ // the database.
+ if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+ .isMessageRef())
+ || (ocopy.from instanceof VariableRef && ((VariableRef) ocopy.from)
+ .isMessageRef())) {
+
+ if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+ .isMessageRef())
+ && ocopy.from instanceof VariableRef
+ && ((VariableRef) ocopy.from).isMessageRef()) {
+
+ final VariableInstance lval = _scopeFrame.resolve(ocopy.to
+ .getVariable());
+ final VariableInstance rval = _scopeFrame
+ .resolve(((VariableRef) ocopy.from).getVariable());
+ Element lvalue = (Element) fetchVariableData(rval, false);
+ initializeVariable(lval, lvalue);
+ se = new VariableModificationEvent(lval.declaration.name);
+ ((VariableModificationEvent)se).setNewValue(lvalue);
+ } else {
+ // This really should have been caught by the compiler.
+ __log
+ .fatal("Message/Non-Message Assignment, should be caught by compiler:"
+ + ocopy);
+ throw new FaultException(
+ ocopy.getOwner().constants.qnSelectionFailure,
+ "Message/Non-Message Assignment: " + ocopy);
+ }
+ } else {
+ // Conventional Assignment logic.
+ Node rvalue = evalRValue(ocopy.from);
+ Node lvalue = evalLValue(ocopy.to);
+ if (__log.isDebugEnabled()) {
+ __log.debug("lvalue after eval " + lvalue);
+ if (lvalue != null) __log.debug("content " + DOMUtils.domToString(lvalue));
+ }
+
+ // Get a pointer within the lvalue.
+ Node lvaluePtr = lvalue;
+ boolean headerAssign = false;
+ if (ocopy.to instanceof OAssign.DirectRef) {
+ DirectRef dref = ((DirectRef) ocopy.to);
+ Element el = DOMUtils.findChildByName((Element)lvalue, dref.elName);
+ if (el == null) {
+ el = (Element) ((Element)lvalue).appendChild(lvalue.getOwnerDocument()
+ .createElementNS(dref.elName.getNamespaceURI(), dref.elName.getLocalPart()));
+ }
+ lvaluePtr = el;
+ } else if (ocopy.to instanceof OAssign.VariableRef) {
+ VariableRef varRef = ((VariableRef) ocopy.to);
+ if (varRef.headerPart != null) headerAssign = true;
+ lvaluePtr = evalQuery(lvalue, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location,
+ new EvaluationContextProxy(varRef.getVariable(), lvalue));
+ } else if (ocopy.to instanceof OAssign.PropertyRef) {
+ PropertyRef propRef = ((PropertyRef) ocopy.to);
+ lvaluePtr = evalQuery(lvalue, propRef.propertyAlias.part,
+ propRef.propertyAlias.location,
+ new EvaluationContextProxy(propRef.getVariable(),
+ lvalue));
+ } else if (ocopy.to instanceof OAssign.LValueExpression) {
+ LValueExpression lexpr = (LValueExpression) ocopy.to;
+ lexpr.setInsertMissingToData(ocopy.insertMissingToData);
+ lvaluePtr = evalQuery(lvalue, null, lexpr.expression,
+ new EvaluationContextProxy(lexpr.getVariable(), lvalue));
+ if (__log.isDebugEnabled())
+ __log.debug("lvaluePtr expr res " + lvaluePtr);
+ }
+
+ // For partner link assignmenent, the whole content is assigned.
+ if (ocopy.to instanceof OAssign.PartnerLinkRef) {
+ OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.to);
+ PartnerLinkInstance plval = _scopeFrame
+ .resolve(pLinkRef.partnerLink);
+ replaceEndpointRefence(plval, rvalue);
+ se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
+ } else {
+ // Sneakily converting the EPR if it's not the format expected by the lvalue
+ if (ocopy.from instanceof OAssign.PartnerLinkRef) {
+ rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
+ if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
+ rvalue = ((Document)rvalue).getDocumentElement();
+ }
+
+ Node parentNode = lvaluePtr.getParentNode();
+ if (headerAssign && parentNode != null && "message".equals(parentNode.getNodeName()) && rvalue.getNodeType()==Node.ELEMENT_NODE ) {
+ lvalue = copyInto((Element)lvalue, (Element) lvaluePtr, (Element) rvalue);
+ } else if (rvalue.getNodeType() == Node.ELEMENT_NODE && lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
+ lvalue = replaceElement((Element)lvalue, (Element) lvaluePtr, (Element) rvalue,
+ ocopy.keepSrcElementName);
+ } else {
+ lvalue = replaceContent(lvalue, lvaluePtr, rvalue.getTextContent());
+ }
+ final VariableInstance lval = _scopeFrame.resolve(ocopy.to.getVariable());
+ if (__log.isDebugEnabled())
+ __log.debug("ASSIGN Writing variable '" + lval.declaration.name +
+ "' value '" + DOMUtils.domToString(lvalue) +"'");
+ commitChanges(lval, lvalue);
+ se = new VariableModificationEvent(lval.declaration.name);
+ ((VariableModificationEvent)se).setNewValue(lvalue);
+ }
+ }
+
+ if (ocopy.debugInfo != null)
+ se.setLineNo(ocopy.debugInfo.startLine);
+ sendEvent(se);
+ }
+
+ @Override
+ Node fetchVariableData(VariableInstance variable, boolean forWriting)
+ throws FaultException {
+ try {
+ return super.fetchVariableData(variable, forWriting);
+ } catch (FaultException fe) {
+ if (forWriting) {
+ fe = new FaultException(fe.getQName(), fe.getMessage(), new Throwable("throwUninitializedToVariable"));
+ }
+ throw fe;
+ }
+ }
+
+ private void replaceEndpointRefence(PartnerLinkInstance plval, Node rvalue) throws FaultException {
+ if (rvalue.getNodeType() == Node.ATTRIBUTE_NODE){
+ rvalue = rvalue.getOwnerDocument().createTextNode(((Attr) rvalue).getValue());
+ }
+ // Eventually wrapping with service-ref element if we've been directly assigned some
+ // value that isn't wrapped.
+ if (rvalue.getNodeType() == Node.TEXT_NODE ||
+ (rvalue.getNodeType() == Node.ELEMENT_NODE && !rvalue.getLocalName().equals("service-ref"))) {
+ Document doc = DOMUtils.newDocument();
+ Element serviceRef = doc.createElementNS(Namespaces.WSBPEL2_0_FINAL_SERVREF, "service-ref");
+ doc.appendChild(serviceRef);
+ serviceRef.appendChild(doc.importNode(rvalue, true));
+ rvalue = serviceRef;
+ }
+
+ getBpelRuntimeContext().writeEndpointReference(plval, (Element)rvalue);
+ }
+
+ private Element replaceElement(Element lval, Element ptr, Element src,
+ boolean keepSrcElement) {
+ Document doc = ptr.getOwnerDocument();
+ Node parent = ptr.getParentNode();
+ if (keepSrcElement) {
+ Element replacement = (Element)doc.importNode(src, true);
+ parent.replaceChild(replacement, ptr);
+ return (lval == ptr) ? replacement : lval;
+ }
+
+ Element replacement = doc.createElementNS(ptr.getNamespaceURI(), ptr.getTagName());
+ NodeList nl = src.getChildNodes();
+ for (int i = 0; i < nl.getLength(); ++i)
+ replacement.appendChild(doc.importNode(nl.item(i), true));
+ NamedNodeMap attrs = src.getAttributes();
+ for (int i = 0; i < attrs.getLength(); ++i) {
+ Attr attr = (Attr)attrs.item(i);
+ if (!attr.getName().startsWith("xmlns")) {
+ replacement.setAttributeNodeNS((Attr)doc.importNode(attrs.item(i), true));
+ // Case of qualified attribute values, we're forced to add corresponding namespace declaration manually
+ int colonIdx = attr.getValue().indexOf(":");
+ if (colonIdx > 0) {
+ String prefix = attr.getValue().substring(0, colonIdx);
+ String attrValNs = src.lookupPrefix(prefix);
+ if (attrValNs != null)
+ replacement.setAttributeNS(DOMUtils.NS_URI_XMLNS, "xmlns:"+ prefix, attrValNs);
+ }
+ }
+ }
+ parent.replaceChild(replacement, ptr);
+ DOMUtils.copyNSContext(ptr, replacement);
+
+ return (lval == ptr) ? replacement : lval;
+ }
+
+ private Element copyInto(Element lval, Element ptr, Element src) {
+ ptr.appendChild(ptr.getOwnerDocument().importNode(src, true));
+ return lval;
+ }
+
+ /**
+ * isInsert flag desginates this as an 'element' type insertion, which
+ * requires insert the actual element value, rather than it's children
+ *
+ * @return
+ * @throws FaultException
+ */
+ private Node replaceContent(Node lvalue, Node lvaluePtr, String rvalue)
+ throws FaultException {
+ Document d = lvaluePtr.getOwnerDocument();
+
+ if (__log.isDebugEnabled()) {
+ __log.debug("lvaluePtr type " + lvaluePtr.getNodeType());
+ __log.debug("lvaluePtr " + DOMUtils.domToString(lvaluePtr));
+ __log.debug("lvalue " + lvalue);
+ __log.debug("rvalue " + rvalue);
+ }
+
+ switch (lvaluePtr.getNodeType()) {
+ case Node.ELEMENT_NODE:
+
+ // Remove all the children.
+ while (lvaluePtr.hasChildNodes())
+ lvaluePtr.removeChild(lvaluePtr.getFirstChild());
+
+ // Append a new text node.
+ lvaluePtr.appendChild(d.createTextNode(rvalue));
+
+ // If lvalue is a text, removing all lvaluePtr children had just removed it
+ // so we need to rebuild it as a child of lvaluePtr
+ if (lvalue instanceof Text)
+ lvalue = lvaluePtr.getFirstChild();
+ break;
+
+ case Node.TEXT_NODE:
+
+ Node newval = d.createTextNode(rvalue);
+ // Replace ourselves .
+ lvaluePtr.getParentNode().replaceChild(newval, lvaluePtr);
+
+ // A little kludge, let our caller know that the root element has changed.
+ // (used for assignment to a simple typed variable)
+ if (lvalue.getNodeType() == Node.ELEMENT_NODE) {
+ // No children, adding an empty text children to point to
+ if (lvalue.getFirstChild() == null) {
+ Text txt = lvalue.getOwnerDocument().createTextNode("");
+ lvalue.appendChild(txt);
+ }
+ if (lvalue.getFirstChild().getNodeType() == Node.TEXT_NODE)
+ lvalue = lvalue.getFirstChild();
+ }
+ if (lvalue.getNodeType() == Node.TEXT_NODE && ((Text) lvalue).getWholeText().equals(
+ ((Text) lvaluePtr).getWholeText()))
+ lvalue = lvaluePtr = newval;
+ break;
+
+ case Node.ATTRIBUTE_NODE:
+
+ ((Attr) lvaluePtr).setValue(rvalue);
+ break;
+
+ default:
+ // This could occur if the expression language selects something
+ // like
+ // a PI or a CDATA.
+ String msg = __msgs.msgInvalidLValue();
+ if (__log.isDebugEnabled())
+ __log.debug(lvaluePtr + ": " + msg);
+ throw new FaultException(
+ getOActivity().getOwner().constants.qnSelectionFailure, msg);
+ }
+
+ return lvalue;
+ }
+
+ private Node evalQuery(Node data, OMessageVarType.Part part,
+ OExpression expression, EvaluationContext ec) throws FaultException {
+ assert data != null;
+
+ if (part != null) {
+ QName partName = new QName(null, part.name);
+ Node qualLVal = DOMUtils.findChildByName((Element) data, partName);
+ if (part.type instanceof OElementVarType) {
+ QName elName = ((OElementVarType) part.type).elementType;
+ qualLVal = DOMUtils.findChildByName((Element) qualLVal, elName);
+ } else if (part.type == null) {
+ // Special case of header parts never referenced in the WSDL def
+ if (qualLVal != null && qualLVal.getNodeType() == Node.ELEMENT_NODE
+ && ((Element)qualLVal).getAttribute("headerPart") != null
+ && DOMUtils.getTextContent(qualLVal) == null)
+ qualLVal = DOMUtils.getFirstChildElement((Element) qualLVal);
+ // The needed part isn't there, dynamically creating it
+ if (qualLVal == null) {
+ qualLVal = data.getOwnerDocument().createElementNS(null, part.name);
+ ((Element)qualLVal).setAttribute("headerPart", "true");
+ data.appendChild(qualLVal);
+ }
+ }
+ data = qualLVal;
+ }
+
+ if (expression != null) {
+ // Neat little trick....
+ try {
+ data = ec.evaluateQuery(data, expression);
+ } catch (EvaluationException e) {
+ String msg = __msgs.msgEvalException(expression.toString(), e.getMessage());
+ if (__log.isDebugEnabled()) __log.debug(expression + ": " + msg);
+ if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
+ throw new FaultException(getOActivity().getOwner().constants.qnSubLanguageExecutionFault, msg);
+ }
+ }
+
+ return data;
+ }
+
+ private class EvaluationContextProxy implements EvaluationContext {
+
+ private Variable _var;
+
+ private Node _varNode;
+
+ private Node _rootNode;
+
+ private EvaluationContext _ctx;
+
+
+ private EvaluationContextProxy(Variable var, Node varNode) {
+ _var = var;
+ _varNode = varNode;
+ _ctx = getEvaluationContext();
+ }
+
+ public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException {
+ if (variable.name.equals(_var.name)) {
+ if (part == null) return _varNode;
+ return _ctx.getPartData((Element)_varNode, part);
+
+ } else
+ return _ctx.readVariable(variable, part);
+
+ } /**
+ * @see org.apache.ode.bpel.explang.EvaluationContext#readMessageProperty(org.apache.ode.bpel.o.OScope.Variable,
+ * org.apache.ode.bpel.o.OProcess.OProperty)
+ */
+ public String readMessageProperty(Variable variable, OProperty property)
+ throws FaultException {
+ return _ctx.readMessageProperty(variable, property);
+ }
+
+ /**
+ * @see org.apache.ode.bpel.explang.EvaluationContext#isLinkActive(org.apache.ode.bpel.o.OLink)
+ */
+ public boolean isLinkActive(OLink olink) throws FaultException {
+ return _ctx.isLinkActive(olink);
+ }
+
+ /**
+ * @see org.apache.ode.bpel.explang.EvaluationContext#getRootNode()
+ */
+ public Node getRootNode() {
+ return _rootNode;
+ }
+
+ /**
+ * @see org.apache.ode.bpel.explang.EvaluationContext#evaluateQuery(org.w3c.dom.Node,
+ * org.apache.ode.bpel.o.OExpression)
+ */
+ public Node evaluateQuery(Node root, OExpression expr)
+ throws FaultException {
+ _rootNode = root;
+ try {
+ return getBpelRuntimeContext().getExpLangRuntime()
+ .evaluateNode(expr, this);
+ } catch (org.apache.ode.bpel.explang.EvaluationException e) {
+ throw new InvalidProcessException("Expression Failed: " + expr,
+ e);
+ }
+ }
+
+ public Node getPartData(Element message, Part part) throws FaultException {
+ return _ctx.getPartData(message,part);
+ }
+
+ public Long getProcessId() {
+ return _ctx.getProcessId();
+ }
+
+ public boolean narrowTypes() {
+ return false;
+ }
+
+ public URI getBaseResourceURI() {
+ return _ctx.getBaseResourceURI();
+ }
+
+ public Node getPropertyValue(QName propertyName) {
+ return _ctx.getPropertyValue(propertyName);
+ }
+
+ public QName getProcessQName() {
+ return _ctx.getProcessQName();
+ }
+
+ public Date getCurrentEventDateTime() {
+ return Calendar.getInstance().getTime();
+ }
+ }
+
+}
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-23 11:30:49 UTC (rev 1311)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-24 11:47:25 UTC (rev 1312)
@@ -54,6 +54,8 @@
import org.apache.ode.jacob.ChannelListener;
import org.apache.ode.jacob.SynchChannel;
import org.w3c.dom.Element;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
/**
* An active scope.
@@ -72,8 +74,38 @@
super(self, frame, linkFrame);
_oscope = (OScope) self.o;
assert _oscope.activity != null;
+
+ // madars.vitolins _at gmail.com 2009.03.29
+ // inline variable initialization
+ // Initialize variables at scope creation
+ try{
+ initVars();
+ } catch (ExternalVariableModuleException e) {
+ __log.error("Exception while doing inline external variable initialization", e);
+ _self.parent.failure(e.toString(), null);
+ return;
+ } catch (FaultException e){
+ __log.error("Exception while doing inline variable initialization", e);
+ _self.parent.failure(e.toString(), null);
+ }
}
+ /**
+ * Initialize variables (at inline)
+ * It processes all scope's variables
+ * @author madars.vitolins _at gmail.com, 2009.03.28
+ */
+ private void initVars() throws FaultException,
+ ExternalVariableModuleException {
+ AssignHelper assignHelper = new AssignHelper(_self, _scopeFrame, _linkFrame);
+ for (OScope.Variable var : _oscope.variables.values()) {
+
+ if (var != null && var.from != null) {
+ assignHelper.initVar(var);
+ }// if var..
+ }// for (OScope
+ }
+
public void run() {
// Start the child activity.
13 years, 10 months
riftsaw SVN: r1311 - in trunk: integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples and 6 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-23 06:30:49 -0500 (Wed, 23 Feb 2011)
New Revision: 1311
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw345TestCase.java
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.bpel
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.wsdl
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/deploy.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/build.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_request1.xml
trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_response1.xml
Removed:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/atm/
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/purchase/
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/travel/
trunk/samples/tutorial/atm/
trunk/samples/tutorial/purchase/
trunk/samples/tutorial/travel_agency/
Modified:
trunk/integration-tests/build.xml
trunk/integration-tests/pom.xml
Log:
Removed jBPM3 BPEL examples, as never fully working, and added testcase for RIFTSAW-345
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2011-02-22 14:46:49 UTC (rev 1310)
+++ trunk/integration-tests/build.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -196,12 +196,6 @@
<ant antfile="src/test/resources/samples/Quickstart_bpel_simple_pick/build.xml" />
<ant antfile="src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml" />
- <ant antfile="src/test/resources/samples/Tutorial_bpel_atm/build.xml" />
- <!--
- <ant antfile="src/test/resources/samples/Tutorial_bpel_purchase/build.xml" />
- -->
- <ant antfile="src/test/resources/samples/Tutorial_bpel_travel_agency/build.xml" />
-
<ant antfile="src/test/resources/testcases/RiftSaw_118/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_154/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_163/build.xml" />
@@ -215,6 +209,7 @@
<ant antfile="src/test/resources/testcases/RiftSaw_299_ws/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_312/build.xml" />
<ant antfile="src/test/resources/testcases/RiftSaw_326/build.xml" />
+ <ant antfile="src/test/resources/testcases/RiftSaw_345/build.xml" />
<ant antfile="src/test/resources/management/RiftSaw_238/build.xml" />
Modified: trunk/integration-tests/pom.xml
===================================================================
--- trunk/integration-tests/pom.xml 2011-02-22 14:46:49 UTC (rev 1310)
+++ trunk/integration-tests/pom.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -592,12 +592,6 @@
<include>**/*TestCase.java</include>
<include>**/*Test.java</include>
</includes>
- <!-- https://jira.jboss.org/jira/browse/RIFTSAW-34 -->
- <excludes>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java</exclude>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java</exclude>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java</exclude>
- </excludes>
</configuration>
<executions>
<execution>
@@ -665,11 +659,7 @@
<include>**/*TestCase.java</include>
<include>**/*Test.java</include>
</includes>
- <!-- https://jira.jboss.org/jira/browse/RIFTSAW-34 -->
<excludes>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java</exclude>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java</exclude>
- <exclude>org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java</exclude>
<exclude>org/jboss/soa/bpel/tests/esb/**/*TestCase.java</exclude>
<exclude>org/jboss/soa/bpel/tests/esb/**/*Test.java</exclude>
</excludes>
Deleted: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java 2011-02-22 14:46:49 UTC (rev 1310)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELAtmTestCase.java 2011-02-23 11:30:49 UTC (rev 1311)
@@ -1,193 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.atm.AtmService;
-import org.jboss.soa.bpel.tests.samples.atm.FrontEnd;
-import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds;
-import org.jboss.soa.bpel.tests.samples.atm.InsufficientFunds_Exception;
-import org.jboss.soa.bpel.tests.samples.atm.UnauthorizedAccess_Exception;
-
-/**
- * Test for common ATM usage scenarios.
- *
- * @author Juan Cantu
- * @author Alejandro Guizar
- */
-public class TutorialBPELAtmTestCase extends RiftSawTest {
-
- private FrontEnd frontEnd;
-
- private static final String TEST_NAME = "Tutorial_bpel_atm";
-
- public TutorialBPELAtmTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(TutorialBPELAtmTestCase.class, TEST_NAME,
- "Tutorial_bpel_atm.war,Tutorial_bpel_atm-1.jar");
- }
-
- protected void setUp() throws Exception {
- AtmService frontEndService = new AtmService();
-
- // obtain dynamic proxy for web service port
- frontEnd = frontEndService.getFrontEndPort();
- }
-
- public void testConnect() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
- assertTrue(ticketNumber > 0);
-
- // check atm is connected
- String status = frontEnd.status(ticketNumber);
- assertEquals("connected", status);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testLogOnAuthorized() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "koen";
- try {
- frontEnd.logOn(ticketNumber, customerName);
- }
- catch (UnauthorizedAccess_Exception e) {
- fail("log on of authorized customer should succeed");
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testLogOnUnauthorized() {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "nobody";
- try {
- frontEnd.logOn(ticketNumber, customerName);
- fail("log on of unauthorized customer should fail");
- }
- catch (UnauthorizedAccess_Exception e) {
- assertEquals(customerName, e.getFaultInfo().getCustomerName());
- }
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testDeposit() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "tom";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // deposit some funds
- double newBalance = frontEnd.deposit(customerName, 10);
- // check the new balance is correct
- assertEquals(previousBalance + 10, newBalance, 0);
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testWithdrawUnderBalance() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "tom";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // withdraw some funds
- try {
- double newBalance = frontEnd.withdraw(customerName, 10);
- // check new balance is correct
- assertEquals(previousBalance - 10, newBalance, 0);
- }
- catch (InsufficientFunds_Exception e) {
- fail("withdraw under balance should succeed");
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-
- public void testWithdrawOverBalance() throws UnauthorizedAccess_Exception {
- // connect to bank
- int ticketNumber = frontEnd.connect();
-
- // begin customer session
- final String customerName = "fady";
- frontEnd.logOn(ticketNumber, customerName);
-
- // get current balance
- double previousBalance = frontEnd.getBalance(customerName);
-
- // try to withdraw an amount greater than current balance
- try {
- frontEnd.withdraw(customerName, previousBalance + 1);
- fail("withdraw over balance should fail");
- }
- catch (InsufficientFunds_Exception e) {
- InsufficientFunds faultInfo = e.getFaultInfo();
- assertEquals(customerName, faultInfo.getCustomerName());
- // check account balance has not changed
- assertEquals(previousBalance, faultInfo.getAmount(), 0);
- }
-
- // end customer session
- frontEnd.logOff(customerName);
-
- // disconnect from bank
- frontEnd.disconnect(ticketNumber);
- }
-}
\ No newline at end of file
Deleted: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java 2011-02-22 14:46:49 UTC (rev 1310)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELPurchaseTestCase.java 2011-02-23 11:30:49 UTC (rev 1311)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.purchase.CustomerInfo;
-import org.jboss.soa.bpel.tests.samples.purchase.Invoice;
-import org.jboss.soa.bpel.tests.samples.purchase.OrderFaultType;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrder;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseOrderPT;
-import org.jboss.soa.bpel.tests.samples.purchase.PurchaseSVC;
-
-/**
- * Test for common order purchasing scenarios.
- *
- * @author Jeff DeLong
- * @author Alejandro Guizar
- */
-public class TutorialBPELPurchaseTestCase extends RiftSawTest {
-
- private PurchaseOrderPT purchaseOrderPT;
-
- private static final String TEST_NAME = "Tutorial_bpel_purchase";
-
- public TutorialBPELPurchaseTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(
- TutorialBPELPurchaseTestCase.class,
- TEST_NAME,
- "purchase-queue-service.xml,Tutorial_bpel_purchase.war,Tutorial_bpel_purchase_ejb.jar,Tutorial_bpel_purchase-1.jar");
- }
-
- protected void setUp() throws Exception {
- PurchaseSVC service = new PurchaseSVC();
- purchaseOrderPT = service.getPurchaseOrderSP();
- }
-
- public void testSendPurchaseOrderAvailable() {
- CustomerInfo customerInfo = new CustomerInfo();
- customerInfo.setCustomerId("manager");
- customerInfo.setAddress("123 Main St");
-
- PurchaseOrder purchaseOrder = new PurchaseOrder();
- purchaseOrder.setOrderId(10);
- purchaseOrder.setPartNumber(23);
- purchaseOrder.setQuantity(4);
-
- try {
- Invoice invoice =
- purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
- // In our system, the part number is also the unit price!
- // The shipper charges a flat fare of $9.50
- assertEquals(purchaseOrder.getPartNumber() * purchaseOrder.getQuantity()
- + 9.50, invoice.getAmount(), 0);
- assertEquals(purchaseOrder.getOrderId(), invoice.getOrderId());
- }
- catch (OrderFaultType e) {
- fail("shipping to available address should complete");
- }
- }
-
- public void testSendPurchaseOrderNotAvailable() {
- CustomerInfo customerInfo = new CustomerInfo();
- customerInfo.setCustomerId("freddy");
- customerInfo.setAddress("666 Elm St");
-
- PurchaseOrder purchaseOrder = new PurchaseOrder();
- purchaseOrder.setOrderId(20);
- purchaseOrder.setPartNumber(13);
- purchaseOrder.setQuantity(7);
-
- try {
- purchaseOrderPT.sendPurchaseOrder(customerInfo, purchaseOrder);
- fail("shipping to unavailable address should not complete");
- }
- catch (OrderFaultType e) {
- assertTrue(e.getFaultInfo()
- .getDetail()
- .indexOf(customerInfo.getAddress()) != -1);
- }
- }
-}
Deleted: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java 2011-02-22 14:46:49 UTC (rev 1310)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/TutorialBPELTravelAgencyTestCase.java 2011-02-23 11:30:49 UTC (rev 1311)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.bpel.tests.samples;
-
-import java.rmi.RemoteException;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import junit.framework.Test;
-
-import org.jboss.soa.bpel.tests.RiftSawTest;
-import org.jboss.soa.bpel.tests.RiftSawTestSetup;
-import org.jboss.soa.bpel.tests.samples.travel.Cancelation;
-import org.jboss.soa.bpel.tests.samples.travel.Detail;
-import org.jboss.soa.bpel.tests.samples.travel.Flight;
-import org.jboss.soa.bpel.tests.samples.travel.Hotel;
-import org.jboss.soa.bpel.tests.samples.travel.Invoice;
-import org.jboss.soa.bpel.tests.samples.travel.ItemSet;
-import org.jboss.soa.bpel.tests.samples.travel.Order;
-import org.jboss.soa.bpel.tests.samples.travel.Penalty;
-import org.jboss.soa.bpel.tests.samples.travel.Query;
-import org.jboss.soa.bpel.tests.samples.travel.RentalCar;
-import org.jboss.soa.bpel.tests.samples.travel.TravelAgent;
-import org.jboss.soa.bpel.tests.samples.travel.TravelService;
-
-/**
- * @author Alejandro Guizar
- */
-public class TutorialBPELTravelAgencyTestCase extends RiftSawTest {
-
- private TravelAgent travelAgent;
-
- private Flight flight = new Flight();
- private Hotel hotel = new Hotel();
- private RentalCar car = new RentalCar();
- private XMLGregorianCalendar tripDate;
-
- private static final String TEST_NAME = "Tutorial_bpel_travel_agency";
-
- public TutorialBPELTravelAgencyTestCase() {
- super(TEST_NAME);
- }
-
- public static Test suite() {
- return new RiftSawTestSetup(TutorialBPELTravelAgencyTestCase.class,
- TEST_NAME,
- "Tutorial_bpel_travel_agency.war,Tutorial_bpel_travel_agency-1.jar");
- }
-
- protected void setUp() throws Exception {
- TravelService tripService = new TravelService();
- travelAgent = tripService.getTravelAgentPort();
-
- flight.setAirline("AM");
- flight.setNumber(637);
- hotel.setName("Maria Isabel");
- car.setCompany("Alamo");
-
- GregorianCalendar now = new GregorianCalendar();
- now.add(Calendar.SECOND, 10);
- tripDate = DatatypeFactory.newInstance().newXMLGregorianCalendar(now);
- }
-
- public void testPurchaseTrip() throws RemoteException {
- ItemSet items = new ItemSet();
- items.setFlight(flight); // cost: 300
- items.setHotel(hotel); // cost: 100
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
- assertEquals(300 + 100, invoice.getCost(), 0);
- }
-
- public void testGetTripDetails() throws RemoteException {
- ItemSet items = new ItemSet();
- items.setFlight(flight);
- items.setHotel(hotel);
- items.setRentalCar(car);
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
-
- Query query = new Query();
- query.setLocator(invoice.getLocator());
-
- Detail detail = travelAgent.getTripDetail(query);
- items = detail.getItems();
-
- assertEquals(flight.getAirline(), items.getFlight().getAirline());
- assertEquals(flight.getNumber(), items.getFlight().getNumber());
- assertEquals(hotel.getName(), items.getHotel().getName());
- assertEquals(car.getCompany(), items.getRentalCar().getCompany());
- assertEquals(invoice.getCost(), detail.getCost(), 0);
- }
-
- public void testCancelTrip() throws Exception {
- ItemSet items = new ItemSet();
- items.setFlight(flight); // fee: 100
- items.setRentalCar(car); // fee: 5
-
- Order order = new Order();
- order.setDate(tripDate);
- order.setItems(items);
-
- Invoice invoice = travelAgent.purchaseTrip(order);
-
- Cancelation reference = new Cancelation();
- reference.setLocator(invoice.getLocator());
-
- Penalty penalty = travelAgent.cancelTrip(reference);
- assertEquals(100 + 5, penalty.getFee(), 0);
- }
-}
Added: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw345TestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw345TestCase.java (rev 0)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw345TestCase.java 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.testcases;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Test case for running the RiftSaw_345 testcase.
+ */
+public class RiftSaw345TestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "RiftSaw_345";
+
+ public RiftSaw345TestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(RiftSaw345TestCase.class,
+ TEST_NAME, "RiftSaw_345-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+ String result=sendSOAPMessage("hello_request1.xml",
+ "http://localhost:8080/RiftSaw_345WS");
+
+ result = processResult(result);
+
+ assertMessageFromFile(result, "hello_response1.xml");
+ }
+}
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.bpel
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.bpel (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.bpel 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,104 @@
+<!--
+ ~ 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.
+ -->
+<process name="HelloWorld"
+ targetNamespace="http://www.jboss.org/bpel/examples"
+ xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:tns="http://www.jboss.org/bpel/examples"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld.wsdl"
+ namespace="http://www.jboss.org/bpel/examples/wsdl"
+ importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <faultHandlers>
+ <catch faultName="terminationException">
+ <empty />
+ </catch>
+ </faultHandlers>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <flow>
+ <scope name="ScopeBeingTerminated">
+ <terminationHandler>
+ <sequence>
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' Terminated')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+ </terminationHandler>
+ <sequence>
+ <wait><for>'PT10S'</for></wait>
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+ </scope>
+ <sequence>
+ <wait><for>'PT2S'</for></wait>
+ <throw faultName="terminationException" />
+ </sequence>
+ </flow>
+ </sequence>
+</process>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.wsdl
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.wsdl (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/HelloWorld.wsdl 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,67 @@
+<?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.
+ -->
+<wsdl:definitions
+ targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://www.jboss.org/bpel/examples/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:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <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://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+ namespace="http://www.jboss.org/bpel/examples/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/RiftSaw_345WS"/>
+ </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: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/deploy.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/deploy.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/bpel/deploy.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,31 @@
+<!--
+ ~ 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.
+ -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:bpl="http://www.jboss.org/bpel/examples"
+ xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <process-events generate="all"/>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/build.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/build.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,30 @@
+<project name="RiftSaw_345" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="version" value="1" />
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="test.dir" value="${basedir}/src/test/resources/testcases/${ant.project.name}" />
+
+ <property name="sample.jar.name" value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <jar basedir="${test.dir}/bpel" destfile="${deploy.dir}/${ant.project.name}/${sample.jar.name}" />
+
+ <copy todir="${deploy.dir}/${ant.project.name}">
+ <fileset dir="${test.dir}/messages"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+</project>
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_request1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_request1.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_request1.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added: trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_response1.xml (rev 0)
+++ trunk/integration-tests/src/test/resources/testcases/RiftSaw_345/messages/hello_response1.xml 2011-02-23 11:30:49 UTC (rev 1311)
@@ -0,0 +1 @@
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:helloResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><TestPart>Hello Terminated</TestPart></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
13 years, 10 months
riftsaw SVN: r1310 - branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-22 09:46:49 -0500 (Tue, 22 Feb 2011)
New Revision: 1310
Modified:
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
Log:
RIFTSAW-345 - termination handler now invoked. Minor updates related to merging with ODE 1.4-SNAPSHOT, and not performing termination handler if scope has a fault.
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-21 18:35:10 UTC (rev 1309)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-22 14:46:49 UTC (rev 1310)
@@ -272,11 +272,13 @@
// We're done with the main work, if we were terminated, we will
// need to load the termination handler:
if (_terminated) {
- __log.debug("Scope: " + _oscope + " was terminated.");
+ if (__log.isDebugEnabled()) {
+ __log.debug("Scope: " + _oscope + " was terminated. (fault="+_fault+")");
+ }
// ??? Should we forward
- // If termination handler defined
- if (_oscope.terminationHandler != null) {
+ // If termination handler defined, and the scope has not faulted
+ if (_oscope.terminationHandler != null && _fault == null) {
// We have to create a scope for the catch block.
BpelRuntimeContext ntive = getBpelRuntimeContext();
@@ -286,7 +288,7 @@
ScopeFrame terminationHandlerScopeFrame = new ScopeFrame(_oscope.terminationHandler,
ntive.createScopeInstance(_scopeFrame.scopeInstanceId, _oscope.terminationHandler),
- _scopeFrame, CompensationHandler.emptySet(), null);
+ _scopeFrame, CompensationHandler.emptySet(), (FaultData)null);
// Create the temination handler scope.
instance(new SCOPE(terminationHandlerActivity,terminationHandlerScopeFrame, SCOPE.this._linkFrame));
13 years, 10 months
Build failed in Hudson: RiftSaw-jbossws-cxf #140
by jboss-qa-internal@redhat.com
See <http://hudson.qa.jboss.com/hudson/job/RiftSaw-jbossws-cxf/140/changes>
Changes:
[objectiser] RIFTSAW-349 - change dependency as net.sf.saxon is in deprecated maven repo.
------------------------------------------
[...truncated 5474 lines...]
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.019 sec <<< FAILURE!
Running org.jboss.soa.bpel.tests.samples.QuickstartBPELHelloWorldExtendedTimeoutTestCase
java.lang.RuntimeException: Cannot obtain MBeanServerConnection using jndi props: {java.naming.provider.url=localhost:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jnp.interfaces, hostKey=localhost/127.0.0.1:1099}
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:75)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getDeployer(RiftSawTestHelper.java:82)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.deploy(RiftSawTestHelper.java:48)
at org.jboss.soa.bpel.tests.RiftSawTestSetup.setUp(RiftSawTestSetup.java:104)
at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.naming.NameNotFoundException: invoker not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:71)
... 17 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
Running org.jboss.soa.bpel.tests.testcases.RiftSaw70TestCase
java.lang.RuntimeException: Cannot obtain MBeanServerConnection using jndi props: {java.naming.provider.url=localhost:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jnp.interfaces, hostKey=localhost/127.0.0.1:1099}
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:75)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getDeployer(RiftSawTestHelper.java:82)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.deploy(RiftSawTestHelper.java:48)
at org.jboss.soa.bpel.tests.RiftSawTestSetup.setUp(RiftSawTestSetup.java:104)
at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.naming.NameNotFoundException: invoker not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:71)
... 17 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
Running org.jboss.soa.bpel.tests.samples.QuickstartBPELSecureInvokeTestCase
java.lang.RuntimeException: Cannot obtain MBeanServerConnection using jndi props: {java.naming.provider.url=localhost:1099, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jnp.interfaces, hostKey=localhost/127.0.0.1:1099}
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:75)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getDeployer(RiftSawTestHelper.java:82)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.deploy(RiftSawTestHelper.java:48)
at org.jboss.soa.bpel.tests.RiftSawTestSetup.setUp(RiftSawTestSetup.java:104)
at junit.extensions.TestSetup$1.protect(TestSetup.java:22)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.extensions.TestSetup.run(TestSetup.java:27)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.naming.NameNotFoundException: invoker not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.soa.bpel.tests.RiftSawTestHelper.getServer(RiftSawTestHelper.java:71)
... 17 more
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.025 sec <<< FAILURE!
Results :
Tests in error:
junit.framework.TestSuite(a)7c2e1f1f(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)217f242c(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)506f9b8e(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1d329642(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1e22ab57(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)6c01bde4(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)4ebac9b9(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3cc262(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1a50ca0c(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1b815bfb(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)7eda18ac(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)470b9279(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)17094d48(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)579d75ee(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)8542529(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)326b9c84(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)7f724a9d(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3e364641(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)6f0ffb38(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)11e7c5cb(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3ad3c6a3(org.jboss.soa.bpel.tests.RiftSawTestSetup)
testSendHello(org.jboss.soa.bpel.tests.management.RiftSaw238TestCase)
junit.framework.TestSuite(a)7b7a4989(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)4b1c2b67(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)6126f827(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)7dc5ddc9(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1fbbd7b2(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)6a47a0d4(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)1018f51f(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3b3e0aba(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3801318b(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)3f64b09c(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)4aeaf40c(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)209444d1(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)5df4e571(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)d4dd758(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)75bc16f0(org.jboss.soa.bpel.tests.RiftSawTestSetup)
junit.framework.TestSuite(a)e3a1ec6(org.jboss.soa.bpel.tests.RiftSawTestSetup)
Tests run: 38, Failures: 0, Errors: 38, Skipped: 0
[ERROR] There are test failures.
Please refer to <http://hudson.qa.jboss.com/hudson/job/RiftSaw-jbossws-cxf/ws/riftsaw/inte...> for the individual test results.
[INFO] [antrun:run {execution: undeploy-riftsaw}]
[INFO] Executing tasks
stop-server:
[echo] Stopping the server
[echo] Server is at <http://hudson.qa.jboss.com/hudson/job/RiftSaw-jbossws-cxf/ws/riftsaw-2.3....>
[echo] Shutting down server version ${as.version} with parameters ${shutdown.parameters}
[java] shutdown: unused non-option argument: ${shutdown.parameters}
[java] Exception in thread "main" javax.naming.NameNotFoundException: RMIAdaptor not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
[java] at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
[java] at sun.rmi.transport.Transport$1.run(Transport.java:159)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
[java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
[java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[java] at java.lang.Thread.run(Thread.java:619)
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:392)
[java] at org.jboss.Shutdown.main(Shutdown.java:219)
[java] Java Result: 1
[echo] Shutdown rc = 1
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An Ant BuildException has occured: The following error occurred while executing this line:
<http://hudson.qa.jboss.com/hudson/job/RiftSaw-jbossws-cxf/ws/riftsaw/inte...>:173: Unable to shut down JBoss (maybe it hasn't fully started yet?).
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 minutes 11 seconds
[INFO] Finished at: Tue Feb 22 00:19:58 EST 2011
[INFO] Final Memory: 114M/661M
[INFO] ------------------------------------------------------------------------
Recording test results
Archiving artifacts
13 years, 10 months
riftsaw SVN: r1309 - branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-21 13:35:10 -0500 (Mon, 21 Feb 2011)
New Revision: 1309
Modified:
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
Log:
RIFTSAW-345 - termination handler now invoked.
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-21 13:26:54 UTC (rev 1308)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-02-21 18:35:10 UTC (rev 1309)
@@ -274,7 +274,48 @@
if (_terminated) {
__log.debug("Scope: " + _oscope + " was terminated.");
// ??? Should we forward
- _self.parent.completed(null,_compensations);
+
+ // If termination handler defined
+ if (_oscope.terminationHandler != null) {
+
+ // We have to create a scope for the catch block.
+ BpelRuntimeContext ntive = getBpelRuntimeContext();
+
+ ActivityInfo terminationHandlerActivity = new ActivityInfo(genMonotonic(), _oscope.terminationHandler,
+ newChannel(TerminationChannel.class,"TH"), newChannel(ParentScopeChannel.class,"TH"));
+
+ ScopeFrame terminationHandlerScopeFrame = new ScopeFrame(_oscope.terminationHandler,
+ ntive.createScopeInstance(_scopeFrame.scopeInstanceId, _oscope.terminationHandler),
+ _scopeFrame, CompensationHandler.emptySet(), null);
+
+ // Create the temination handler scope.
+ instance(new SCOPE(terminationHandlerActivity,terminationHandlerScopeFrame, SCOPE.this._linkFrame));
+
+ object(new ParentScopeChannelListener(terminationHandlerActivity.parent) {
+ private static final long serialVersionUID = -6009078124717125270L;
+
+ public void compensate(OScope scope, SynchChannel ret) {
+ // This should never happen.
+ throw new AssertionError("received compensate request!");
+ }
+
+ public void completed(FaultData fault, Set<CompensationHandler> compensations) {
+ // The compensations that have been registered here, will never be activated,
+ // so we'll forget them as soon as possible.
+ for (CompensationHandler compensation : compensations)
+ compensation.compChannel.forget();
+
+ // When a fault occurs within a termination handler, it is not propagated
+ _self.parent.completed(null, CompensationHandler.emptySet());
+ }
+
+ public void cancelled() { completed(null, CompensationHandler.emptySet()); }
+ public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
+ });
+ } else {
+ _self.parent.completed(null,_compensations);
+ }
+
} else if (_fault != null) {
sendEvent(new ScopeFaultEvent(_fault.getFaultName(), _fault.getFaultLineNo(),_fault.getExplanation()));
13 years, 10 months
riftsaw SVN: r1308 - in trunk: distribution and 3 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-02-21 08:26:54 -0500 (Mon, 21 Feb 2011)
New Revision: 1308
Modified:
trunk/distribution/pom.xml
trunk/pom.xml
trunk/qa/hudson-riftsaw-local.sh
trunk/runtime/engine-assembly/pom.xml
trunk/runtime/engine-assembly/src/main/assembly/sar.xml
Log:
RIFTSAW-349 - change dependency as net.sf.saxon is in deprecated maven repo.
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2011-02-21 12:33:13 UTC (rev 1307)
+++ trunk/distribution/pom.xml 2011-02-21 13:26:54 UTC (rev 1308)
@@ -110,20 +110,23 @@
<artifactId>xercesImpl</artifactId>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xpath</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xpath</classifier>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xqj</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>dom</classifier>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xqj</classifier>
</dependency>
<dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-02-21 12:33:13 UTC (rev 1307)
+++ trunk/pom.xml 2011-02-21 13:26:54 UTC (rev 1308)
@@ -355,22 +355,25 @@
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>dom</classifier>
<version>${saxon.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xpath</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xpath</classifier>
<version>${saxon.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xqj</artifactId>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xqj</classifier>
<version>${saxon.version}</version>
</dependency>
<dependency>
- <groupId>net.sf.saxon</groupId>
+ <groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
<version>${saxon.version}</version>
</dependency>
Modified: trunk/qa/hudson-riftsaw-local.sh
===================================================================
--- trunk/qa/hudson-riftsaw-local.sh 2011-02-21 12:33:13 UTC (rev 1307)
+++ trunk/qa/hudson-riftsaw-local.sh 2011-02-21 13:26:54 UTC (rev 1308)
@@ -4,7 +4,7 @@
MAVEN_OPTS="-Xms512M -Xmx1024M"
-RIFTSAW_PARENT_DIR="/home/jeff/deploy/riftsaw"
+RIFTSAW_PARENT_DIR="/home/gbrown/testing/riftsaw/qa"
DOWNLOAD_DIR="$RIFTSAW_PARENT_DIR/downloads"
JBOSS_VERSION="5.1.0.GA"
Modified: trunk/runtime/engine-assembly/pom.xml
===================================================================
--- trunk/runtime/engine-assembly/pom.xml 2011-02-21 12:33:13 UTC (rev 1307)
+++ trunk/runtime/engine-assembly/pom.xml 2011-02-21 13:26:54 UTC (rev 1308)
@@ -98,22 +98,25 @@
</exclusions>
</dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xpath</artifactId>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xqj</artifactId>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xpath</classifier>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>dom</classifier>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <classifier>xqj</classifier>
+ </dependency>
</dependencies>
Modified: trunk/runtime/engine-assembly/src/main/assembly/sar.xml
===================================================================
--- trunk/runtime/engine-assembly/src/main/assembly/sar.xml 2011-02-21 12:33:13 UTC (rev 1307)
+++ trunk/runtime/engine-assembly/src/main/assembly/sar.xml 2011-02-21 13:26:54 UTC (rev 1308)
@@ -64,10 +64,10 @@
<include>org.jboss.soa.bpel:riftsaw-scheduler-simple</include>
<include>org.jboss.soa.bpel.runtime:riftsaw-uddi</include>
<include>org.jboss.soa.bpel:riftsaw-utils</include>
- <include>net.sf.saxon:saxon</include>
- <include>net.sf.saxon:saxon-dom</include>
- <include>net.sf.saxon:saxon-xpath</include>
- <include>net.sf.saxon:saxon-xqj</include>
+ <include>net.sourceforge.saxon:saxon</include>
+ <include>net.sourceforge.saxon:saxon:jar:xpath</include>
+ <include>net.sourceforge.saxon:saxon:jar:dom</include>
+ <include>net.sourceforge.saxon:saxon:jar:xqj</include>
<include>org.springframework:spring</include>
<include>org.apache.xmlbeans:xmlbeans</include>
</includes>
13 years, 10 months