コード例 #1
0
 private MachineConfiguration createMachineConfiguration(Collection<Class<?>> testClasses) {
   MachineConfiguration machineConfiguration = new MachineConfiguration();
   for (Class<?> testClass : testClasses) {
     GraphWalker annotation = testClass.getAnnotation(GraphWalker.class);
     if (isTestIncluded(annotation, testClass.getName())) {
       ContextConfiguration contextConfiguration = new ContextConfiguration();
       contextConfiguration.setTestClass(testClass);
       machineConfiguration.addContextConfiguration(contextConfiguration);
     }
   }
   return machineConfiguration;
 }
コード例 #2
0
 private Context createContext(Class<?> testClass) {
   try {
     return (Context) testClass.newInstance();
   } catch (Throwable e) {
     throw new TestExecutionException("Failed to create context");
   }
 }