Author: rr
Date: Sat Mar 6 22:40:16 2010
New Revision: 919867
URL: http://svn.apache.org/viewvc?rev=919867&view=rev
Log:
ODE-405: testFailureWithManualRecovery NPE fix
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
Modified:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java?rev=919867&r1=919866&r2=919867&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
(original)
+++
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
Sat Mar 6 22:40:16 2010
@@ -25,6 +25,7 @@
import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
import org.apache.ode.bpel.o.OFailureHandling;
import org.apache.ode.bpel.pmapi.BpelManagementFacade;
+import org.apache.ode.bpel.pmapi.ScopeInfoDocument;
import org.apache.ode.bpel.pmapi.TActivityInfo;
import org.apache.ode.bpel.pmapi.TActivityStatus;
import org.apache.ode.bpel.pmapi.TFailureInfo;
@@ -49,6 +50,7 @@
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Collections;
/**
* Test activity recovery and failure handling.
@@ -427,8 +429,18 @@
protected ArrayList<TActivityInfo> getRecoveriesInScope(TInstanceInfo
instance, TScopeInfo scope,
ArrayList<TActivityInfo> recoveries) throws Exception {
- if (scope == null)
- scope =
_management.getScopeInfoWithActivity(instance.getRootScope().getSiid(),
true).getScopeInfo();
+ if (scope == null) {
+ if (instance != null) {
+ TScopeRef x = instance.getRootScope();
+ if (x != null) {
+ ScopeInfoDocument v =
_management.getScopeInfoWithActivity(x.getSiid(), true);
+ if (v != null) {
+ scope = v.getScopeInfo();
+ }
+ }
+ }
+ if (scope == null) return (ArrayList<TActivityInfo>)
Collections.EMPTY_LIST;
+ }
if (recoveries == null)
recoveries = new ArrayList<TActivityInfo>();
TScopeInfo.Activities activities = scope.getActivities();