Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Class name filters work in a simple way
- Loading branch information
Showing
11 changed files
with
143 additions
and
12 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
junit-engine-api/src/main/java/org/junit/gen5/engine/ClassFilter.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
package org.junit.gen5.engine; | |||
|
|||
public interface ClassFilter extends EngineFilter { | |||
|
|||
boolean acceptClass(Class<?> clazz); | |||
} |
19 changes: 19 additions & 0 deletions
19
junit-engine-api/src/main/java/org/junit/gen5/engine/ClassNameFilter.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
package org.junit.gen5.engine; | |||
|
|||
import lombok.Value; | |||
|
|||
@Value | |||
public class ClassNameFilter implements ClassFilter { | |||
|
|||
final private String regex; | |||
|
|||
@Override | |||
public boolean acceptClass(Class<?> clazz) { | |||
return clazz.getSimpleName().matches(regex); | |||
} | |||
|
|||
@Override | |||
public String getDescription() { | |||
return "Filter class names with regular expression: " + regex; | |||
} | |||
} |
6 changes: 6 additions & 0 deletions
6
junit-engine-api/src/main/java/org/junit/gen5/engine/EngineFilter.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
package org.junit.gen5.engine; | |||
|
|||
public interface EngineFilter { | |||
|
|||
String getDescription(); | |||
} |
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
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