Examples of FlowExecutionKey


Examples of org.springframework.webflow.execution.FlowExecutionKey

    FlowExecutionListener listener = new FlowExecutionListenerAdapter() {
    };
    factory.setExecutionListenerLoader(new StaticFlowExecutionListenerLoader(listener));
    MockFlowExecutionKeyFactory keyFactory = new MockFlowExecutionKeyFactory();
    factory.setExecutionKeyFactory(keyFactory);
    FlowExecutionKey flowExecutionKey = new MockFlowExecutionKey("e1s1");
    LocalAttributeMap conversationScope = new LocalAttributeMap();
    SimpleFlowDefinitionLocator locator = new SimpleFlowDefinitionLocator();
    FlowSessionImpl session1 = new FlowSessionImpl();
    session1.setFlowId("flow");
    session1.setStateId("end");
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

  }

  public void testResumeFlowExecution() {
    String flowExecutionKey = "12345";
    MockExternalContext context = new MockExternalContext();
    FlowExecutionKey key = new GeneratedFlowExecutionKey();

    EasyMock.expect(repository.parseFlowExecutionKey(flowExecutionKey)).andReturn(key);
    EasyMock.expect(repository.getLock(key)).andReturn(lock);

    lock.lock();
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

  }

  public void testResumeFlowExecutionEndsAfterProcessing() {
    String flowExecutionKey = "12345";
    MockExternalContext context = new MockExternalContext();
    FlowExecutionKey key = new MockFlowExecutionKey("12345");

    EasyMock.expect(repository.parseFlowExecutionKey(flowExecutionKey)).andReturn(key);
    EasyMock.expect(repository.getLock(key)).andReturn(lock);

    lock.lock();
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

    repository = new DefaultFlowExecutionRepository(conversationManager, snapshotFactory);
  }

  public void testParseFlowExecutionKey() {
    String key = "e12345s54321";
    FlowExecutionKey k = repository.parseFlowExecutionKey(key);
    assertEquals(key, k.toString());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

      assertNotNull(e.getFormat());
    }
  }

  public void testGetLock() {
    FlowExecutionKey key = repository.parseFlowExecutionKey("e12345s54321");
    FlowExecutionLock lock = repository.getLock(key);
    assertNotNull(lock);
    lock.unlock();
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

    assertNotNull(lock);
    lock.unlock();
  }

  public void testGetLockNoSuchFlowExecution() {
    FlowExecutionKey key = repository.parseFlowExecutionKey("e99999s54321");
    try {
      repository.getLock(key);
      fail("should have failed");
    } catch (NoSuchFlowExecutionException e) {
      e.printStackTrace();
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

    FlowExecution execution = factory.createFlowExecution(flow);
    execution.start(null, new MockExternalContext());
    assertNotNull(execution.getKey());
    repository.putFlowExecution(execution);
    String key = execution.getKey().toString();
    FlowExecutionKey parsedKey = repository.parseFlowExecutionKey(key);
    FlowExecution execution2 = repository.getFlowExecution(parsedKey);
    assertSame(execution.getDefinition(), execution2.getDefinition());
    assertEquals(execution.getActiveSession().getState().getId(), execution2.getActiveSession().getState().getId());
  }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

    @Test
    public void testGenerateAndParseKey() throws Exception {
        final CasFlowExecutionKeyFactory keyFactory = new CasFlowExecutionKeyFactory(
            this.mockConversationManager,
            mock(FlowExecutionSnapshotFactory.class));
        final FlowExecutionKey key = keyFactory.getKey(newMockExecution(createSimpleFlow("test")));
        assertNotNull(key);
        assertEquals(key, keyFactory.parseFlowExecutionKey(key.toString()));
    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

    @Test
    public void testTamperResitantKey() throws Exception {
        final CasFlowExecutionKeyFactory keyFactory = new CasFlowExecutionKeyFactory(
            this.mockConversationManager,
            mock(FlowExecutionSnapshotFactory.class));
        final FlowExecutionKey key = keyFactory.getKey(newMockExecution(createSimpleFlow("test")));
        assertNotNull(key);
        // Tamper with the key by replacing first character of UUID component
        final char[] keyChars = key.toString().toCharArray();
        keyChars[3] = keyChars[3] == '0' ? 'f' : '0';
        final String tamperedKey = new String(keyChars);
        try {
            keyFactory.parseFlowExecutionKey(tamperedKey);
            fail("Should have thrown IllegalStateException");
        } catch (IllegalStateException e) {
            assertEquals(key, keyFactory.parseFlowExecutionKey(key.toString()));
        }
    }
View Full Code Here

Examples of org.springframework.webflow.execution.FlowExecutionKey

        final CasFlowExecutionKeyFactory keyFactory = new CasFlowExecutionKeyFactory(
            this.mockConversationManager,
            mock(FlowExecutionSnapshotFactory.class));
        keyFactory.setAlwaysGenerateNewNextKey(true);
        final FlowExecution execution = newMockExecution(createSimpleFlow("test"));
        final FlowExecutionKey key1 = keyFactory.getKey(execution);
        final FlowExecutionKey key2 = keyFactory.getKey(execution);
        assertFalse(key1.equals(key2));
    }
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.