Example #1
0
 private List<Runner> runnersForClasses(List<Class<?>> allPossibleClasses) {
   // TODO: cheating
   ArrayList<Runner> result = new ArrayList<Runner>();
   for (Class<?> each : allPossibleClasses) {
     try {
       result.add(new BlockJUnit4ClassRunner(each));
     } catch (InitializationError e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
   return result;
 }
Example #2
0
  protected ExamplesRunner(
      Runtime runtime, CucumberExamples cucumberExamples, JUnitReporter jUnitReporter)
      throws InitializationError {
    super(ExamplesRunner.class, new ArrayList<Runner>());
    this.cucumberExamples = cucumberExamples;

    List<CucumberScenario> exampleScenarios = cucumberExamples.createExampleScenarios();
    for (CucumberScenario scenario : exampleScenarios) {
      try {
        ExecutionUnitRunner exampleScenarioRunner =
            new ExecutionUnitRunner(runtime, scenario, jUnitReporter);
        getChildren().add(exampleScenarioRunner);
      } catch (InitializationError initializationError) {
        initializationError.printStackTrace();
      }
    }
  }