Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorbvosburgh2008-09-09 16:50:18 +0000
committerbvosburgh2008-09-09 16:50:18 +0000
commitb005c1da316869e54ef53e478956b41cb95354cb (patch)
tree3f94ba88d348ff460b980c35cf2a650beb3c19c3 /jpa
parenta388d2a1ad80b27f3c0d087d6b00e5d140204d2b (diff)
downloadwebtools.dali-b005c1da316869e54ef53e478956b41cb95354cb.tar.gz
webtools.dali-b005c1da316869e54ef53e478956b41cb95354cb.tar.xz
webtools.dali-b005c1da316869e54ef53e478956b41cb95354cb.zip
added some tests for #valuesAreEqual(...)
Diffstat (limited to 'jpa')
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
index eb394a98fe..42a14dbec1 100644
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
+++ b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/AbstractModelTests.java
@@ -29,6 +29,7 @@ import org.eclipse.jpt.utility.model.listener.StateChangeListener;
import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
import org.eclipse.jpt.utility.tests.internal.TestTools;
+@SuppressWarnings("nls")
public class AbstractModelTests
extends TestCase
implements StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
@@ -1128,7 +1129,33 @@ public class AbstractModelTests
assertTrue(Arrays.equals(path, this.treeChangeEvent.getPath()));
}
-// ********** listener implementations **********
+ public void testValuesAreEqual1() {
+ assertTrue(this.testModel.testValuesAreEqual(null, null));
+ assertFalse(this.testModel.testValuesAreDifferent(null, null));
+ }
+
+ public void testValuesAreEqual2() {
+ assertTrue(this.testModel.testValuesAreEqual("foo", "foo"));
+ assertFalse(this.testModel.testValuesAreDifferent("foo", "foo"));
+ }
+
+ public void testValuesAreEqual3() {
+ assertFalse(this.testModel.testValuesAreEqual("foo", null));
+ assertTrue(this.testModel.testValuesAreDifferent("foo", null));
+ }
+
+ public void testValuesAreEqual4() {
+ assertFalse(this.testModel.testValuesAreEqual(null, "foo"));
+ assertTrue(this.testModel.testValuesAreDifferent(null, "foo"));
+ }
+
+ public void testValuesAreEqual5() {
+ assertFalse(this.testModel.testValuesAreEqual("bar", "foo"));
+ assertTrue(this.testModel.testValuesAreDifferent("bar", "foo"));
+ }
+
+
+ // ********** listener implementations **********
public void stateChanged(StateChangeEvent e) {
this.stateChangedCalled = true;
@@ -1301,6 +1328,14 @@ public class AbstractModelTests
}
}
+ public boolean testValuesAreDifferent(Object value1, Object value2) {
+ return this.valuesAreDifferent(value1, value2);
+ }
+
+ public boolean testValuesAreEqual(Object value1, Object value2) {
+ return this.valuesAreEqual(value1, value2);
+ }
+
@Override
public void toString(StringBuilder sb) {
sb.append(TEST_TO_STRING);

Back to the top