Skip to main content
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBrian Vosburgh2016-06-09 20:34:13 +0000
committerBrian Vosburgh2017-05-18 22:37:01 +0000
commitabbbad196241b50d3b2fa396a7d605f3611e767f (patch)
tree04f45ef9330b7c8057959141a24ee1602ad27a7c /common
parentd5ba8179b6b2adacbb8e355de00e4b4f1d423295 (diff)
downloadwebtools.dali-abbbad196241b50d3b2fa396a7d605f3611e767f.tar.gz
webtools.dali-abbbad196241b50d3b2fa396a7d605f3611e767f.tar.xz
webtools.dali-abbbad196241b50d3b2fa396a7d605f3611e767f.zip
fix some common utility predicate tests
Diffstat (limited to 'common')
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ANDTests.java8
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ORTests.java12
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/PredicateWrapperTests.java6
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/XORTests.java8
4 files changed, 13 insertions, 21 deletions
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ANDTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ANDTests.java
index a4674745bd..3053347b10 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ANDTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ANDTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -30,10 +30,9 @@ public class ANDTests
}
@Override
- @SuppressWarnings("unchecked")
protected void setUp() throws Exception {
super.setUp();
- this.andPredicate = PredicateTools.and(this.buildMin(1), this.buildMax(10));
+ this.andPredicate = (CompoundPredicate<Number>) PredicateTools.and(this.buildMin(1), this.buildMax(10));
}
private Predicate<Number> buildMin(double min) {
@@ -96,7 +95,6 @@ public class ANDTests
}
public void testEvaluate3() {
- @SuppressWarnings("unchecked")
Predicate<Number> andPredicate2 = PredicateTools.and(this.andPredicate, this.buildIsEven());
assertFalse(andPredicate2.evaluate(new Integer(7)));
assertTrue(andPredicate2.evaluate(new Integer(2)));
@@ -108,7 +106,6 @@ public class ANDTests
}
public void testComposite() {
- @SuppressWarnings("unchecked")
Predicate<Number> andPredicate2 = PredicateTools.and(this.buildMin(1), this.buildMax(10), this.buildIsEven());
assertFalse(andPredicate2.evaluate(new Integer(7)));
assertTrue(andPredicate2.evaluate(new Integer(2)));
@@ -120,7 +117,6 @@ public class ANDTests
}
public void testEquals() {
- @SuppressWarnings("unchecked")
Predicate<Number> andPredicate2 = PredicateTools.and(this.buildMin(1), this.buildMax(10));
assertEquals(this.andPredicate, andPredicate2);
assertEquals(this.andPredicate.hashCode(), andPredicate2.hashCode());
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ORTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ORTests.java
index d6d2845400..e185d3f5db 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ORTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/ORTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -30,10 +30,9 @@ public class ORTests
}
@Override
- @SuppressWarnings("unchecked")
protected void setUp() throws Exception {
super.setUp();
- this.orPredicate = PredicateTools.or(this.buildMin(1), this.buildMax(10));
+ this.orPredicate = (CompoundPredicate<Number>) PredicateTools.or(this.buildMin(1), this.buildMax(10));
}
private Predicate<Number> buildMin(double min) {
@@ -96,8 +95,7 @@ public class ORTests
}
public void testEvaluate3() {
- @SuppressWarnings("unchecked")
- CompoundPredicate<Number> orPredicate2 = PredicateTools.or(this.orPredicate, this.buildIsEven());
+ CompoundPredicate<Number> orPredicate2 = (CompoundPredicate<Number>) PredicateTools.or(this.orPredicate, this.buildIsEven());
assertFalse(orPredicate2.evaluate(new Integer(7)));
assertFalse(orPredicate2.evaluate(new Integer(3)));
assertFalse(orPredicate2.evaluate(new Integer(9)));
@@ -115,7 +113,6 @@ public class ORTests
}
public void testComposite() {
- @SuppressWarnings("unchecked")
Predicate<Number> orPredicate2 = PredicateTools.or(this.buildMin(1), this.buildMax(10), this.buildIsEven());
assertFalse(orPredicate2.evaluate(new Integer(7)));
assertFalse(orPredicate2.evaluate(new Integer(3)));
@@ -134,8 +131,7 @@ public class ORTests
}
public void testEquals() {
- @SuppressWarnings("unchecked")
- CompoundPredicate<Number> orPredicate2 = PredicateTools.or(this.buildMin(1), this.buildMax(10));
+ CompoundPredicate<Number> orPredicate2 = (CompoundPredicate<Number>) PredicateTools.or(this.buildMin(1), this.buildMax(10));
assertEquals(this.orPredicate, orPredicate2);
assertEquals(this.orPredicate.hashCode(), orPredicate2.hashCode());
assertFalse(this.orPredicate.equals(IsNotNull.instance()));
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/PredicateWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/PredicateWrapperTests.java
index 63c7caacbe..517ea3a25c 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/PredicateWrapperTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/PredicateWrapperTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 Oracle. All rights reserved.
+ * Copyright (c) 2013, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -32,7 +32,7 @@ public class PredicateWrapperTests
protected void setUp() throws Exception {
super.setUp();
this.wrappedPredicate = PredicateTools.isEqual(Integer.valueOf(42));
- this.predicateWrapper = PredicateTools.wrap(this.wrappedPredicate);
+ this.predicateWrapper = (PredicateWrapper<Integer>) PredicateTools.wrap(this.wrappedPredicate);
}
@Override
@@ -59,7 +59,7 @@ public class PredicateWrapperTests
}
public void testEquals() {
- PredicateWrapper<Integer> predicateWrapper2 = PredicateTools.wrap(this.wrappedPredicate);
+ PredicateWrapper<Integer> predicateWrapper2 = (PredicateWrapper<Integer>) PredicateTools.wrap(this.wrappedPredicate);
assertEquals(this.predicateWrapper, predicateWrapper2);
assertEquals(this.predicateWrapper.hashCode(), predicateWrapper2.hashCode());
assertFalse(this.predicateWrapper.equals(IsNotNull.instance()));
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/XORTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/XORTests.java
index 8d867a6774..4222eb5a88 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/XORTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/predicate/XORTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2005, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -32,7 +32,7 @@ public class XORTests
@Override
protected void setUp() throws Exception {
super.setUp();
- this.xorPredicate = PredicateTools.xor(this.buildMin(1), this.buildMax(10));
+ this.xorPredicate = (CompoundPredicate<Number>) PredicateTools.xor(this.buildMin(1), this.buildMax(10));
}
private Predicate<Number> buildMin(double min) {
@@ -95,7 +95,7 @@ public class XORTests
}
public void testPredicateing3() {
- CompoundPredicate<Number> xorPredicate2 = PredicateTools.xor(this.xorPredicate, this.buildIsEven());
+ CompoundPredicate<Number> xorPredicate2 = (CompoundPredicate<Number>) PredicateTools.xor(this.xorPredicate, this.buildIsEven());
assertFalse(xorPredicate2.evaluate(new Integer(7)));
assertFalse(xorPredicate2.evaluate(new Integer(3)));
assertFalse(xorPredicate2.evaluate(new Integer(9)));
@@ -113,7 +113,7 @@ public class XORTests
}
public void testEquals() {
- CompoundPredicate<Number> xorPredicate2 = PredicateTools.xor(this.buildMin(1), this.buildMax(10));
+ CompoundPredicate<Number> xorPredicate2 = (CompoundPredicate<Number>) PredicateTools.xor(this.buildMin(1), this.buildMax(10));
assertEquals(this.xorPredicate, xorPredicate2);
assertEquals(this.xorPredicate.hashCode(), xorPredicate2.hashCode());
assertFalse(this.xorPredicate.equals(IsNotNull.instance()));

Back to the top