Skip to content

Commit

Permalink
GEODE-8819: StressNewTestHelper should handle non org.apache.geode ch…
Browse files Browse the repository at this point in the history
…anged files (apache#5885)
  • Loading branch information
jdeppe-pivotal authored Jan 8, 2021
1 parent 5f2a1fa commit b7774f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ public void add(String javaFile) {
TestClassInfo testClassInfo = createTestClassInfo(javaFile);
List<TestClassInfo> extenders = whatExtends(testClassInfo);

if (!scanResult.getClassInfo(testClassInfo.className).isAbstract()) {
ClassInfo classInfo = scanResult.getClassInfo(testClassInfo.className);
// This is a possibility for non org.apache.geode files
if (classInfo == null) {
return;
}

if (!classInfo.isAbstract()) {
extenders.add(testClassInfo);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public void ignoreAcceptanceTestSourcesForNow() {
assertThat(scanner.buildGradleCommand()).isEqualTo("-PtestCount=0");
}

@Test
public void ignoreNonGeodeClasses() {
scanner.add("foo/src/test/java/org/example/Foo.java");
assertThat(scanner.buildGradleCommand()).isEqualTo("-PtestCount=0");
}

private String getClassLocation(Class<?> clazz) {
String codeSource = clazz.getProtectionDomain().getCodeSource().getLocation().getFile();
String classFile = clazz.getName().replace(".", "/");
Expand Down

0 comments on commit b7774f4

Please sign in to comment.