Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom lifecycles provided by the Testing framework. JUnit can now fire @rules related lifecycles. Custom lifecycles should inherit the Before/AfterTestLifecycleEvent so extensions can get callbacks without relying on Test framework specific events.
- Loading branch information
1 parent
603bdf0
commit 606b4b2
Showing
23 changed files
with
634 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
junit/core/src/main/java/org/jboss/arquillian/junit/event/AfterRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jboss.arquillian.junit.event; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import org.jboss.arquillian.test.spi.LifecycleMethodExecutor; | ||
import org.jboss.arquillian.test.spi.event.suite.AfterTestLifecycleEvent; | ||
|
||
/** | ||
* | ||
* Event fired After running the JUnit rules. LifecycleMethodExecutor does not | ||
* control anything. See BeforeRules if you want to stop rules invocation. | ||
* | ||
*/ | ||
public class AfterRules extends AfterTestLifecycleEvent { | ||
|
||
/** | ||
* @param testInstance The test case instance being tested | ||
* @param testMethod The test method that is about to be executed | ||
* @param executor A call back when the LifecycleMethod represented by this event should be invoked | ||
*/ | ||
public AfterRules(Object testInstance, Method testMethod, LifecycleMethodExecutor executor) | ||
{ | ||
super(testInstance, testMethod, executor); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
junit/core/src/main/java/org/jboss/arquillian/junit/event/BeforeRules.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.jboss.arquillian.junit.event; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import org.jboss.arquillian.test.spi.LifecycleMethodExecutor; | ||
import org.jboss.arquillian.test.spi.event.suite.BeforeTestLifecycleEvent; | ||
|
||
/** | ||
* | ||
* Event fired Before running the JUnit rules. LifecycleMethodExecutor controls if | ||
* the Rules should be invoked or not. | ||
* | ||
*/ | ||
public class BeforeRules extends BeforeTestLifecycleEvent { | ||
|
||
/** | ||
* @param testInstance The test case instance being tested | ||
* @param testMethod The test method that is about to be executed | ||
* @param executor A call back when the LifecycleMethod represented by this event should be invoked | ||
*/ | ||
public BeforeRules(Object testInstance, Method testMethod, LifecycleMethodExecutor executor) | ||
{ | ||
super(testInstance, testMethod, executor); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.