directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nik...@apache.org
Subject svn commit: r414197 - in /directory/sandbox/niklas/mina-sm: ./ src/main/java/org/apache/mina/sm/ src/main/java/org/apache/mina/sm/context/ src/main/java/org/apache/mina/sm/finite/ src/test/java/org/apache/mina/sm/ src/test/java/org/apache/mina/sm/finite/
Date Wed, 14 Jun 2006 11:17:33 GMT
Author: niklas
Date: Wed Jun 14 04:17:32 2006
New Revision: 414197

URL: http://svn.apache.org/viewvc?rev=414197&view=rev
Log:
* Moved state enter/exit handling to StateMachineProxyFactory.
* Removed endState property from State interface.
* Moved currentState to a dedicated property in StateContext instead of as an attribute.
* Removed nextState property from Event.
* Removed currentState property from Event.

Modified:
    directory/sandbox/niklas/mina-sm/pom.xml
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/AbstractState.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/DefaultEventFactory.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/Event.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/EventFactory.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/State.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/StateMachineProxyFactory.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/AbstractStateContext.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/StateContext.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/AbstractTransition.java
    directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/FsmState.java
    directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/AbstractStateTest.java
    directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/FsmStateTest.java
    directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/MethodTransitionTest.java

Modified: directory/sandbox/niklas/mina-sm/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/pom.xml?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/pom.xml (original)
+++ directory/sandbox/niklas/mina-sm/pom.xml Wed Jun 14 04:17:32 2006
@@ -50,6 +50,14 @@
           <showDeprecations>true</showDeprecations>
         </configuration>
       </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+          </excludes>
