Package org.amplafi.flow.impl

Examples of org.amplafi.flow.impl.FlowActivityImpl


    /**
     * In this case flowstate morphing is happening becasue the value dynamic FPD is favorable for morphing
     */
    @Test
    public void testPositiveStateFlowMorphingPositive() {
        FlowActivityImpl fa1 = createFA("FA-1");
        FlowPropertyDefinitionImpl morphFlowFPD = new FlowPropertyDefinitionImpl(FS_MORPH_FLOW, Boolean.class).initAutoCreate();
        fa1.addPropertyDefinitions(morphFlowFPD);

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();

        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        FlowActivityImpl fa4 = createFA("FA-4");
        FlowActivityImpl fa5 = createFA("FA-5");
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa2,fa4,fa5));
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

        FlowState flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
View Full Code Here


    /**
     * In this case there is no morphing happening
     */
    @Test
    public void testNegativeStateFlowMorphing() {
        FlowActivityImpl fa1 = createFA("FA-1");
        FlowPropertyDefinitionImpl morphFlowFPD = new FlowPropertyDefinitionImpl(FS_MORPH_FLOW, Boolean.class).initAutoCreate();
        fa1.addPropertyDefinitions(morphFlowFPD);

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

        FlowStateImplementor flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
View Full Code Here

    /**
     * Test no common FAs
     */
    @Test
    public void testNoCommonFAs() {
        FlowActivityImpl fa1 = createFA("FA-1");
        FlowPropertyDefinitionImpl morphFlowFPD = new FlowPropertyDefinitionImpl(FS_MORPH_FLOW, Boolean.class).initAutoCreate();
        fa1.addPropertyDefinitions(morphFlowFPD);

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");

        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        FlowActivityImpl fa4 = createFA("FA-4");
        FlowActivityImpl fa5 = createFA("FA-5");
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa4, fa5));

        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
        FlowState flowState = flowManagement.startFlowState(FIRST_FLOW, true, null, false);
        assertEquals(flowState.getFlow().getFlowPropertyProviderName(), FIRST_FLOW);
View Full Code Here

    /**
     * Test no FAs not in order
     */
    @Test(expectedExceptions = IllegalStateException.class)
    public void testFAsNotInOrder() {
        FlowActivityImpl fa1 = createFA("FA-1");
        FlowPropertyDefinitionImpl morphFlowFPD = new FlowPropertyDefinitionImpl(FS_MORPH_FLOW, Boolean.class).initAutoCreate();
        fa1.addPropertyDefinitions(morphFlowFPD);

        FlowActivityImpl fa2 = createFA("FA-2");
        FlowActivityImpl fa3 = createFA("FA-3");

        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(FIRST_FLOW, fa1,fa2,fa3));

        flowTestingUtils.getFlowDefinitionsManager().addDefinitions(new FlowImpl(MORPHED_FLOW, fa3, fa2, fa1));
View Full Code Here

        flowState.morphFlow(MORPHED_FLOW, new HashMap<String,String>());
        fail();
    }

    private FlowActivityImpl createFA(String name) {
        FlowActivityImpl activity = new FlowActivityImpl().initInvisible(false);
        activity.setFlowPropertyProviderName(name);
        return activity;
    }
View Full Code Here

    private FlowImplementor createFlow2(String flowTypeName, int size) {
        FlowImplementor simple = new FlowImpl(flowTypeName);

        for (int i = 0; i < size; i++) {
            FlowActivityImpl activity = new FlowActivityImpl();
            activity.setComponentName("comp#"+i);
            simple.addActivity(activity);
        }
        return simple;
    }
View Full Code Here

    @Test(enabled=TEST_ENABLED)
    public void testFlowDefinition() {
        FlowImpl flow = new FlowImpl();
        FlowActivity[] fas = new FlowActivity[3];
        for(int i = 0; i < fas.length; i++) {
            FlowActivityImpl fa = new FlowActivityImpl();
            fas[i] = fa;
            flow.addActivity(fa);
        }
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);
View Full Code Here

     */
    @Test
    public void testPropertyPriority() {
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        {
            FlowActivityImpl flowActivity0 = new FlowActivityImpl();
            flowActivity0.setFlowPropertyProviderName("fs0");
            flowActivity0.addPropertyDefinitions(new FlowPropertyDefinitionImpl("key").initPropertyScope(activityLocal));
            FlowActivityImpl flowActivity1 = new FlowActivityImpl();
            flowActivity1.setFlowPropertyProviderName("fs1");
            FlowImpl flow = new FlowImpl(FLOW_TYPE, flowActivity0, flowActivity1);
            flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);
            flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        }
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();
View Full Code Here

     * Test for hasVisibleNext and hasVisiblePrevious of FlowState.
     */
    @Test(enabled=TEST_ENABLED)
    public void testVisiblePreviousNext() {
        FlowImpl flow = new FlowImpl(FLOW_TYPE);
        flow.addActivity(new FlowActivityImpl().initInvisible(false));
        flow.addActivity(new FlowActivityImpl().initInvisible(false));
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolveFlow(flow);
        flowTestingUtils.getFlowDefinitionsManager().addDefinition(FLOW_TYPE, flow);
        FlowManagement flowManagement = flowTestingUtils.getFlowManagement();

View Full Code Here

     * Also test when invisible is turned on/off during the flow.
     */
    @Test(enabled=TEST_ENABLED)
    public void testVisiblePreviousNextWithHidden() {
        FlowImplementor flow = new FlowImpl(FLOW_TYPE);
        FlowActivityImpl fa1 = new FlowActivityImpl().initInvisible(true);
        FlowActivityImpl fa2 = new FlowActivityImpl().initInvisible(true);
        FlowActivityImpl fa3 = new FlowActivityImpl().initInvisible(false);
        flow.addActivity(fa1);
        FlowTestingUtils flowTestingUtils = new FlowTestingUtils();
        flowTestingUtils.getFlowTranslatorResolver().resolve(fa1);
        flow.addActivity(fa3);
        flowTestingUtils.getFlowTranslatorResolver().resolve(fa3);
View Full Code Here

TOP

Related Classes of org.amplafi.flow.impl.FlowActivityImpl

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.