Package org.springframework.webflow.conversation.impl

Examples of org.springframework.webflow.conversation.impl.SimpleConversationId


      }
    }

    public ConversationId parseConversationId(String encodedId) throws ConversationException {
      try {
        return new SimpleConversationId(new Integer(Integer.parseInt(encodedId)));
      } catch (NumberFormatException e) {
        throw new BadlyFormattedConversationIdException(encodedId, e);
      }
    }
View Full Code Here


    @Before
    public void setUp() {
        final Map<Object, Object> attributes = new HashMap<Object, Object>();
        final Conversation mockConversation = mock(Conversation.class);
        when(mockConversation.getId()).thenReturn(new SimpleConversationId("ABC123"));
        when(mockConversation.getAttribute(anyString())).thenAnswer(new Answer() {
            public Object answer(InvocationOnMock invocation) throws Throwable {
                return attributes.get(invocation.getArguments()[0]);
            }
        });
        doAnswer(new Answer() {
            public Object answer(InvocationOnMock invocation) throws Throwable {
                final Object[] args = invocation.getArguments();
                return attributes.put(args[0], args[1]);
            }
        }).when(mockConversation).putAttribute(anyObject(), anyObject());

        this.mockConversationManager = mock(ConversationManager.class);
        when(this.mockConversationManager.beginConversation((ConversationParameters) any())).thenReturn(mockConversation);
        when(this.mockConversationManager.getConversation((ConversationId) any())).thenReturn(mockConversation);
        when(this.mockConversationManager.parseConversationId(anyString())).thenAnswer(new Answer() {
           public Object answer(InvocationOnMock invocation) throws Throwable {
               return new SimpleConversationId((String) invocation.getArguments()[0]);
           }
        });
    }
View Full Code Here

      }
    }

    public ConversationId parseConversationId(String encodedId) throws ConversationException {
      try {
        return new SimpleConversationId(Integer.parseInt(encodedId));
      } catch (NumberFormatException e) {
        throw new BadlyFormattedConversationIdException(encodedId, e);
      }
    }
View Full Code Here

import org.springframework.webflow.conversation.impl.SimpleConversationId;

public class CompositeFlowExecutionKeyTests extends TestCase {

  public void testToString() {
    CompositeFlowExecutionKey key = new CompositeFlowExecutionKey(new SimpleConversationId("1"), "1");
    assertEquals("e1s1", key.toString());
  }
View Full Code Here

    CompositeFlowExecutionKey key = new CompositeFlowExecutionKey(new SimpleConversationId("1"), "1");
    assertEquals("e1s1", key.toString());
  }

  public void testEquals() {
    CompositeFlowExecutionKey key = new CompositeFlowExecutionKey(new SimpleConversationId("foo"), "bar");
    CompositeFlowExecutionKey key2 = new CompositeFlowExecutionKey(new SimpleConversationId("foo"), "bar");
    assertEquals(key, key2);
  }
View Full Code Here

TOP

Related Classes of org.springframework.webflow.conversation.impl.SimpleConversationId

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.