@Override public Object answer(org.mockito.invocation.InvocationOnMock invocation) throws Throwable { for (Object argument : invocation.getArguments()) { if (argument instanceof LifecycleMethodExecutor) { ((LifecycleMethodExecutor) argument).invoke(); } else if (argument instanceof TestMethodExecutor) { ((TestMethodExecutor) argument).invoke(); } else if (argument instanceof TestLifecycleEvent) { ((TestLifecycleEvent) argument).getExecutor().invoke(); } } return null; } }
/** * @param testClass * The Test case {@link Class} * * @throws IllegalArgumentException * if testCase is null */ public ClassEvent(TestClass testClass) { Validate.notNull(testClass, "TestClass must be specified"); this.testClass = testClass; }
public CleanupData(TestEvent testEvent, CleanupStrategy cleanupStrategy) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); this.cleanupStrategy = cleanupStrategy; }
private boolean hasScreenshotAnnotation(org.jboss.arquillian.core.spi.event.Event event) { if (event instanceof Before) { return ScreenshotAnnotationScanner.getScreenshotAnnotation(((Before) event).getTestMethod()) != null; } else if (event instanceof AfterTestLifecycleEvent) { return ScreenshotAnnotationScanner .getScreenshotAnnotation(((AfterTestLifecycleEvent) event).getTestMethod()) != null; } return false; } }
public CleanupData(TestEvent testEvent, CleanupStrategy cleanupStrategy) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); this.cleanupStrategy = cleanupStrategy; }
/** * @param testClass * The Test case {@link Class} * * @throws IllegalArgumentException * if testCase is null */ public ClassEvent(TestClass testClass) { Validate.notNull(testClass, "TestClass must be specified"); this.testClass = testClass; }
public CleanupData(TestEvent testEvent, BuiltInCleanupStrategy cleanupStrategy) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); this.cleanupStrategy = cleanupStrategy; } }
/** * Create a new ClassLifecycleEvent for a specific Class. <br/> * * @param testClass * The source for this ClassEvent * @param executor * A call back when the LifecycleMethod represented by this event should be invoked */ public ClassLifecycleEvent(TestClass testClass, LifecycleMethodExecutor executor) { super(testClass); Validate.notNull(executor, "LifecycleMethodExecutor must be specified"); this.executor = executor; }
public BeforePersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); }
/** * Create a new ClassLifecycleEvent for a specific Class. <br/> * * @param testClass * The source for this ClassEvent * @param executor * A call back when the LifecycleMethod represented by this event should be invoked */ public ClassLifecycleEvent(Class<?> testClass, LifecycleMethodExecutor executor) { super(testClass); Validate.notNull(executor, "LifecycleMethodExecutor must be specified"); this.executor = executor; }
public AfterPersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); }
/** * Create a new ClassLifecycleEvent for a specific Class. <br/> * * @param testClass * The source for this ClassEvent * @param executor * A call back when the LifecycleMethod represented by this event should be invoked */ public ClassLifecycleEvent(TestClass testClass, LifecycleMethodExecutor executor) { super(testClass); Validate.notNull(executor, "LifecycleMethodExecutor must be specified"); this.executor = executor; }
public BusEvent(TestEvent event) { this.testInstance = event.getTestInstance(); this.testMethod = event.getTestMethod(); }
/** * Create a new ClassLifecycleEvent for a specific Class. <br/> * * @param testClass * The source for this ClassEvent * @param executor * A call back when the LifecycleMethod represented by this event should be invoked */ public ClassLifecycleEvent(Class<?> testClass, LifecycleMethodExecutor executor) { super(testClass); Validate.notNull(executor, "LifecycleMethodExecutor must be specified"); this.executor = executor; }
public AfterPersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); }
/** * Create a new TestLifecycleEvent for a specific testInstance executing a specific testMethod. <br/> * * @param testInstance * The Test instance * @param testMethod * The Test Method being executed * @param executor * A call back when the LifecycleMethod represented by this event should be invoked */ public TestLifecycleEvent(Object testInstance, Method testMethod, LifecycleMethodExecutor executor) { super(testInstance, testMethod); Validate.notNull(executor, "LifecycleMethodExecutor must be specified"); this.executor = executor; }
public BeforePersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); }
public BeforePersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); } }
public AfterPersistenceTest(TestEvent testEvent) { super(testEvent.getTestInstance(), testEvent.getTestMethod()); } }