forked from junit-team/junit4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue junit-team#39, by having multiple calls to ParentRunner.f…
…ilter result in the intersection of filters, rather than just the last one used.
- Loading branch information
Showing
6 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
src/test/java/org/junit/tests/manipulation/FilterTest.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 @@ | ||
package org.junit.tests.manipulation; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import org.junit.Test; | ||
import org.junit.runner.Description; | ||
import org.junit.runner.manipulation.Filter; | ||
|
||
public class FilterTest { | ||
public static class NamedFilter extends Filter { | ||
private final String fName; | ||
|
||
public NamedFilter(String name) { | ||
fName= name; | ||
} | ||
|
||
@Override | ||
public boolean shouldRun(Description description) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String describe() { | ||
return fName; | ||
} | ||
} | ||
|
||
@Test | ||
public void intersectionText() { | ||
NamedFilter a= new NamedFilter("a"); | ||
NamedFilter b= new NamedFilter("b"); | ||
assertEquals("a and b", a.intersect(b).describe()); | ||
assertEquals("b and a", b.intersect(a).describe()); | ||
} | ||
} |