Package org.springframework.webflow.conversation

Examples of org.springframework.webflow.conversation.Conversation.lock()


    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    ConversationId conversationId = conversation.getId();
    assertNotNull(conversationManager.getConversation(conversationId));
    conversation.lock();
    conversation.end();
    conversation.unlock();
    try {
      conversationManager.getConversation(conversationId);
      fail("Conversation should have ben removed");
View Full Code Here


  public void testNoPassivation() {
    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
View Full Code Here

    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
    conversation2.lock();
    assertEquals("testValue", conversation2.getAttribute("testAttribute"));
    conversation.end();
    conversation.unlock();
    conversation2.unlock();
  }
View Full Code Here

  public void testPassivation() throws Exception {
    MockExternalContext externalContext = new MockExternalContext();
    ExternalContextHolder.setExternalContext(externalContext);
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();
    ExternalContextHolder.setExternalContext(null);
    // simulate write out of session
    byte[] passiveSession = passivate(externalContext.getSessionMap());
View Full Code Here

  public void testMaxConversations() {
    conversationManager.setMaxConversations(2);
    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation1 = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation1.lock();
    assertNotNull(conversationManager.getConversation(conversation1.getId()));
    Conversation conversation2 = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    assertNotNull(conversationManager.getConversation(conversation1.getId()));
    assertNotNull(conversationManager.getConversation(conversation2.getId()));
View Full Code Here

    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    ConversationId conversationId = conversation.getId();
    assertNotNull(conversationManager.getConversation(conversationId));
    conversation.lock();
    conversation.end();
    conversation.unlock();
    try {
      conversationManager.getConversation(conversationId);
      fail("Conversation should have ben removed");
View Full Code Here

  public void testNoPassivation() {
    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
View Full Code Here

    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();

    Conversation conversation2 = conversationManager.getConversation(conversationId);
    assertSame(conversation, conversation2);
    conversation2.lock();
    assertEquals("testValue", conversation2.getAttribute("testAttribute"));
    conversation.end();
    conversation.unlock();
    conversation2.unlock();
  }
View Full Code Here

  public void testPassivation() throws Exception {
    MockExternalContext externalContext = new MockExternalContext();
    ExternalContextHolder.setExternalContext(externalContext);
    Conversation conversation = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation.lock();
    conversation.putAttribute("testAttribute", "testValue");
    ConversationId conversationId = conversation.getId();
    ExternalContextHolder.setExternalContext(null);
    // simulate write out of session
    byte[] passiveSession = passivate(externalContext.getSessionMap());
View Full Code Here

  public void testMaxConversations() {
    conversationManager.setMaxConversations(2);
    ExternalContextHolder.setExternalContext(new MockExternalContext());
    Conversation conversation1 = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    conversation1.lock();
    assertNotNull(conversationManager.getConversation(conversation1.getId()));
    Conversation conversation2 = conversationManager.beginConversation(new ConversationParameters("test", "test",
        "test"));
    assertNotNull(conversationManager.getConversation(conversation1.getId()));
    assertNotNull(conversationManager.getConversation(conversation2.getId()));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.