Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-06-08 16:25:33 +0000
committerBrian Vosburgh2017-05-18 22:36:51 +0000
commit80f0a4cc227f32c288d1bc3a8ecaf3574ef15b4d (patch)
tree0d0f55034ac4b2affd79d1ddd3e199660af0ddba /common/tests
parent1ec39dcd21c2fe126a0f510c15a20fb9b73b2698 (diff)
downloadwebtools.dali-80f0a4cc227f32c288d1bc3a8ecaf3574ef15b4d.tar.gz
webtools.dali-80f0a4cc227f32c288d1bc3a8ecaf3574ef15b4d.tar.xz
webtools.dali-80f0a4cc227f32c288d1bc3a8ecaf3574ef15b4d.zip
tweak ReadWriteLockCollectionWrapper tests
Diffstat (limited to 'common/tests')
-rw-r--r--common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/ReadWriteLockCollectionWrapperTests.java74
1 files changed, 49 insertions, 25 deletions
diff --git a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/ReadWriteLockCollectionWrapperTests.java b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/ReadWriteLockCollectionWrapperTests.java
index ee49c03f28..1287782d8c 100644
--- a/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/ReadWriteLockCollectionWrapperTests.java
+++ b/common/tests/org.eclipse.jpt.common.utility.tests/src/org/eclipse/jpt/common/utility/tests/internal/collection/ReadWriteLockCollectionWrapperTests.java
@@ -144,35 +144,59 @@ public class ReadWriteLockCollectionWrapperTests
}
public void testAdd() throws Exception {
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.add("foo"), this.wrapper.add("foo"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.add("bar"), this.wrapper.add("bar"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
+ assertFalse(this.collection.contains("foo"));
+ assertFalse(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
+
+ assertTrue(this.wrapper.add("foo"));
+ assertTrue(this.collection.contains("foo"));
+ assertTrue(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
+
+ assertTrue(this.wrapper.add("bar"));
+ assertTrue(this.collection.contains("foo"));
+ assertTrue(this.wrapper.contains("foo"));
+ assertTrue(this.collection.contains("bar"));
+ assertTrue(this.wrapper.contains("bar"));
}
public void testRemove() throws Exception {
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.add("foo"), this.wrapper.add("foo"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.add("bar"), this.wrapper.add("bar"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
+ assertFalse(this.collection.contains("foo"));
+ assertFalse(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
- assertEquals(this.collection.remove("foo"), this.wrapper.remove("foo"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.remove("bar"), this.wrapper.remove("bar"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
- assertEquals(this.collection.remove("bar"), this.wrapper.remove("bar"));
- assertEquals(this.collection.contains("foo"), this.wrapper.contains("foo"));
- assertEquals(this.collection.contains("bar"), this.wrapper.contains("bar"));
+ this.wrapper.add("foo");
+ assertTrue(this.collection.contains("foo"));
+ assertTrue(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
+
+ this.wrapper.add("bar");
+ assertTrue(this.collection.contains("foo"));
+ assertTrue(this.wrapper.contains("foo"));
+ assertTrue(this.collection.contains("bar"));
+ assertTrue(this.wrapper.contains("bar"));
+
+ assertTrue(this.collection.remove("foo"));
+ assertFalse(this.collection.contains("foo"));
+ assertFalse(this.wrapper.contains("foo"));
+ assertTrue(this.collection.contains("bar"));
+ assertTrue(this.wrapper.contains("bar"));
+
+ assertTrue(this.collection.remove("bar"));
+ assertFalse(this.collection.contains("foo"));
+ assertFalse(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
+
+ assertFalse(this.collection.remove("bar"));
+ assertFalse(this.collection.contains("foo"));
+ assertFalse(this.wrapper.contains("foo"));
+ assertFalse(this.collection.contains("bar"));
+ assertFalse(this.wrapper.contains("bar"));
}
public void testAddAll() throws Exception {

Back to the top