[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
This commit is contained in:
Thomas Neidhart 2013-04-16 20:03:43 +00:00
parent b8eee79cce
commit bb684e9652
1 changed files with 5 additions and 19 deletions

View File

@ -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<String> buf = new BoundedFifoBuffer<String>(set);
assertEquals(true, CollectionUtils.isFull(buf));
final CircularFifoQueue<String> buf = new CircularFifoQueue<String>(set);
assertEquals(false, CollectionUtils.isFull(buf));
buf.remove("2");
assertFalse(CollectionUtils.isFull(buf));
buf.add("2");
assertEquals(true, CollectionUtils.isFull(buf));
final Buffer<String> 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<String> buf = new BoundedFifoBuffer<String>(set);
final Queue<String> buf = new CircularFifoQueue<String>(set);
assertEquals(3, CollectionUtils.maxSize(buf));
buf.remove("2");
assertEquals(3, CollectionUtils.maxSize(buf));
buf.add("2");
assertEquals(3, CollectionUtils.maxSize(buf));
final Buffer<String> 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