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; }
private Context createContext(Class<?> testClass) { try { return (Context) testClass.newInstance(); } catch (Throwable e) { throw new TestExecutionException("Failed to create context"); } }