Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2012-2015 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;
 
 import java.util.Map;
 
JUnit Rule that should be present as a public field of the test class annotated with

Author(s):
fateev
Rule.:
Requires that test is executed with FlowBlockJUnit4ClassRunner.
 
 public class WorkflowTest extends WorkflowTestBase {
 
 
 
 
     public WorkflowTest() {
                 new TestPOJOWorkflowImplementationGenericWorkflowClient(), 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);
             .put(taskListresult);
         }
         return result;
     }
 
     public void addWorkflowImplementationType(Class<?> workflowImplementationType) {
         try {
             .addWorkflowImplementationType(workflowImplementationType);
         }
         catch (Exception e) {
             throw new IllegalArgumentException("Invalid workflow type: " + workflowImplementationTypee);
         }
     }
 
     public void setActivitiesImplementations(Iterable<ObjectactivitiesImplementationObjects) {
         .clear();
         addActivitiesImplementations(activitiesImplementationObjects);
     }
 
     public void setTaskListActivitiesImplementationMap(Map<StringObjectmap) {
         .clear();
         for (Entry<StringObjecttaskImplPair : map.entrySet()) {
             addActivitiesImplementation(taskImplPair.getKey(), taskImplPair.getValue());
         }
     }
 
         Map<StringObjectresult = new HashMap<StringObject>();
         for (Entry<StringTestPOJOActivityImplementationWorkerpair : .entrySet()) {
             Iterable<Objectimplementations = pair.getValue().getActivitiesImplementations();
            for (Object impelementation : implementations) {
                result.put(pair.getKey(), impelementation);
            }
        }
        return result;
    }
    public void addActivitiesImplementations(String taskListIterable<ObjectactivityImplementationObjects) {
        try {
            TestPOJOActivityImplementationWorker worker = getActivityWorker(taskList);
            worker.addActivitiesImplementations(activityImplementationObjects);
            .addWorker(worker);
        }
        catch (Exception e) {
            throw new IllegalArgumentException("Invalid activities implementation: " + activityImplementationObjectse);
        }
    }
        return worker.getActivitiesImplementations();
    }
    public void setWorkflowImplementationTypes(Collection<Class<?>> workflowImplementationTypes)
            throws InstantiationExceptionIllegalAccessException {
        .setWorkflowImplementationTypes(workflowImplementationTypes);
    }
New to GrepCode? Check out our FAQ X