Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License"). You may not
   * use this file except in compliance with the License. A copy of the License is
   * located at
   * 
   * http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed on
  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.simpleworkflow.flow.junit.spring;
 
 import java.util.Map;
 
JUnit Rule that should be present as a public field of the test class annotated with

Rule.:
Requires that test is executed with FlowSpringJUnit4ClassRunner.
 
 public class SpringWorkflowTest extends WorkflowTestBase {
 
 
 
 
     private DataConverter dataConverter;
 
     public SpringWorkflowTest() {
                 new SpringTestPOJOWorkflowImplementationGenericWorkflowClient(), new TestWorkflowClock(),
                 new TestWorkflowContext()));
     }
 
     public void addActivitiesImplementation(Object activitiesImplementation) {
         addActivitiesImplementation(activitiesImplementation);
     }
 
     public void addActivitiesImplementation(String taskListObject activitiesImplementation) {
         try {
             TestPOJOActivityImplementationWorker worker = getActivityWorker(taskList);
             worker.addActivitiesImplementation(activitiesImplementation);
             .addWorker(worker);
         }
         catch (Exception e) {
             throw new IllegalArgumentException("Invalid activities implementation: " + activitiesImplementatione);
         }
     }
 
         TestPOJOActivityImplementationWorker result = .get(taskList);
         if (result == null) {
             result = new TestPOJOActivityImplementationWorker(taskList);
             if ( != null) {
                 result.setDataConverter();
             }
             .put(taskListresult);
         }
         return result;
     }
 
     public void setActivitiesImplementations(Iterable<ObjectactivityImplementationObjects) {
         .clear();
         addActivitiesImplementations(activityImplementationObjects);
     }
 
     public void addActivitiesImplementations(String taskListIterable<ObjectactivityImplementationObjects) {
         try {
             TestPOJOActivityImplementationWorker worker = getActivityWorker(taskList);
             worker.setActivitiesImplementations(activityImplementationObjects);
             .addWorker(worker);
         }
         catch (Exception e) {
             throw new IllegalArgumentException("Invalid activities implementation: " + activityImplementationObjectse);
         }
     }
 
     public void setTaskListActivitiesImplementationMap(Map<StringObjectmap) {
        .clear();
        for (Entry<StringObjecttaskImplPairmap.entrySet()) {
            addActivitiesImplementation(taskImplPair.getKey(), taskImplPair.getValue());
        }
    }
        Map<StringObjectresult = new HashMap<StringObject>();
            Iterable<Objectimplementations = pair.getValue().getActivitiesImplementations();
            for (Object impelementation : implementations) {
                result.put(pair.getKey(), impelementation);
            }
        }
        return result;
    }
    
        return worker.getActivitiesImplementations();
    }
    public void setWorkflowImplementations(Iterable<ObjectworkflowImplementations)
            throws InstantiationExceptionIllegalAccessException {
        .setWorkflowImplementations(workflowImplementations);
    }
    }
    public void addWorkflowImplementation(Object workflowImplementationthrows InstantiationExceptionIllegalAccessException {
        .addWorkflowImplementation(workflowImplementation);
    }
    public DataConverter getDataConverter() {
        return ;
    }
    public void setDataConverter(DataConverter converter) {
         = converter;
        .setDataConverter(converter);
    }
    }
    @Override
    protected void beforeEvaluate(DecisionContext decisionContext) {
        WorkflowScope.setDecisionContext(decisionContext);
    }
    @Override
    protected void afterEvaluate() {
    }
    
New to GrepCode? Check out our FAQ X