+        </configuration>
+      </plugin>
+
     </plugins>
   </build>
 

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/AbstractState.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/AbstractState.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/AbstractState.java (original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/AbstractState.java Wed
Jun 14 04:17:32 2006
@@ -27,40 +27,21 @@
 public abstract class AbstractState implements State {
     private final String name;
     private final State parent;
-    private final boolean endState;
 
     public AbstractState(String name) {
-        this(name, null, false);
+        this(name, null);
     }
     
     public AbstractState(String name, State parent) {
-        this(name, parent, false);
-    }
-    
-    public AbstractState(String name, boolean endState) {
-        this(name, null, endState);
-    }
-    
-    public AbstractState(String name, State parent, boolean endState) {
         if (name == null) {
             throw new NullPointerException("Tried to set name to null");
         }
         this.name = name;
         this.parent = parent;
-        this.endState = endState;
     }
     
-    public boolean isEndState() {
-        return endState;
-    }
-
     public void handle(Event event) {
-        if (doHandle(event)) {
-            if (event.getNextState() != event.getCurrentState()) {
-                event.getCurrentState().exit(event);
-                event.getNextState().enter(event);
-            }
-        } else if (parent != null) {
+        if (!doHandle(event) && parent != null) {
             parent.handle(event);
         }
     }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/DefaultEventFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/DefaultEventFactory.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/DefaultEventFactory.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/DefaultEventFactory.java
Wed Jun 14 04:17:32 2006
@@ -32,10 +32,9 @@
 public class DefaultEventFactory implements EventFactory
 {
 
-    public Event create( Method method, State currentState,
-            StateContext context, Object[] arguments )
+    public Event create( StateContext context, Method method, Object[] arguments )
     {
-        return new Event( method.getName(), currentState, context, arguments );
+        return new Event( method.getName(), context, arguments );
     }
 
 }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/Event.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/Event.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/Event.java (original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/Event.java Wed Jun 14
04:17:32 2006
@@ -28,21 +28,16 @@
  */
 public class Event {
     private final Object id;
-    private final State currentState;
     private final StateContext context;
     private final Object[] arguments;
-    private State nextState;
     
-    public Event(Object id, State currentState, StateContext context) {
-        this(id, currentState, context, new Object[0]);
+    public Event(Object id, StateContext context) {
+        this(id, context, new Object[0]);
     }
-    public Event(Object id, State currentState, StateContext context, Object[] arguments)
{
+    public Event(Object id, StateContext context, Object[] arguments) {
         if (id == null) {
             throw new NullPointerException("id");
         }
-        if (currentState == null) {
-            throw new NullPointerException("currentState");
-        }
         if (context == null) {
             throw new NullPointerException("context");
         }
@@ -50,8 +45,6 @@
             throw new NullPointerException("arguments");
         }
         this.id = id;
-        this.currentState = currentState;
-        this.nextState = currentState;
         this.context = context;
         this.arguments = arguments;
     }
@@ -60,21 +53,6 @@
         return context;
     }
 
-    public State getCurrentState() {
-        return currentState;
-    }
-
-    public State getNextState() {
-        return nextState;
-    }
-    
-    public void setNextState(State nextState) {
-        if (nextState == null) {
-            throw new NullPointerException("nextState");
-        }
-        this.nextState = nextState;
-    }
-    
     public Object getId() {
         return id;
     }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/EventFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/EventFactory.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/EventFactory.java (original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/EventFactory.java Wed
Jun 14 04:17:32 2006
@@ -35,11 +35,10 @@
      * Creates a new {@link Event} from the specified method and method 
      * arguments.
      * 
-     * @param method the method being invoked.
-     * @param currentState the current {@link State}.
      * @param context the current {@link StateContext}.
+     * @param method the method being invoked.
      * @param args the method arguments.
      * @return the {@link Event} object.
      */
-    Event create( Method method, State currentState, StateContext context, Object[] arguments
);
+    Event create( StateContext context, Method method, Object[] arguments );
 }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/State.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/State.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/State.java (original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/State.java Wed Jun 14
04:17:32 2006
@@ -26,7 +26,6 @@
  */
 public interface State {
     String getName();
-    boolean isEndState();
     void handle(Event event);
     void enter(Event event);
     void exit(Event event);

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/StateMachineProxyFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/StateMachineProxyFactory.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/StateMachineProxyFactory.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/StateMachineProxyFactory.java
Wed Jun 14 04:17:32 2006
@@ -21,7 +21,6 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.util.Map;
 
 import org.apache.mina.sm.context.SingletonStateContextLookup;
 import org.apache.mina.sm.context.StateContext;
@@ -38,7 +37,6 @@
 public class StateMachineProxyFactory {
     private static final Logger log = LoggerFactory.getLogger(StateMachineProxyFactory.class);
     
-    private static final String CURRENT_STATE = StateMachineProxyFactory.class.getName()
+ ".CurrentState";
     private static final Object[] EMPTY_ARGUMENTS = new Object[0];
 
     private StateMachineProxyFactory() {
@@ -123,21 +121,23 @@
             
             if (context != null) {
                 synchronized (context) {
-                    Map attributes = context.getAttributes();
-                    State state = (State) attributes.get(CURRENT_STATE);
+                    State state = context.getCurrentState();
                     if (state == null) {
+                        context.setCurrentState( startState );
                         state = startState;
                     }
-                    Event event = eventFactory.create(method, state, context, args);
+                    Event event = eventFactory.create(context, method, args);
                     state.handle(event);
-                    if (log.isDebugEnabled()) {
-                        if (event.getNextState() != state) {
-                            log.debug("State changed: " + state.getName() + " -> " 
-                                    + event.getNextState().getName());
+                    if (context.getCurrentState() != state) {
+                        if (log.isDebugEnabled()) {
+                            log.debug("Leaving state: " + state.getName());
                         }
+                        state.exit( event );
+                        if (log.isDebugEnabled()) {
+                            log.debug("Entering state: " + context.getCurrentState().getName());
+                        }
+                        context.getCurrentState().enter( event );
                     }
-                    state = event.getNextState();
-                    attributes.put(CURRENT_STATE, state);
                 }
             }
             

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/AbstractStateContext.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/AbstractStateContext.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/AbstractStateContext.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/AbstractStateContext.java
Wed Jun 14 04:17:32 2006
@@ -21,6 +21,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.mina.sm.State;
+
 /**
  * 
  *
@@ -28,10 +30,32 @@
  * @version $Rev$, $Date$
  */
 public abstract class AbstractStateContext implements StateContext {
+    private State currentState = null;
     private Map attributes = null;
 
-    public Map getAttributes() {
-        if (attributes == null) {
+    public Object getAttribute( Object key )
+    {
+        return getAttributes().get( key );
+    }
+
+    public State getCurrentState()
+    {
+        return currentState;
+    }
+
+    public void setAttribute( Object key, Object value )
+    {
+        getAttributes().put( key, value );
+    }
+
+    public void setCurrentState( State state )
+    {
+        currentState = state;
+    }
+
+    public Map getAttributes() 
+    {
+        if ( attributes == null ) {
             attributes = new HashMap();
         }
         return attributes;

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/StateContext.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/StateContext.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/StateContext.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/context/StateContext.java
Wed Jun 14 04:17:32 2006
@@ -20,6 +20,8 @@
 
 import java.util.Map;
 
+import org.apache.mina.sm.State;
+
 /**
  * 
  *
@@ -27,5 +29,9 @@
  * @version $Rev$, $Date$
  */
 public interface StateContext {
+    State getCurrentState();
+    void setCurrentState(State state);
+    Object getAttribute( Object key );
+    void setAttribute( Object key, Object value );
     Map getAttributes();
 }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/AbstractTransition.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/AbstractTransition.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/AbstractTransition.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/AbstractTransition.java
Wed Jun 14 04:17:32 2006
@@ -49,7 +49,7 @@
         
         if (doExecute(event)) {
             if (nextState != null) {
-                event.setNextState(nextState);
+                event.getContext().setCurrentState(nextState);
             }
             return true;
         }

Modified: directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/FsmState.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/FsmState.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/FsmState.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/main/java/org/apache/mina/sm/finite/FsmState.java
Wed Jun 14 04:17:32 2006
@@ -44,14 +44,6 @@
         super(name, parent);
     }
 
-    public FsmState(String name, boolean endState) {
-        super(name, endState);
-    }
-
-    public FsmState(String name, State parent, boolean endState) {
-        super(name, parent, endState);
-    }
-
     public void enter(Event event) {
     }
 

Modified: directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/AbstractStateTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/AbstractStateTest.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/AbstractStateTest.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/AbstractStateTest.java
Wed Jun 14 04:17:32 2006
@@ -20,7 +20,6 @@
 
 import org.apache.mina.sm.context.StateContext;
 
-import com.agical.rmock.core.expectation.section.OrderedSection;
 import com.agical.rmock.extension.junit.RMockTestCase;
 
 /**
@@ -42,70 +41,32 @@
         nextState = (State) mock(State.class);
         parentState = (State) mock(State.class);
         
-        event = new Event("event", currentState, (StateContext) mock(StateContext.class));
+        event = new Event("event", (StateContext) mock(StateContext.class));
     }
 
     public void testHandleDelegatesToParent() throws Exception {
         parentState.handle(event);
         startVerification();
-        TestState state = new TestState(null, parentState);
+        TestState state = new TestState(false, parentState);
         state.handle(event);
     }
     
     public void testHandleDoesNotDelegateToParent() throws Exception {
         startVerification();
-        TestState state = new TestState(currentState, parentState);
+        TestState state = new TestState(true, parentState);
         state.handle(event);
-        assertSame(currentState, event.getNextState());
     }
     
-    public void testHandleExecuteEnterAndExitOnTransition() throws Exception {
-        beginSection(new OrderedSection(""));
-        {
-            currentState.exit(event);
-            nextState.enter(event);
-        }
-        endSection();
-        startVerification();
-        TestState state = new TestState(nextState, parentState);
-        state.handle(event);
-    }
-    
-    public void testHandleDoesNotExecuteEnterOrExitOnLoopback() throws Exception {
-        startVerification();
-        TestState state = new TestState();
-        state.next = currentState;
-        state.handle(event);
-    }
-    
-    public void testHandleDoesNotExecuteEnterOrExitOnNoNext() throws Exception {
-        startVerification();
-        TestState state = new TestState();
-        state.handle(event);
-    }
-    
-    static class TestState extends AbstractState {
-        State next = null;
-
-        public TestState() {
-            this(null, null);
-        }
-        
-        public TestState(State next) {
-            this(next, null);
-        }
+    private static class TestState extends AbstractState {
+        boolean handle = false;
 
-        public TestState(State next, State parent) {
+        public TestState(boolean handle, State parent) {
             super("test", parent);
-            this.next = next;
+            this.handle = handle;
         }
 
         protected boolean doHandle(Event event) {
-            if (next != null) {
-                event.setNextState(next);
-                return true;
-            }
-            return false;
+            return handle;
         }
         
     }

Modified: directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/FsmStateTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/FsmStateTest.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/FsmStateTest.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/FsmStateTest.java
Wed Jun 14 04:17:32 2006
@@ -22,8 +22,6 @@
 import org.apache.mina.sm.State;
 import org.apache.mina.sm.context.StateContext;
 
-import com.agical.rmock.core.Action;
-import com.agical.rmock.core.MethodHandle;
 import com.agical.rmock.core.expectation.section.OrderedSection;
 import com.agical.rmock.extension.junit.RMockTestCase;
 
@@ -54,7 +52,7 @@
         transition2 = (Transition) mock(Transition.class);
         transition3 = (Transition) mock(Transition.class);
         
-        event = new Event("event", currentState, (StateContext) mock(StateContext.class));
+        event = new Event("event", (StateContext) mock(StateContext.class));
     }
 
     public void testAddFirstTransition() throws Exception {
@@ -79,16 +77,8 @@
         beginSection(new OrderedSection(""));
         {
             transition1.execute(event);
-            modify().returnValue(false);
             transition2.execute(event);
-            modify().perform(new Action() {
-                public Object invocation(Object[] args, MethodHandle mh) throws Throwable
{
-                    event.setNextState(nextState);
-                    return Boolean.TRUE;
-                }
-            });
-            currentState.exit(event);
-            nextState.enter(event);
+            modify().returnValue(true);
         }
         endSection();
         

Modified: directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/MethodTransitionTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/MethodTransitionTest.java?rev=414197&r1=414196&r2=414197&view=diff
==============================================================================
--- directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/MethodTransitionTest.java
(original)
+++ directory/sandbox/niklas/mina-sm/src/test/java/org/apache/mina/sm/finite/MethodTransitionTest.java
Wed Jun 14 04:17:32 2006
@@ -59,8 +59,8 @@
         
         args = new Object[] { new A(), new B(), new C(), new Integer(627438), Boolean.TRUE
};
         context = (TestStateContext) mock(TestStateContext.class);
-        noArgsEvent = new Event("event", currentState, context, new Object[0]);
-        argsEvent = new Event("event", currentState, context, args);
+        noArgsEvent = new Event("event", context, new Object[0]);
+        argsEvent = new Event("event", context, args);
     }
 
     public void testExecuteWrongEventId() throws Exception {
@@ -71,18 +71,18 @@
     
     public void testExecuteNoArgsMethodOnNoArgsEvent() throws Exception {
         target.noArgs();
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, "noArgs", target);
         assertTrue(t.execute(noArgsEvent));
-        assertSame(nextState, noArgsEvent.getNextState());
     }
     
     public void testExecuteNoArgsMethodOnArgsEvent() throws Exception {
         target.noArgs();
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, "noArgs", target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public void testExecuteExactArgsMethodOnNoArgsEvent() throws Exception {
@@ -94,10 +94,10 @@
     public void testExecuteExactArgsMethodOnArgsEvent() throws Exception {
         target.exactArgs((A) args[0], (B) args[1], (C) args[2], 
                          ((Integer) args[3]).intValue(), ((Boolean) args[4]).booleanValue());
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, "exactArgs", target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public void testExecuteSubsetExactArgsMethodOnNoArgsEvent() throws Exception {
@@ -108,35 +108,35 @@
     
     public void testExecuteSubsetExactArgsMethodOnArgsEvent() throws Exception {
         target.subsetExactArgs((A) args[0], (A) args[1], ((Integer) args[3]).intValue());
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, "subsetExactArgs",
target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public void testExecuteAllArgsMethodOnArgsEvent() throws Exception {
         target.allArgs(argsEvent, context, (A) args[0], (B) args[1], (C) args[2], 
                 ((Integer) args[3]).intValue(), ((Boolean) args[4]).booleanValue());
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, "allArgs", target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public void testExecuteSubsetAllArgsMethod1OnArgsEvent() throws Exception {
         target.subsetAllArgs(context, (B) args[1], (A) args[2], ((Integer) args[3]).intValue());
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, subsetAllArgsMethod1,
target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public void testExecuteSubsetAllArgsMethod2OnArgsEvent() throws Exception {
         target.subsetAllArgs(argsEvent, (B) args[1], (B) args[2], ((Boolean) args[4]).booleanValue());
+        context.setCurrentState( nextState );
         startVerification();
         MethodTransition t = new MethodTransition("event", nextState, subsetAllArgsMethod2,
target);
         assertTrue(t.execute(argsEvent));
-        assertSame(nextState, argsEvent.getNextState());
     }
     
     public interface Target {



Mime
View raw message