Ejemplo n.º 1
0
 private void configureContext(Context context) {
   Set<Model> models = AnnotationUtils.getAnnotations(context.getClass(), Model.class);
   GraphWalker annotation = context.getClass().getAnnotation(GraphWalker.class);
   if (!models.isEmpty()) {
     Path path = Paths.get(models.iterator().next().file());
     ContextFactoryScanner.get(reflections, path).create(path, context);
   }
   if (!"".equals(annotation.value())) {
     context.setPathGenerator(GeneratorFactory.parse(annotation.value()));
   } else {
     context.setPathGenerator(PathGeneratorFactory.createPathGenerator(annotation));
   }
   if (!"".equals(annotation.start())) {
     context.setNextElement(getElement(context.getModel(), annotation.start()));
   }
 }
Ejemplo n.º 2
0
 public TestExecutor(Configuration configuration) {
   this.configuration = configuration;
   this.machineConfiguration = createMachineConfiguration(AnnotationUtils.findTests(reflections));
   this.machine = createMachine(machineConfiguration);
 }
Ejemplo n.º 3
0
 private void executeAnnotation(Class<? extends Annotation> annotation, Context context) {
   AnnotationUtils.execute(annotation, context);
 }