Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.Event


* @author Keith Donald
*/
public class EventTests extends TestCase {

  public void testNewEvent() {
    Event event = new Event(this, "id");
    assertEquals("id", event.getId());
    assertTrue(event.getTimestamp() > 0);
    assertTrue(event.getAttributes().isEmpty());
  }
View Full Code Here


        assertSessionBound();
        Session session = (Session) context.getFlowScope().get("persistenceContext");
        TestBean bean = (TestBean) session.get(TestBean.class, new Long(0));
        assertNotNull(bean);
        context.getFlowScope().put("testBean", bean);
        return new Event(this, "success");
      }
    });
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(hibernateListener));
    flowExecution = factory.createFlowExecution(flow);
View Full Code Here

    assertTrue(event.getAttributes().isEmpty());
  }

  public void testEventNullSource() {
    try {
      new Event(null, "id");
      fail("null source");
    } catch (IllegalArgumentException e) {

    }
  }
View Full Code Here

    }
  }

  public void testEventNullId() {
    try {
      new Event(this, null);
      fail("null id");
    } catch (IllegalArgumentException e) {

    }
  }
View Full Code Here

  }

  public void testNewEventWithAttributes() {
    LocalAttributeMap attrs = new LocalAttributeMap();
    attrs.put("name", "value");
    Event event = new Event(this, "id", attrs);
    assertTrue(!event.getAttributes().isEmpty());
    assertEquals(1, event.getAttributes().size());
  }
View Full Code Here

    assertTrue(!event.getAttributes().isEmpty());
    assertEquals(1, event.getAttributes().size());
  }

  public void testNewEventNullAttributes() {
    Event event = new Event(this, "id", null);
    assertTrue(event.getAttributes().isEmpty());
  }
View Full Code Here

        assertSessionBound();
        EntityManager em = (EntityManager) context.getFlowScope().get("persistenceContext");
        TestBean bean = (TestBean) em.getReference(TestBean.class, new Integer(0));
        assertNotNull(bean);
        context.getFlowScope().put("testBean", bean);
        return new Event(this, "success");
      }
    });
    FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(jpaListener));
    flowExecution = factory.createFlowExecution(flow);
View Full Code Here

  protected void setUp() throws Exception {
  }

  public void testSuccess() {
    Event e = support.success(source);
    assertEquals("success", e.getId());
    assertSame(source, e.getSource());
  }
View Full Code Here

    assertSame(source, e.getSource());
  }

  public void testSuccessWithResult() {
    Object result = new Object();
    Event e = support.success(source, result);
    assertEquals("success", e.getId());
    assertSame(source, e.getSource());
    assertSame(result, e.getAttributes().get("result"));
  }
View Full Code Here

    assertSame(source, e.getSource());
    assertSame(result, e.getAttributes().get("result"));
  }

  public void testError() {
    Event e = support.error(source);
    assertEquals("error", e.getId());
    assertSame(source, e.getSource());
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.