public void testRun_NoException() throws Exception {

    Map<String, Object> variables = new HashMap<String, Object>();
    ActorRunner runner = new SynchronousActorRunner(_actor, variables);
    assertEquals(false, _actor.getFieldValue("actorStepped"));

    runner.run();
    assertEquals(true, _actor.getFieldValue("actorStepped"));
    assertSame(_actor, runner.getActor());
    assertSame(variables, runner.getVariables());

    Exception exception = runner.getException();
    assertNull(exception);
  }
  public void testRun_WithException() throws Exception {

    _actor.setFieldValue("throwExceptionOnStep", true);
    Map<String, Object> variables = new HashMap<String, Object>();
    ActorRunner runner = new SynchronousActorRunner(_actor, variables);
    assertEquals(false, _actor.getFieldValue("actorStepped"));

    runner.run();
    assertEquals(true, _actor.getFieldValue("actorStepped"));
    assertSame(_actor, runner.getActor());
    assertSame(variables, runner.getVariables());

    Exception exception = runner.getException();
    assertNotNull(exception);
    assertEquals("Exception in step() method of actor 'TestActor'", exception.getMessage());
  }