diff options
author | Brett Chabot <brettchabot@google.com> | 2013-08-19 20:39:55 -0700 |
---|---|---|
committer | Brett Chabot <brettchabot@google.com> | 2013-08-19 20:46:10 -0700 |
commit | 5f4c76c6e54fd8f96cb1f7bc923adbe81bdaf953 (patch) | |
tree | 989bba109f312bb1d2f34bff0e40cbcf9e07997f /src | |
parent | 7b1b6e51b3ff20215d7ca4fc6367829cb6021438 (diff) | |
download | junit-5f4c76c6e54fd8f96cb1f7bc923adbe81bdaf953.tar.gz |
Handle case where filter has removed all methods in TestSuite.
Before this change, description.testCount() would count methods
which should be removed by intersection of filters.
Change-Id: Iea8dcebedd2c4061d52317457b739813d499ff69
Diffstat (limited to 'src')
-rw-r--r-- | src/org/junit/internal/runners/JUnit38ClassRunner.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/junit/internal/runners/JUnit38ClassRunner.java b/src/org/junit/internal/runners/JUnit38ClassRunner.java index 48b944e..11c7a53 100644 --- a/src/org/junit/internal/runners/JUnit38ClassRunner.java +++ b/src/org/junit/internal/runners/JUnit38ClassRunner.java @@ -164,6 +164,11 @@ public class JUnit38ClassRunner extends Runner implements Filterable, Sortable { filtered.addTest(test); } setTest(filtered); + // android-changed: handle empty suite + if (filtered.testCount() == 0) { + throw new NoTestsRemainException(); + } + // android-changed end } } |