From bb684e96524145b16909a3feba59fcf60f496ad9 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Tue, 16 Apr 2013 20:03:43 +0000 Subject: [PATCH] [COLLECTION-432] update bounded collection test. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1468584 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/CollectionUtilsTest.java | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java index abb1633c9..a72f91c51 100644 --- a/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java +++ b/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java @@ -27,13 +27,13 @@ import static org.junit.Assert.fail; import java.util.*; import org.apache.commons.collections.bag.HashBag; -import org.apache.commons.collections.buffer.BoundedFifoBuffer; import org.apache.commons.collections.collection.PredicatedCollection; import org.apache.commons.collections.collection.SynchronizedCollection; import org.apache.commons.collections.collection.TransformedCollection; import org.apache.commons.collections.collection.UnmodifiableCollection; import org.apache.commons.collections.functors.DefaultEquator; import org.apache.commons.collections.functors.Equator; +import org.apache.commons.collections.queue.CircularFifoQueue; import org.junit.Before; import org.junit.Test; @@ -1211,19 +1211,12 @@ public class CollectionUtilsTest extends MockTestCase { } assertFalse(CollectionUtils.isFull(set)); - final BoundedFifoBuffer buf = new BoundedFifoBuffer(set); - assertEquals(true, CollectionUtils.isFull(buf)); + final CircularFifoQueue buf = new CircularFifoQueue(set); + assertEquals(false, CollectionUtils.isFull(buf)); buf.remove("2"); assertFalse(CollectionUtils.isFull(buf)); buf.add("2"); - assertEquals(true, CollectionUtils.isFull(buf)); - - final Buffer buf2 = BufferUtils.synchronizedBuffer(buf); - assertEquals(true, CollectionUtils.isFull(buf2)); - buf2.remove("2"); - assertFalse(CollectionUtils.isFull(buf2)); - buf2.add("2"); - assertEquals(true, CollectionUtils.isFull(buf2)); + assertEquals(false, CollectionUtils.isFull(buf)); } @Test @@ -1245,19 +1238,12 @@ public class CollectionUtilsTest extends MockTestCase { } assertEquals(-1, CollectionUtils.maxSize(set)); - final Buffer buf = new BoundedFifoBuffer(set); + final Queue buf = new CircularFifoQueue(set); assertEquals(3, CollectionUtils.maxSize(buf)); buf.remove("2"); assertEquals(3, CollectionUtils.maxSize(buf)); buf.add("2"); assertEquals(3, CollectionUtils.maxSize(buf)); - - final Buffer buf2 = BufferUtils.synchronizedBuffer(buf); - assertEquals(3, CollectionUtils.maxSize(buf2)); - buf2.remove("2"); - assertEquals(3, CollectionUtils.maxSize(buf2)); - buf2.add("2"); - assertEquals(3, CollectionUtils.maxSize(buf2)); } @Test