SWF-897 Merging Transitions doens't consider on-exceptions
on-exception will now be factored in when determining if a transition can be merged
This commit is contained in:
@@ -149,7 +149,7 @@
|
||||
<para>subflow-state: id</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>transition: on</para>
|
||||
<para>transition: on and on-exception</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>view-state: id</para>
|
||||
|
||||
@@ -60,7 +60,8 @@ public class TransitionModel extends AbstractModel {
|
||||
return false;
|
||||
}
|
||||
TransitionModel transition = (TransitionModel) model;
|
||||
return ObjectUtils.nullSafeEquals(getOn(), transition.getOn());
|
||||
return ObjectUtils.nullSafeEquals(getOn(), transition.getOn())
|
||||
&& ObjectUtils.nullSafeEquals(getOnException(), transition.getOnException());
|
||||
}
|
||||
|
||||
public void merge(Model model) {
|
||||
|
||||
@@ -24,7 +24,17 @@ public class TransitionModelTests extends TestCase {
|
||||
|
||||
public void testMergeable() {
|
||||
TransitionModel child = new TransitionModel();
|
||||
child.setOn("child");
|
||||
child.setOn("event");
|
||||
TransitionModel parent = new TransitionModel();
|
||||
parent.setOn("event");
|
||||
assertTrue(child.isMergeableWith(parent));
|
||||
}
|
||||
|
||||
public void testMergeableOnException() {
|
||||
TransitionModel child = new TransitionModel();
|
||||
child.setOnException("expception");
|
||||
TransitionModel parent = new TransitionModel();
|
||||
parent.setOnException("exception");
|
||||
assertTrue(child.isMergeableWith(child));
|
||||
}
|
||||
|
||||
@@ -36,6 +46,14 @@ public class TransitionModelTests extends TestCase {
|
||||
assertFalse(child.isMergeableWith(parent));
|
||||
}
|
||||
|
||||
public void testNotMergeableOnException() {
|
||||
TransitionModel child = new TransitionModel();
|
||||
child.setOnException("child");
|
||||
TransitionModel parent = new TransitionModel();
|
||||
parent.setOnException("parent");
|
||||
assertFalse(child.isMergeableWith(parent));
|
||||
}
|
||||
|
||||
public void testNotMergeableWithNull() {
|
||||
TransitionModel child = new TransitionModel();
|
||||
assertFalse(child.isMergeableWith(null));
|
||||
|
||||
Reference in New Issue
Block a user