Skip to content

Commit da7d592

Browse files
committed
Add test for test class with ignore import but no ignore annotation
1 parent 8981b5c commit da7d592

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/test/java/de/donnerbart/split/TestLoaderTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,21 @@ void load_thirdPartyLibrary() throws Exception {
176176
assertThat(exitCode).hasNullValue();
177177
}
178178

179+
@Test
180+
void load_ignoreImportWithoutIgnoreAnnotation() throws Exception {
181+
final var projectFolder =
182+
tmp.resolve("no-ignore-annotation-project").resolve("src").resolve("main").resolve("java");
183+
copyResourceToTarget(projectFolder, "tests/IgnoreImportTest.java", "IgnoreImportTest.java", PERMISSIONS);
184+
185+
final var testCases = loadTests(false,
186+
NewTestTimeOption.ZERO,
187+
"**/no-ignore-annotation-project/**/*Test.java",
188+
projectFolder);
189+
assertThat(testCases).singleElement().satisfies(testCase -> assertTestCase(testCase, //
190+
new TestCase("de.donnerbart.example.IgnoreImportTest", 0d)));
191+
assertThat(exitCode).hasNullValue();
192+
}
193+
179194
@Test
180195
void load_noPackage() throws Exception {
181196
final var projectFolder = tmp.resolve("no-package-project").resolve("src").resolve("main").resolve("java");
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package de.donnerbart.example;
2+
3+
import org.junit.Ignore;
4+
import org.junit.Test;
5+
6+
class IgnoreImportTest {
7+
8+
@Test
9+
void testIgnored() {
10+
}
11+
}

0 commit comments

Comments
 (0)