forked from junit-team/junit5
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply field predicate before searching type hierarchy
This commit includes a fix with two simple test classes that demonstrate the issue. TODO: - add "formal" tests in ReflectionUtilsTests and AnnotationUtilsTests - add release note entries See junit-team#3498 Closes junit-team#3532
- Loading branch information
Showing
3 changed files
with
98 additions
and
17 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
junit-jupiter-engine/src/test/java/demo/a/SuperclassTempDirTests.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,34 @@ | ||
/* | ||
* Copyright 2015-2023 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package demo.a; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.nio.file.Path; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
public class SuperclassTempDirTests { | ||
|
||
@TempDir | ||
static Path tempDir; | ||
|
||
protected static Path getStaticTempDir() { | ||
return tempDir; | ||
} | ||
|
||
@Test | ||
void superTest() { | ||
assertThat(getStaticTempDir()).exists(); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
junit-jupiter-engine/src/test/java/demo/b/SubclassTempDirTests.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,37 @@ | ||
/* | ||
* Copyright 2015-2023 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package demo.b; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.nio.file.Path; | ||
|
||
import demo.a.SuperclassTempDirTests; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
class SubclassTempDirTests extends SuperclassTempDirTests { | ||
|
||
@TempDir | ||
Path tempDir; | ||
|
||
Path getInstanceTempDir() { | ||
return this.tempDir; | ||
} | ||
|
||
@Test | ||
void subTest() { | ||
assertThat(getInstanceTempDir()).exists(); | ||
assertThat(getStaticTempDir()).exists(); | ||
} | ||
|
||
} |
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