git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1026188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2010-10-22 01:01:45 +00:00
parent 898a12b6bf
commit 19fcdb2971
1 changed files with 6 additions and 11 deletions

View File

@ -213,10 +213,9 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
assertTrue(AllPredicate.allPredicate(coll), null); assertTrue(AllPredicate.allPredicate(coll), null);
} }
@SuppressWarnings("unchecked")
@Test public void testAllPredicateEx1() { @Test public void testAllPredicateEx1() {
try { try {
AllPredicate.allPredicate((Predicate[]) null); AllPredicate.allPredicate((Predicate<Object>[]) null);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return; return;
} }
@ -302,7 +301,7 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate(), TruePredicate.truePredicate()}).evaluate(null)); FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate(), TruePredicate.truePredicate()}).evaluate(null));
assertEquals(false, PredicateUtils.anyPredicate(new Predicate[] { assertEquals(false, PredicateUtils.anyPredicate(new Predicate[] {
FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate()}).evaluate(null)); FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate(), FalsePredicate.falsePredicate()}).evaluate(null));
Collection coll = new ArrayList(); Collection<Predicate<Object>> coll = new ArrayList<Predicate<Object>>();
coll.add(TruePredicate.truePredicate()); coll.add(TruePredicate.truePredicate());
coll.add(TruePredicate.truePredicate()); coll.add(TruePredicate.truePredicate());
coll.add(TruePredicate.truePredicate()); coll.add(TruePredicate.truePredicate());
@ -332,10 +331,9 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
assertFalse(PredicateUtils.anyPredicate(coll), null); assertFalse(PredicateUtils.anyPredicate(coll), null);
} }
@SuppressWarnings("unchecked")
@Test public void testAnyPredicateEx1() { @Test public void testAnyPredicateEx1() {
try { try {
PredicateUtils.anyPredicate((Predicate[]) null); PredicateUtils.anyPredicate((Predicate<Object>[]) null);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return; return;
} }
@ -454,10 +452,9 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
assertFalse(PredicateUtils.onePredicate(coll), null); assertFalse(PredicateUtils.onePredicate(coll), null);
} }
@SuppressWarnings("unchecked")
@Test public void testOnePredicateEx1() { @Test public void testOnePredicateEx1() {
try { try {
PredicateUtils.onePredicate((Predicate[]) null); PredicateUtils.onePredicate((Predicate<Object>[]) null);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return; return;
} }
@ -484,10 +481,9 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
fail(); fail();
} }
@SuppressWarnings("unchecked")
@Test public void testOnePredicateEx4() { @Test public void testOnePredicateEx4() {
try { try {
PredicateUtils.onePredicate((Collection) null); PredicateUtils.onePredicate((Collection<Predicate<Object>>) null);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return; return;
} }
@ -574,10 +570,9 @@ public class TestPredicateUtils extends BasicPredicateTestBase {
assertTrue(PredicateUtils.nonePredicate(coll), null); assertTrue(PredicateUtils.nonePredicate(coll), null);
} }
@SuppressWarnings("unchecked")
@Test public void testNonePredicateEx1() { @Test public void testNonePredicateEx1() {
try { try {
PredicateUtils.nonePredicate((Predicate[]) null); PredicateUtils.nonePredicate((Predicate<Object>[]) null);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
return; return;
} }