Skip to content

Commit

Permalink
Add JUnit4 compatible checker to TestFramework
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <andre15andre@hotmail.com>
  • Loading branch information
andre15silva committed Jul 2, 2021
1 parent d7dd726 commit a4a07c8
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ private TestFramework(Factory factory) {

/**
* This method says whether the given test method is JUnit 5 or not.
* For now, only JUnit5 needs to be checked because JUnit3 and JUnit4 can be run with the same test runner and do not required any
* specific configuration (such as the pom for PIT, see TODO).
*
* @param ctMethod the test method to checkEnum
* @return true if the given ctMethod is a JUnit5, false otherwise.
Expand All @@ -70,6 +67,17 @@ public static boolean isJUnit5(CtMethod<?> ctMethod) {
return TestFramework.get().getTestFramework(ctMethod) instanceof JUnit5Support;
}

/**
* This method says whether the given test method is JUnit4 compatible (i.e. JUnit3 or JUnit4)
*
* @param ctMethod the test method to CheckEnum
* @return true if the given ctMethod is JUnit4 compatible, false otherwise.
*/
public static boolean isJUnit4(CtMethod<?> ctMethod) {
return TestFramework.get().getTestFramework(ctMethod) instanceof JUnit3Support
|| TestFramework.get().getTestFramework(ctMethod) instanceof JUnit4Support;
}

/**
* This method detects whether or not the given test suite has been annotated to be ignored (JUnit4) or disabled (JUnit5)
* @param candidate the test suite to check
Expand Down

0 comments on commit a4a07c8

Please sign in to comment.