Skip to content

Commit

Permalink
fix(#165): TestVerifier is executed only for Java sources (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofthejars authored and bartoszmajsak committed Sep 22, 2017
1 parent bf0da3b commit 9b76193
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ public interface TestVerifier {
* @return Whether the given path to a resource represents a test class or not
*/
default boolean isTest(Path resource) {

if (!isJavaFile(resource)) {
return false;
}

final String className = new ClassNameExtractor().extractFullyQualifiedName(resource);
return isTest(className);
}
Expand All @@ -27,9 +32,15 @@ default boolean isTest(Path resource) {
* @return Whether the given path to a resource represents a non-test class or not
*/
default boolean isCore(Path resource) {
if (!isJavaFile(resource)) {
return false;
}
return !isTest(resource);
}

default boolean isJavaFile(Path file) {
return file.toString().endsWith(".java");
}

/**
* Check whether the given {@link TestSelection} instance represents a test class or not
Expand Down

0 comments on commit 9b76193

Please sign in to comment.