Author: rahul Date: Wed May 28 13:38:06 2008 New Revision: 661073 URL: http://svn.apache.org/viewvc?rev=661073&view=rev Log: Scope needs to be a TransitionTarget, not State (<parallel> can now contain <transition>s). * Deprecate getScope(), in favor of new getPathScope(). * Remove usage of deprecated method from tests.
Modified: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Path.java commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/PathTest.java Modified: commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Path.java URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Path.java?rev=661073&r1=661072&r2=661073&view=diff ============================================================================== --- commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Path.java (original) +++ commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Path.java Wed May 28 13:38:06 2008 @@ -169,12 +169,26 @@ * @return State scope of the transition path, null means global transition * (SCXML document level) Scope is the least state which is not * being exited nor entered by the transition. + * + * @deprecated Use [EMAIL PROTECTED] #getPathScope()} instead. */ public final State getScope() { return scope; } /** + * Get the farthest transition target from root which is not being exited + * nor entered by the transition (null if scope is document root). + * + * @return Scope of the transition path, null means global transition + * (SCXML document level). Scope is the least transition target + * which is not being exited nor entered by the transition. + */ + public final TransitionTarget getPathScope() { + return scope; + } + + /** * Get the upward segment. * * @return List upward segment of the path up to the scope Modified: commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/PathTest.java URL: http://svn.apache.org/viewvc/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/PathTest.java?rev=661073&r1=661072&r2=661073&view=diff ============================================================================== --- commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/PathTest.java (original) +++ commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/model/PathTest.java Wed May 28 13:38:06 2008 @@ -38,13 +38,13 @@ public void testConstructorNull() { Path path = new Path(null, null); - assertNull(path.getScope()); + assertNull(path.getPathScope()); } public void testConstructorNullState() { Path path = new Path(new State(), null); - assertTrue(path.getScope() instanceof State); + assertTrue(path.getPathScope() instanceof State); } public void testConstructorStates() { @@ -56,7 +56,7 @@ Path path = new Path(source, target); - assertNull(path.getScope()); + assertNull(path.getPathScope()); assertEquals(1, path.getUpwardSegment().size()); assertEquals("1", ((State)path.getUpwardSegment().get(0)).getId()); @@ -107,7 +107,7 @@ Path path = new Path(source, target); - assertNull(path.getScope()); + assertNull(path.getPathScope()); } public void testConstructorParentSource() { @@ -121,7 +121,7 @@ Path path = new Path(source, target); - assertNull(path.getScope()); + assertNull(path.getPathScope()); } public void testConstructorParent() { @@ -139,7 +139,7 @@ Path path = new Path(source, target); - assertEquals("parentid", path.getScope().getId()); + assertEquals("parentid", path.getPathScope().getId()); } public void testConstructorParentParallel() { @@ -157,7 +157,7 @@ Path path = new Path(source, target); - assertNull(path.getScope()); + assertNull(path.getPathScope()); } public void testConstructorParentParallelParent() { @@ -180,7 +180,7 @@ Path path = new Path(source, target); - assertEquals("superParent", path.getScope().getId()); + assertEquals("superParent", path.getPathScope().getId()); } public void testGetRegionsExitedNull() {