From abbbad196241b50d3b2fa396a7d605f3611e767f Mon Sep 17 00:00:00 2001 From: Brian Vosburgh Date: Thu, 9 Jun 2016 16:34:13 -0400 Subject: fix some common utility predicate tests --- .../common/utility/tests/internal/predicate/ANDTests.java | 8 ++------ .../jpt/common/utility/tests/internal/predicate/ORTests.java | 12 ++++-------- .../tests/internal/predicate/PredicateWrapperTests.java | 6 +++--- .../common/utility/tests/internal/predicate/XORTests.java | 8 ++++---- 4 files changed, 13 insertions(+), 21 deletions(-) (limited to 'common/tests') 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) PredicateTools.and(this.buildMin(1), this.buildMax(10)); } private Predicate buildMin(double min) { @@ -96,7 +95,6 @@ public class ANDTests } public void testEvaluate3() { - @SuppressWarnings("unchecked") Predicate 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 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 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) PredicateTools.or(this.buildMin(1), this.buildMax(10)); } private Predicate buildMin(double min) { @@ -96,8 +95,7 @@ public class ORTests } public void testEvaluate3() { - @SuppressWarnings("unchecked") - CompoundPredicate orPredicate2 = PredicateTools.or(this.orPredicate, this.buildIsEven()); + CompoundPredicate orPredicate2 = (CompoundPredicate) 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 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 orPredicate2 = PredicateTools.or(this.buildMin(1), this.buildMax(10)); + CompoundPredicate orPredicate2 = (CompoundPredicate) 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) PredicateTools.wrap(this.wrappedPredicate); } @Override @@ -59,7 +59,7 @@ public class PredicateWrapperTests } public void testEquals() { - PredicateWrapper predicateWrapper2 = PredicateTools.wrap(this.wrappedPredicate); + PredicateWrapper predicateWrapper2 = (PredicateWrapper) 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) PredicateTools.xor(this.buildMin(1), this.buildMax(10)); } private Predicate buildMin(double min) { @@ -95,7 +95,7 @@ public class XORTests } public void testPredicateing3() { - CompoundPredicate xorPredicate2 = PredicateTools.xor(this.xorPredicate, this.buildIsEven()); + CompoundPredicate xorPredicate2 = (CompoundPredicate) 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 xorPredicate2 = PredicateTools.xor(this.buildMin(1), this.buildMax(10)); + CompoundPredicate xorPredicate2 = (CompoundPredicate) PredicateTools.xor(this.buildMin(1), this.buildMax(10)); assertEquals(this.xorPredicate, xorPredicate2); assertEquals(this.xorPredicate.hashCode(), xorPredicate2.hashCode()); assertFalse(this.xorPredicate.equals(IsNotNull.instance())); -- cgit v1.2.3