From 6bf2ec4c869b053b2fe2a8365f8b6f43609abab9 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Tue, 18 Nov 2003 22:37:18 +0000 Subject: [PATCH] Convert protected methods to public to handle VerifyError (due to inner classes being unable to see protected methods from another package) git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131349 13f79535-47bb-0310-9956-ffa450edef68 --- .../collections/AbstractTestObject.java | 12 +- .../apache/commons/collections/BulkTest.java | 6 +- .../commons/collections/TestBeanMap.java | 22 +- .../commons/collections/TestBinaryHeap.java | 18 +- .../collections/TestBoundedFifoBuffer.java | 16 +- .../collections/TestCircularFifoBuffer.java | 16 +- .../collections/TestCursorableLinkedList.java | 6 +- .../collections/TestDoubleOrderedMap.java | 16 +- .../commons/collections/TestFlat3Map.java | 22 +- .../commons/collections/TestHashBag.java | 6 +- .../commons/collections/TestLRUMap.java | 6 +- .../commons/collections/TestLinkedList.java | 12 +- .../commons/collections/TestMultiHashMap.java | 6 +- .../commons/collections/TestReferenceMap.java | 6 +- .../collections/TestSequencedHashMap.java | 8 +- .../collections/TestStaticBucketMap.java | 8 +- .../commons/collections/TestTreeBag.java | 6 +- .../collections/TestUnboundedFifoBuffer.java | 16 +- .../collections/bag/AbstractTestBag.java | 8 +- .../collections/bag/TestPredicatedBag.java | 6 +- .../bag/TestPredicatedSortedBag.java | 6 +- .../collections/bag/TestTransformedBag.java | 6 +- .../bag/TestTransformedSortedBag.java | 6 +- .../commons/collections/bag/TestTypedBag.java | 6 +- .../collections/bag/TestTypedSortedBag.java | 6 +- .../bidimap/AbstractTestBidiMap.java | 56 +-- .../bidimap/AbstractTestSortedBidiMap.java | 10 +- .../bidimap/TestDualHashBidiMap.java | 8 +- .../bidimap/TestDualTreeBidiMap.java | 8 +- .../collections/bidimap/TestTreeBidiMap.java | 16 +- .../buffer/TestBlockingBuffer.java | 6 +- .../collection/AbstractTestCollection.java | 50 +- .../collection/TestCompositeCollection.java | 14 +- .../collection/TestPredicatedCollection.java | 8 +- .../collection/TestTransformedCollection.java | 12 +- .../comparators/AbstractTestComparator.java | 10 +- .../comparators/TestBooleanComparator.java | 8 +- .../comparators/TestComparableComparator.java | 8 +- .../comparators/TestComparatorChain.java | 8 +- .../comparators/TestNullComparator.java | 8 +- .../comparators/TestReverseComparator.java | 8 +- .../iterators/AbstractTestIterator.java | 18 +- .../iterators/AbstractTestListIterator.java | 18 +- .../iterators/AbstractTestMapIterator.java | 20 +- .../TestUnmodifiableMapIterator.java | 8 +- .../collections/list/AbstractTestList.java | 46 +- .../collections/list/TestFixedSizeList.java | 10 +- .../collections/list/TestPredicatedList.java | 6 +- .../collections/list/TestSetUniqueList.java | 10 +- .../collections/list/TestTransformedList.java | 8 +- .../list/TestUnmodifiableList.java | 10 +- .../collections/map/AbstractTestMap.java | 136 +++--- .../map/AbstractTestSortedMap.java | 48 +- .../collections/map/TestFixedSizeMap.java | 12 +- .../map/TestFixedSizeSortedMap.java | 10 +- .../commons/collections/map/TestLazyMap.java | 6 +- .../collections/map/TestLazySortedMap.java | 6 +- .../collections/map/TestListOrderedMap.java | 22 +- .../collections/map/TestPredicatedMap.java | 6 +- .../map/TestPredicatedSortedMap.java | 6 +- .../collections/map/TestTransformedMap.java | 6 +- .../collections/map/TestUnmodifiableMap.java | 14 +- .../observed/TestObservableBag.java | 6 +- .../observed/TestObservableBuffer.java | 8 +- .../observed/TestObservableCollection.java | 8 +- .../observed/TestObservableList.java | 6 +- .../observed/TestObservableSet.java | 8 +- .../observed/TestObservableSortedBag.java | 6 +- .../observed/TestObservableSortedSet.java | 8 +- .../pairs/AbstractTestMapEntry.java | 12 +- .../TestAbstractByteCollection.java | 113 ----- .../TestAbstractCharCollection.java | 113 ----- .../TestAbstractDoubleCollection.java | 113 ----- .../TestAbstractFloatCollection.java | 113 ----- .../primitives/TestAbstractIntCollection.java | 113 ----- .../primitives/TestAbstractLongArrayList.java | 162 ------- .../TestAbstractLongCollection.java | 113 ----- .../TestAbstractShortCollection.java | 113 ----- .../collections/primitives/TestAll.java | 119 ----- .../primitives/TestArrayByteList.java | 222 --------- .../primitives/TestArrayCharList.java | 222 --------- .../primitives/TestArrayDoubleList.java | 222 --------- .../primitives/TestArrayFloatList.java | 222 --------- .../primitives/TestArrayIntList.java | 222 --------- .../primitives/TestArrayLongList.java | 222 --------- .../primitives/TestArrayShortList.java | 222 --------- .../primitives/TestArrayUnsignedByteList.java | 234 ---------- .../primitives/TestArrayUnsignedIntList.java | 234 ---------- .../TestArrayUnsignedShortList.java | 226 --------- .../primitives/TestByteIterator.java | 153 ------- .../collections/primitives/TestByteList.java | 425 ----------------- .../primitives/TestByteListIterator.java | 91 ---- .../primitives/TestCharIterator.java | 153 ------- .../collections/primitives/TestCharList.java | 433 ------------------ .../primitives/TestCharListIterator.java | 91 ---- .../primitives/TestDoubleIterator.java | 153 ------- .../primitives/TestDoubleList.java | 426 ----------------- .../primitives/TestDoubleListIterator.java | 91 ---- .../primitives/TestFloatIterator.java | 153 ------- .../collections/primitives/TestFloatList.java | 425 ----------------- .../primitives/TestFloatListIterator.java | 91 ---- .../primitives/TestIntCollections.java | 184 -------- .../primitives/TestIntIterator.java | 153 ------- .../collections/primitives/TestIntList.java | 425 ----------------- .../primitives/TestIntListIterator.java | 91 ---- .../primitives/TestLongIterator.java | 153 ------- .../collections/primitives/TestLongList.java | 426 ----------------- .../primitives/TestLongListIterator.java | 91 ---- .../primitives/TestRandomAccessByteList.java | 155 ------- .../primitives/TestRandomAccessCharList.java | 155 ------- .../TestRandomAccessDoubleList.java | 155 ------- .../primitives/TestRandomAccessFloatList.java | 155 ------- .../primitives/TestRandomAccessIntList.java | 155 ------- .../primitives/TestRandomAccessLongList.java | 155 ------- .../primitives/TestRandomAccessShortList.java | 155 ------- .../primitives/TestShortIterator.java | 153 ------- .../collections/primitives/TestShortList.java | 425 ----------------- .../primitives/TestShortListIterator.java | 91 ---- .../primitives/adapters/TestAll.java | 149 ------ .../TestByteCollectionCollection.java | 136 ------ .../adapters/TestByteIteratorIterator.java | 118 ----- .../TestByteListIteratorListIterator.java | 180 -------- .../primitives/adapters/TestByteListList.java | 155 ------- .../TestCharCollectionCollection.java | 136 ------ .../adapters/TestCharIteratorIterator.java | 118 ----- .../TestCharListIteratorListIterator.java | 180 -------- .../primitives/adapters/TestCharListList.java | 155 ------- .../TestCollectionByteCollection.java | 136 ------ .../TestCollectionCharCollection.java | 136 ------ .../TestCollectionDoubleCollection.java | 136 ------ .../TestCollectionFloatCollection.java | 136 ------ .../adapters/TestCollectionIntCollection.java | 136 ------ .../TestCollectionLongCollection.java | 136 ------ .../TestCollectionShortCollection.java | 136 ------ .../TestDoubleCollectionCollection.java | 136 ------ .../adapters/TestDoubleIteratorIterator.java | 118 ----- .../TestDoubleListIteratorListIterator.java | 180 -------- .../adapters/TestDoubleListList.java | 155 ------- .../TestFloatCollectionCollection.java | 136 ------ .../adapters/TestFloatIteratorIterator.java | 118 ----- .../TestFloatListIteratorListIterator.java | 180 -------- .../adapters/TestFloatListList.java | 155 ------- .../adapters/TestIntCollectionCollection.java | 136 ------ .../adapters/TestIntIteratorIterator.java | 118 ----- .../TestIntListIteratorListIterator.java | 180 -------- .../primitives/adapters/TestIntListList.java | 155 ------- .../adapters/TestIteratorByteIterator.java | 118 ----- .../adapters/TestIteratorCharIterator.java | 118 ----- .../adapters/TestIteratorDoubleIterator.java | 118 ----- .../adapters/TestIteratorFloatIterator.java | 118 ----- .../adapters/TestIteratorIntIterator.java | 118 ----- .../adapters/TestIteratorLongIterator.java | 118 ----- .../adapters/TestIteratorShortIterator.java | 118 ----- .../primitives/adapters/TestListByteList.java | 155 ------- .../primitives/adapters/TestListCharList.java | 155 ------- .../adapters/TestListDoubleList.java | 155 ------- .../adapters/TestListFloatList.java | 155 ------- .../primitives/adapters/TestListIntList.java | 155 ------- .../TestListIteratorByteListIterator.java | 118 ----- .../TestListIteratorCharListIterator.java | 118 ----- .../TestListIteratorDoubleListIterator.java | 118 ----- .../TestListIteratorFloatListIterator.java | 118 ----- .../TestListIteratorIntListIterator.java | 118 ----- .../TestListIteratorLongListIterator.java | 118 ----- .../TestListIteratorShortListIterator.java | 118 ----- .../primitives/adapters/TestListLongList.java | 155 ------- .../adapters/TestListShortList.java | 155 ------- .../TestLongCollectionCollection.java | 136 ------ .../adapters/TestLongIteratorIterator.java | 118 ----- .../TestLongListIteratorListIterator.java | 180 -------- .../primitives/adapters/TestLongListList.java | 155 ------- .../TestShortCollectionCollection.java | 136 ------ .../adapters/TestShortIteratorIterator.java | 118 ----- .../TestShortListIteratorListIterator.java | 180 -------- .../adapters/TestShortListList.java | 155 ------- .../primitives/adapters/io/TestAll.java | 85 ---- .../io/TestByteIteratorInputStream.java | 121 ----- .../adapters/io/TestCharIteratorReader.java | 124 ----- .../io/TestInputStreamByteIterator.java | 141 ------ .../adapters/io/TestReaderCharIterator.java | 140 ------ .../BaseUnmodifiableIntIteratorTest.java | 116 ----- .../BaseUnmodifiableIntListIteratorTest.java | 157 ------- .../BaseUnmodifiableIntListTest.java | 225 --------- .../primitives/decorators/TestAll.java | 90 ---- .../TestBaseProxyIntCollection.java | 328 ------------- .../decorators/TestBaseProxyIntList.java | 244 ---------- .../TestUnmodifiableIntIterator.java | 106 ----- .../decorators/TestUnmodifiableIntList.java | 116 ----- .../TestUnmodifiableIntListIterator.java | 106 ----- .../collections/set/AbstractTestSet.java | 22 +- .../set/AbstractTestSortedSet.java | 30 +- .../collections/set/TestListOrderedSet.java | 6 +- .../collections/set/TestPredicatedSet.java | 8 +- .../collections/set/TestTransformedSet.java | 12 +- .../set/TestTransformedSortedSet.java | 8 +- .../set/TestUnmodifiableSortedSet.java | 8 +- 196 files changed, 534 insertions(+), 19880 deletions(-) delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractByteCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractCharCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractDoubleCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractFloatCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractIntCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractLongCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAbstractShortCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestAll.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayByteList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayCharList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayDoubleList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayFloatList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayLongList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayShortList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayUnsignedByteList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayUnsignedIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestArrayUnsignedShortList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestByteIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestByteList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestByteListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestCharIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestCharList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestCharListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestDoubleIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestDoubleList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestDoubleListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestFloatIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestFloatList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestFloatListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestIntCollections.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestIntIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestIntListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestLongIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestLongList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestLongListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessByteList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessCharList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessDoubleList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessFloatList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessLongList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestRandomAccessShortList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestShortIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestShortList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/TestShortListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestAll.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestByteCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestByteIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestByteListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestByteListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCharCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCharIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCharListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCharListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionByteCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionCharCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionDoubleCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionFloatCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionIntCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionLongCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestCollectionShortCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestDoubleCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestDoubleIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestDoubleListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestDoubleListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestFloatCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestFloatIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestFloatListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestFloatListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIntCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIntIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIntListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIntListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorByteIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorCharIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorDoubleIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorFloatIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorIntIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorLongIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestIteratorShortIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListByteList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListCharList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListDoubleList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListFloatList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorByteListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorCharListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorDoubleListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorFloatListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorIntListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorLongListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorShortListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListLongList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestListShortList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestLongCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestLongIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestLongListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestLongListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestShortCollectionCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestShortIteratorIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestShortListIteratorListIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/TestShortListList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/io/TestAll.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/io/TestByteIteratorInputStream.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/io/TestCharIteratorReader.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/io/TestInputStreamByteIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/adapters/io/TestReaderCharIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntIteratorTest.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListIteratorTest.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListTest.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestAll.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntCollection.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntIterator.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntList.java delete mode 100644 src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntListIterator.java diff --git a/src/test/org/apache/commons/collections/AbstractTestObject.java b/src/test/org/apache/commons/collections/AbstractTestObject.java index e721be0bb..65f6e2d50 100644 --- a/src/test/org/apache/commons/collections/AbstractTestObject.java +++ b/src/test/org/apache/commons/collections/AbstractTestObject.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/AbstractTestObject.java,v 1.1 2003/10/02 22:14:29 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/AbstractTestObject.java,v 1.2 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -79,7 +79,7 @@ import java.io.Serializable; * you may still use this base set of cases. Simply override the * test case (method) your {@link Object} fails. * - * @version $Revision: 1.1 $ $Date: 2003/10/02 22:14:29 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:15 $ * * @author Rodney Waldhoff * @author Stephen Colebourne @@ -105,7 +105,7 @@ public abstract class AbstractTestObject extends BulkTest { * * @return the object to test */ - protected abstract Object makeObject(); + public abstract Object makeObject(); /** * Override this method if a subclass is testing an object @@ -114,7 +114,7 @@ public abstract class AbstractTestObject extends BulkTest { * * @return true */ - protected boolean supportsEmptyCollections() { + public boolean supportsEmptyCollections() { return true; } @@ -125,7 +125,7 @@ public abstract class AbstractTestObject extends BulkTest { * * @return true */ - protected boolean supportsFullCollections() { + public boolean supportsFullCollections() { return true; } @@ -244,7 +244,7 @@ public abstract class AbstractTestObject extends BulkTest { * @return The version, or null if this object shouldn't be * tested for compatibility with previous versions. */ - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return "1"; } diff --git a/src/test/org/apache/commons/collections/BulkTest.java b/src/test/org/apache/commons/collections/BulkTest.java index 5df6e9590..9563318c8 100644 --- a/src/test/org/apache/commons/collections/BulkTest.java +++ b/src/test/org/apache/commons/collections/BulkTest.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/BulkTest.java,v 1.7 2003/11/18 21:28:16 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/BulkTest.java,v 1.8 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -175,7 +175,7 @@ import junit.framework.TestSuite; * interpret bulk test methods. * * @author Paul Jack - * @version $Id: BulkTest.java,v 1.7 2003/11/18 21:28:16 scolebourne Exp $ + * @version $Id: BulkTest.java,v 1.8 2003/11/18 22:37:16 scolebourne Exp $ */ public class BulkTest extends TestCase implements Cloneable { @@ -257,7 +257,7 @@ public class BulkTest extends TestCase implements Cloneable { * @return an array of the names of tests to ignore, or null if * no tests should be ignored */ - protected String[] ignoredTests() { + public String[] ignoredTests() { return null; } diff --git a/src/test/org/apache/commons/collections/TestBeanMap.java b/src/test/org/apache/commons/collections/TestBeanMap.java index 5ec91ae1f..788d610ef 100644 --- a/src/test/org/apache/commons/collections/TestBeanMap.java +++ b/src/test/org/apache/commons/collections/TestBeanMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBeanMap.java,v 1.15 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBeanMap.java,v 1.16 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.map.AbstractTestMap; /** * Test cases for BeanMap * - * @version $Revision: 1.15 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.16 $ $Date: 2003/11/18 22:37:15 $ * * @author Morgan Delagrange * @author Stephen Colebourne @@ -200,7 +200,7 @@ public class TestBeanMap extends AbstractTestMap { // // Then, I manually added the "class" key, which is a property that exists for // all beans (and all objects for that matter. - protected Object[] getSampleKeys() { + public Object[] getSampleKeys() { Object[] keys = new Object[] { "someIntValue", "someLongValue", @@ -226,7 +226,7 @@ public class TestBeanMap extends AbstractTestMap { private Object objectInFullMap = new Object(); // note to self: the sample values were created manually - protected Object[] getSampleValues() { + public Object[] getSampleValues() { Object[] values = new Object[] { new Integer(1234), new Long(1298341928234L), @@ -243,7 +243,7 @@ public class TestBeanMap extends AbstractTestMap { return values; } - protected Object[] getNewSampleValues() { + public Object[] getNewSampleValues() { Object[] values = new Object[] { new Integer(223), new Long(23341928234L), @@ -263,7 +263,7 @@ public class TestBeanMap extends AbstractTestMap { /** * Values is a dead copy in BeanMap, so refresh each time. */ - protected void verifyValues() { + public void verifyValues() { values = map.values(); super.verifyValues(); } @@ -273,7 +273,7 @@ public class TestBeanMap extends AbstractTestMap { * bean has. Adding and removing mappings is not possible, thus this * method is overridden to return false. */ - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return false; } @@ -282,11 +282,11 @@ public class TestBeanMap extends AbstractTestMap { * bean has. Adding and removing mappings is not possible, thus this * method is overridden to return false. */ - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } - protected Map makeFullMap() { + public Map makeFullMap() { // note: These values must match (i.e. .equals() must return true) // those returned from getSampleValues(). BeanWithProperties bean = new BeanWithProperties(); @@ -303,11 +303,11 @@ public class TestBeanMap extends AbstractTestMap { return new BeanMap(bean); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new BeanMap(); } - protected String[] ignoredTests() { + public String[] ignoredTests() { // Ignore the serialization tests on collection views. return new String[] { "TestBeanMap.bulkTestMapEntrySet.testCanonicalEmptyCollectionExists", diff --git a/src/test/org/apache/commons/collections/TestBinaryHeap.java b/src/test/org/apache/commons/collections/TestBinaryHeap.java index 819342f2d..1b9a81851 100644 --- a/src/test/org/apache/commons/collections/TestBinaryHeap.java +++ b/src/test/org/apache/commons/collections/TestBinaryHeap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBinaryHeap.java,v 1.12 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBinaryHeap.java,v 1.13 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.comparators.ReverseComparator; /** * Tests the BinaryHeap. * - * @version $Revision: 1.12 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.13 $ $Date: 2003/11/18 22:37:16 $ * * @author Michael A. Smith */ @@ -88,7 +88,7 @@ public class TestBinaryHeap extends AbstractTestCollection { } //----------------------------------------------------------------------- - protected void verify() { + public void verify() { super.verify(); BinaryHeap heap = (BinaryHeap) collection; @@ -115,16 +115,16 @@ public class TestBinaryHeap extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer isn't fail fast. * @return false */ - protected boolean isFailFastSupported() { + public boolean isFailFastSupported() { return false; } //----------------------------------------------------------------------- - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new ArrayList(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { ArrayList list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; @@ -133,16 +133,16 @@ public class TestBinaryHeap extends AbstractTestCollection { /** * Return a new, empty {@link Object} to used for testing. */ - protected Collection makeCollection() { + public Collection makeCollection() { return new BinaryHeap(); } //----------------------------------------------------------------------- - protected Object[] getFullElements() { + public Object[] getFullElements() { return getFullNonNullStringElements(); } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return getOtherNonNullStringElements(); } diff --git a/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java b/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java index af1c1c9d0..6e7b67532 100644 --- a/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java +++ b/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java,v 1.10 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestBoundedFifoBuffer.java,v 1.11 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; /** * Test cases for BoundedFifoBuffer. * - * @version $Revision: 1.10 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.11 $ $Date: 2003/11/18 22:37:15 $ * * @author Paul Jack */ @@ -88,7 +88,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * the buffer contains the same elements in the same sequence as the * list. */ - protected void verify() { + public void verify() { super.verify(); Iterator iterator1 = collection.iterator(); Iterator iterator2 = confirmed.iterator(); @@ -105,7 +105,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer doesn't allow null elements. * @return false */ - protected boolean isNullSupported() { + public boolean isNullSupported() { return false; } @@ -113,7 +113,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer isn't fail fast. * @return false */ - protected boolean isFailFastSupported() { + public boolean isFailFastSupported() { return false; } @@ -123,7 +123,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * * @return an empty ArrayList */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new ArrayList(); } @@ -132,7 +132,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * * @return a full ArrayList */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Collection c = makeConfirmedCollection(); c.addAll(java.util.Arrays.asList(getFullElements())); return c; @@ -143,7 +143,7 @@ public class TestBoundedFifoBuffer extends AbstractTestCollection { * * @return an empty BoundedFifoBuffer */ - protected Collection makeCollection() { + public Collection makeCollection() { return new BoundedFifoBuffer(100); } diff --git a/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java b/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java index 09c7e2a29..ed1dc3d01 100644 --- a/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java +++ b/src/test/org/apache/commons/collections/TestCircularFifoBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestCircularFifoBuffer.java,v 1.6 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestCircularFifoBuffer.java,v 1.7 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; /** * Test cases for CircularFifoBuffer. * - * @version $Revision: 1.6 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:16 $ * * @author Stephen Colebourne */ @@ -89,7 +89,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * the buffer contains the same elements in the same sequence as the * list. */ - protected void verify() { + public void verify() { super.verify(); Iterator iterator1 = collection.iterator(); Iterator iterator2 = confirmed.iterator(); @@ -106,7 +106,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer doesn't allow null elements. * @return false */ - protected boolean isNullSupported() { + public boolean isNullSupported() { return false; } @@ -114,7 +114,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer isn't fail fast. * @return false */ - protected boolean isFailFastSupported() { + public boolean isFailFastSupported() { return false; } @@ -124,7 +124,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * * @return an empty ArrayList */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new ArrayList(); } @@ -133,7 +133,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * * @return a full ArrayList */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Collection c = makeConfirmedCollection(); c.addAll(java.util.Arrays.asList(getFullElements())); return c; @@ -144,7 +144,7 @@ public class TestCircularFifoBuffer extends AbstractTestCollection { * * @return an empty BoundedFifoBuffer */ - protected Collection makeCollection() { + public Collection makeCollection() { return new CircularFifoBuffer(100); } diff --git a/src/test/org/apache/commons/collections/TestCursorableLinkedList.java b/src/test/org/apache/commons/collections/TestCursorableLinkedList.java index 274217542..bd092830c 100644 --- a/src/test/org/apache/commons/collections/TestCursorableLinkedList.java +++ b/src/test/org/apache/commons/collections/TestCursorableLinkedList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCursorableLinkedList.java,v 1.15 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCursorableLinkedList.java,v 1.16 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import org.apache.commons.collections.list.AbstractTestList; /** * Test class. * - * @version $Revision: 1.15 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.16 $ $Date: 2003/11/18 22:37:15 $ * * @author Rodney Waldhoff * @author Simon Kitching @@ -1058,7 +1058,7 @@ public class TestCursorableLinkedList extends AbstractTestList { * * @return an array of sublist serialization test names */ - protected String[] ignoredTests() { + public String[] ignoredTests() { ArrayList list = new ArrayList(); String prefix = "TestCursorableLinkedList"; String bulk = ".bulkTestSubList"; diff --git a/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java b/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java index 0d2fece7f..fc82074a4 100644 --- a/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java +++ b/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java,v 1.12 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java,v 1.13 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -79,7 +79,7 @@ import org.apache.commons.collections.map.AbstractTestMap; * Map that does not support duplicate keys, duplicate * values, or null values. * - * @version $Revision: 1.12 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.13 $ $Date: 2003/11/18 22:37:15 $ * * @author Marc Johnson * @author Stephen Colebourne @@ -107,7 +107,7 @@ public class TestDoubleOrderedMap extends AbstractTestMap { /** * The default comparator in double ordered map does not allow null keys. **/ - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } @@ -115,14 +115,14 @@ public class TestDoubleOrderedMap extends AbstractTestMap { * The default comparator in double ordered map does not allow null keys, * and values are keys in this map. **/ - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return false; } /** * Double ordered map does not support duplicate values **/ - protected boolean isAllowDuplicateValues() { + public boolean isAllowDuplicateValues() { return false; } @@ -134,18 +134,18 @@ public class TestDoubleOrderedMap extends AbstractTestMap { * differs from the standard Map contract which would replace the value * for that key and return it. */ - protected boolean isPutChangeSupported() { + public boolean isPutChangeSupported() { return false; } /** * setValue() is not supported as it can change the map. */ - protected boolean isSetValueSupported() { + public boolean isSetValueSupported() { return false; } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new DoubleOrderedMap(); } diff --git a/src/test/org/apache/commons/collections/TestFlat3Map.java b/src/test/org/apache/commons/collections/TestFlat3Map.java index f1db233ac..6cace2205 100644 --- a/src/test/org/apache/commons/collections/TestFlat3Map.java +++ b/src/test/org/apache/commons/collections/TestFlat3Map.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestFlat3Map.java,v 1.3 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestFlat3Map.java,v 1.4 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.map.AbstractTestMap; /** * JUnit tests. * - * @version $Revision: 1.3 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:16 $ * * @author Stephen Colebourne */ @@ -87,7 +87,7 @@ public class TestFlat3Map extends AbstractTestMap { return BulkTest.makeSuite(TestFlat3Map.class); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new Flat3Map(); } @@ -101,39 +101,39 @@ public class TestFlat3Map extends AbstractTestMap { super("TestFlatMapIterator"); } - protected Object[] addSetValues() { + public Object[] addSetValues() { return TestFlat3Map.this.getNewSampleValues(); } - protected boolean supportsRemove() { + public boolean supportsRemove() { return TestFlat3Map.this.isRemoveSupported(); } - protected boolean supportsSetValue() { + public boolean supportsSetValue() { return TestFlat3Map.this.isSetValueSupported(); } - protected MapIterator makeEmptyMapIterator() { + public MapIterator makeEmptyMapIterator() { resetEmpty(); return ((Flat3Map) TestFlat3Map.this.map).mapIterator(); } - protected MapIterator makeFullMapIterator() { + public MapIterator makeFullMapIterator() { resetFull(); return ((Flat3Map) TestFlat3Map.this.map).mapIterator(); } - protected Map getMap() { + public Map getMap() { // assumes makeFullMapIterator() called first return TestFlat3Map.this.map; } - protected Map getConfirmedMap() { + public Map getConfirmedMap() { // assumes makeFullMapIterator() called first return TestFlat3Map.this.confirmed; } - protected void verify() { + public void verify() { super.verify(); TestFlat3Map.this.verify(); } diff --git a/src/test/org/apache/commons/collections/TestHashBag.java b/src/test/org/apache/commons/collections/TestHashBag.java index 40cf13020..e3b2a70b2 100644 --- a/src/test/org/apache/commons/collections/TestHashBag.java +++ b/src/test/org/apache/commons/collections/TestHashBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestHashBag.java,v 1.7 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestHashBag.java,v 1.8 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -66,7 +66,7 @@ import org.apache.commons.collections.bag.AbstractTestBag; * Extension of {@link TestBag} for exercising the {@link HashBag} * implementation. * - * @version $Revision: 1.7 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.8 $ $Date: 2003/11/18 22:37:16 $ * * @author Chuck Burdick */ @@ -85,7 +85,7 @@ public class TestHashBag extends AbstractTestBag { junit.textui.TestRunner.main(testCaseName); } - protected Bag makeBag() { + public Bag makeBag() { return new HashBag(); } diff --git a/src/test/org/apache/commons/collections/TestLRUMap.java b/src/test/org/apache/commons/collections/TestLRUMap.java index 9b932e9ee..53e3cd2a6 100644 --- a/src/test/org/apache/commons/collections/TestLRUMap.java +++ b/src/test/org/apache/commons/collections/TestLRUMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestLRUMap.java,v 1.26 2003/11/01 18:47:18 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestLRUMap.java,v 1.27 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import junit.framework.Test; /** * Tests LRUMap. * - * @version $Revision: 1.26 $ $Date: 2003/11/01 18:47:18 $ + * @version $Revision: 1.27 $ $Date: 2003/11/18 22:37:15 $ * * @author James Strachan * @author Morgan Delagrange @@ -98,7 +98,7 @@ public class TestLRUMap extends TestSequencedHashMap { /** * Override as test uses iterator() and getKey() in combination which doesn't work. */ - protected String[] ignoredTests() { + public String[] ignoredTests() { return new String[] {"TestLRUMap.bulkTestMapEntrySet.testMapEntrySetIteratorEntry"}; } diff --git a/src/test/org/apache/commons/collections/TestLinkedList.java b/src/test/org/apache/commons/collections/TestLinkedList.java index f911b6a1e..c353916d5 100644 --- a/src/test/org/apache/commons/collections/TestLinkedList.java +++ b/src/test/org/apache/commons/collections/TestLinkedList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestLinkedList.java,v 1.6 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestLinkedList.java,v 1.7 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -75,7 +75,7 @@ import org.apache.commons.collections.list.AbstractTestList; * you may still use this base set of cases. Simply override the * test case (method) your {@link List} fails. * - * @version $Revision: 1.6 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:15 $ * * @author Rich Dougherty */ @@ -85,11 +85,11 @@ public abstract class TestLinkedList extends AbstractTestList { super(testName); } - protected List makeEmptyList() { + public List makeEmptyList() { return makeEmptyLinkedList(); } - protected List makeFullList() { + public List makeFullList() { return makeFullLinkedList(); } @@ -261,14 +261,14 @@ public abstract class TestLinkedList extends AbstractTestList { /** * Returns an empty {@link ArrayList}. */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new LinkedList(); } /** * Returns a full {@link ArrayList}. */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { List list = new LinkedList(); list.addAll(Arrays.asList(getFullElements())); return list; diff --git a/src/test/org/apache/commons/collections/TestMultiHashMap.java b/src/test/org/apache/commons/collections/TestMultiHashMap.java index d09692b9a..3b598b9b8 100644 --- a/src/test/org/apache/commons/collections/TestMultiHashMap.java +++ b/src/test/org/apache/commons/collections/TestMultiHashMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestMultiHashMap.java,v 1.14 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestMultiHashMap.java,v 1.15 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.map.AbstractTestMap; /** * Unit Tests for MultiHashMap. * - * @version $Revision: 1.14 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.15 $ $Date: 2003/11/18 22:37:16 $ * * @author Unknown */ @@ -93,7 +93,7 @@ public class TestMultiHashMap extends AbstractTestMap { return "2"; } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new MultiHashMap(); } diff --git a/src/test/org/apache/commons/collections/TestReferenceMap.java b/src/test/org/apache/commons/collections/TestReferenceMap.java index abbb827c7..09947260b 100644 --- a/src/test/org/apache/commons/collections/TestReferenceMap.java +++ b/src/test/org/apache/commons/collections/TestReferenceMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestReferenceMap.java,v 1.14 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestReferenceMap.java,v 1.15 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -67,7 +67,7 @@ import org.apache.commons.collections.map.AbstractTestMap; /** * Tests for ReferenceMap. * - * @version $Revision: 1.14 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.15 $ $Date: 2003/11/18 22:37:15 $ * * @author Paul Jack */ @@ -86,7 +86,7 @@ public class TestReferenceMap extends AbstractTestMap { junit.textui.TestRunner.main(testCaseName); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { ReferenceMap map = new ReferenceMap(ReferenceMap.WEAK, ReferenceMap.WEAK); return map; } diff --git a/src/test/org/apache/commons/collections/TestSequencedHashMap.java b/src/test/org/apache/commons/collections/TestSequencedHashMap.java index 561a33a4a..1879ee896 100644 --- a/src/test/org/apache/commons/collections/TestSequencedHashMap.java +++ b/src/test/org/apache/commons/collections/TestSequencedHashMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java,v 1.23 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java,v 1.24 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.map.AbstractTestMap; * Be sure to use the "labRat" instance whenever possible, * so that subclasses will be tested correctly. * - * @version $Revision: 1.23 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.24 $ $Date: 2003/11/18 22:37:15 $ * * @author Morgan Delagrange * @author Daniel Rall @@ -112,7 +112,7 @@ public class TestSequencedHashMap extends AbstractTestMap { labRat = (SequencedHashMap) makeEmptyMap(); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new SequencedHashMap(); } @@ -229,7 +229,7 @@ public class TestSequencedHashMap extends AbstractTestMap { assertEquals("test with non-existing key failed", -1, labRat.indexOf("NonExistingKey")); } - protected void tearDown() throws Exception { + public void tearDown() throws Exception { labRat = null; } } diff --git a/src/test/org/apache/commons/collections/TestStaticBucketMap.java b/src/test/org/apache/commons/collections/TestStaticBucketMap.java index e81c91ef0..d5d534022 100644 --- a/src/test/org/apache/commons/collections/TestStaticBucketMap.java +++ b/src/test/org/apache/commons/collections/TestStaticBucketMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestStaticBucketMap.java,v 1.8 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestStaticBucketMap.java,v 1.9 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -67,7 +67,7 @@ import org.apache.commons.collections.map.AbstractTestMap; * Unit tests * {@link org.apache.commons.collections.StaticBucketMap}. * - * @version $Revision: 1.8 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.9 $ $Date: 2003/11/18 22:37:16 $ * * @author Michael A. Smith */ @@ -86,11 +86,11 @@ public class TestStaticBucketMap extends AbstractTestMap { junit.textui.TestRunner.main(testCaseName); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return new StaticBucketMap(30); } - protected String[] ignoredTests() { + public String[] ignoredTests() { String pre = "TestStaticBucketMap.bulkTestMap"; String post = ".testCollectionIteratorFailFast"; return new String[] { diff --git a/src/test/org/apache/commons/collections/TestTreeBag.java b/src/test/org/apache/commons/collections/TestTreeBag.java index 07c0f2056..913294a27 100644 --- a/src/test/org/apache/commons/collections/TestTreeBag.java +++ b/src/test/org/apache/commons/collections/TestTreeBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestTreeBag.java,v 1.7 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestTreeBag.java,v 1.8 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -66,7 +66,7 @@ import org.apache.commons.collections.bag.AbstractTestBag; * Extension of {@link TestBag} for exercising the {@link TreeBag} * implementation. * - * @version $Revision: 1.7 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.8 $ $Date: 2003/11/18 22:37:16 $ * * @author Chuck Burdick */ @@ -85,7 +85,7 @@ public class TestTreeBag extends AbstractTestBag { junit.textui.TestRunner.main(testCaseName); } - protected Bag makeBag() { + public Bag makeBag() { return new TreeBag(); } diff --git a/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java b/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java index 589f6998e..c96b26de6 100644 --- a/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java +++ b/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java,v 1.9 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestUnboundedFifoBuffer.java,v 1.10 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; /** * Test cases for UnboundedFifoBuffer. * - * @version $Revision: 1.9 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.10 $ $Date: 2003/11/18 22:37:16 $ * * @author Unknown */ @@ -87,7 +87,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * Verifies that the ArrayList has the same elements in the same * sequence as the UnboundedFifoBuffer. */ - protected void verify() { + public void verify() { super.verify(); Iterator iterator1 = collection.iterator(); Iterator iterator2 = confirmed.iterator(); @@ -104,7 +104,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer doesn't allow null elements. * @return false */ - protected boolean isNullSupported() { + public boolean isNullSupported() { return false; } @@ -112,7 +112,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * Overridden because UnboundedFifoBuffer isn't fail fast. * @return false */ - protected boolean isFailFastSupported() { + public boolean isFailFastSupported() { return false; } @@ -122,7 +122,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * * @return an empty ArrayList */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new ArrayList(); } @@ -131,7 +131,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * * @return a full ArrayList */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Collection c = makeConfirmedCollection(); c.addAll(java.util.Arrays.asList(getFullElements())); return c; @@ -142,7 +142,7 @@ public class TestUnboundedFifoBuffer extends AbstractTestCollection { * * @return an empty UnboundedFifoBuffer */ - protected Collection makeCollection() { + public Collection makeCollection() { return new UnboundedFifoBuffer(5); } diff --git a/src/test/org/apache/commons/collections/bag/AbstractTestBag.java b/src/test/org/apache/commons/collections/bag/AbstractTestBag.java index cbff3a5e0..46c623f5d 100644 --- a/src/test/org/apache/commons/collections/bag/AbstractTestBag.java +++ b/src/test/org/apache/commons/collections/bag/AbstractTestBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/AbstractTestBag.java,v 1.1 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/AbstractTestBag.java,v 1.2 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -75,7 +75,7 @@ import org.apache.commons.collections.Bag; * you may still use this base set of cases. Simply override the * test case (method) your {@link Bag} fails. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:15 $ * * @author Chuck Burdick * @author Stephen Colebourne @@ -101,14 +101,14 @@ public abstract class AbstractTestBag extends AbstractTestObject { * * @return the bag to be tested */ - protected abstract Bag makeBag(); + public abstract Bag makeBag(); /** * Implements the superclass method to return the Bag. * * @return the bag to be tested */ - protected Object makeObject() { + public Object makeObject() { return makeBag(); } diff --git a/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java b/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java index c3a1fdb19..7482009a7 100644 --- a/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestPredicatedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.PredicateUtils; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Phil Steitz */ @@ -107,7 +107,7 @@ public class TestPredicatedBag extends AbstractTestBag { return PredicatedBag.decorate(bag, predicate); } - protected Bag makeBag() { + public Bag makeBag() { return decorateBag(new HashBag(), truePredicate); } diff --git a/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java b/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java index a7bf7c790..1a06f7f65 100644 --- a/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestPredicatedSortedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.TreeBag; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Phil Steitz */ @@ -111,7 +111,7 @@ public class TestPredicatedSortedBag extends AbstractTestSortedBag { return PredicatedSortedBag.decorate(bag, predicate); } - protected Bag makeBag() { + public Bag makeBag() { return decorateBag(emptyBag, truePredicate); } diff --git a/src/test/org/apache/commons/collections/bag/TestTransformedBag.java b/src/test/org/apache/commons/collections/bag/TestTransformedBag.java index 6db482bdf..2e3da3289 100644 --- a/src/test/org/apache/commons/collections/bag/TestTransformedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestTransformedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTransformedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTransformedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Stephen Colebourne */ @@ -88,7 +88,7 @@ public class TestTransformedBag extends AbstractTestBag { junit.textui.TestRunner.main(testCaseName); } - protected Bag makeBag() { + public Bag makeBag() { return TransformedBag.decorate(new HashBag(), TestTransformedCollection.NOOP_TRANSFORMER); } diff --git a/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java b/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java index 5dd650548..12c80eba2 100644 --- a/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Stephen Colebourne */ @@ -88,7 +88,7 @@ public class TestTransformedSortedBag extends AbstractTestSortedBag { junit.textui.TestRunner.main(testCaseName); } - protected Bag makeBag() { + public Bag makeBag() { return TransformedSortedBag.decorate(new TreeBag(), TestTransformedCollection.NOOP_TRANSFORMER); } diff --git a/src/test/org/apache/commons/collections/bag/TestTypedBag.java b/src/test/org/apache/commons/collections/bag/TestTypedBag.java index 74f0f11eb..5b8d82e37 100644 --- a/src/test/org/apache/commons/collections/bag/TestTypedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestTypedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTypedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTypedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import org.apache.commons.collections.HashBag; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Phil Steitz */ @@ -99,7 +99,7 @@ public class TestTypedBag extends AbstractTestBag { return TypedBag.decorate(bag, claz); } - protected Bag makeBag() { + public Bag makeBag() { return decorateBag(new HashBag(), objectClass); } diff --git a/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java b/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java index 4377a385b..42b1439b8 100644 --- a/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java +++ b/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.TreeBag; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ * * @author Phil Steitz */ @@ -102,7 +102,7 @@ public class TestTypedSortedBag extends AbstractTestSortedBag { return TypedSortedBag.decorate(bag, claz); } - protected Bag makeBag() { + public Bag makeBag() { return decorateBag(emptyBag, objectClass); } diff --git a/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java b/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java index 1d20fbc16..e554cb7d1 100644 --- a/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java,v 1.3 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.map.AbstractTestMap; /** * Abstract test class for {@link BidiMap} methods and contracts. * - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:16 $ * * @author Matthew Hawthorne * @author Stephen Colebourne @@ -109,14 +109,14 @@ public abstract class AbstractTestBidiMap extends AbstractTestMap { * * @return an empty BidiMap implementation. */ - protected abstract BidiMap makeEmptyBidiMap(); + public abstract BidiMap makeEmptyBidiMap(); /** * Override to create a full BidiMap other than the default. * * @return a full BidiMap implementation. */ - protected BidiMap makeFullBidiMap() { + public BidiMap makeFullBidiMap() { final BidiMap map = makeEmptyBidiMap(); for (int i = 0; i < entries.length; i++) { map.put(entries[i][0], entries[i][1]); @@ -127,21 +127,21 @@ public abstract class AbstractTestBidiMap extends AbstractTestMap { /** * Override to return the empty BidiMap. */ - protected final Map makeEmptyMap() { + public final Map makeEmptyMap() { return makeEmptyBidiMap(); } /** * Override to indicate to AbstractTestMap this is a BidiMap. */ - protected boolean isAllowDuplicateValues() { + public boolean isAllowDuplicateValues() { return false; } /** * Override as DualHashBidiMap didn't exist until version 3. */ - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return "3"; } @@ -183,12 +183,12 @@ public abstract class AbstractTestBidiMap extends AbstractTestMap { *

* This implementation checks the inverse map as well. */ - protected void verify() { + public void verify() { verifyInverse(); super.verify(); } - protected void verifyInverse() { + public void verifyInverse() { assertEquals(map.size(), ((BidiMap) map).inverseBidiMap().size()); Map map1 = new HashMap(map); Map map2 = new HashMap(((BidiMap) map).inverseBidiMap()); @@ -441,38 +441,38 @@ public abstract class AbstractTestBidiMap extends AbstractTestMap { super(); this.main = main; } - protected BidiMap makeEmptyBidiMap() { + public BidiMap makeEmptyBidiMap() { return main.makeEmptyBidiMap().inverseBidiMap(); } - protected BidiMap makeFullBidiMap() { + public BidiMap makeFullBidiMap() { return main.makeFullBidiMap().inverseBidiMap(); } - protected Object[] getSampleKeys() { + public Object[] getSampleKeys() { return main.getSampleValues(); } - protected Object[] getSampleValues() { + public Object[] getSampleValues() { return main.getSampleKeys(); } - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return main.getCompatibilityVersion(); } - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return main.isAllowNullKey(); } - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return main.isAllowNullValue(); } - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return main.isPutAddSupported(); } - protected boolean isPutChangeSupported() { + public boolean isPutChangeSupported() { return main.isPutChangeSupported(); } - protected boolean isSetValueSupported() { + public boolean isSetValueSupported() { return main.isSetValueSupported(); } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return main.isRemoveSupported(); } @@ -488,39 +488,39 @@ public abstract class AbstractTestBidiMap extends AbstractTestMap { super("TestBidiMapIterator"); } - protected Object[] addSetValues() { + public Object[] addSetValues() { return AbstractTestBidiMap.this.getNewSampleValues(); } - protected boolean supportsRemove() { + public boolean supportsRemove() { return AbstractTestBidiMap.this.isRemoveSupported(); } - protected boolean supportsSetValue() { + public boolean supportsSetValue() { return AbstractTestBidiMap.this.isSetValueSupported(); } - protected MapIterator makeEmptyMapIterator() { + public MapIterator makeEmptyMapIterator() { resetEmpty(); return ((BidiMap) AbstractTestBidiMap.this.map).mapIterator(); } - protected MapIterator makeFullMapIterator() { + public MapIterator makeFullMapIterator() { resetFull(); return ((BidiMap) AbstractTestBidiMap.this.map).mapIterator(); } - protected Map getMap() { + public Map getMap() { // assumes makeFullMapIterator() called first return AbstractTestBidiMap.this.map; } - protected Map getConfirmedMap() { + public Map getConfirmedMap() { // assumes makeFullMapIterator() called first return AbstractTestBidiMap.this.confirmed; } - protected void verify() { + public void verify() { super.verify(); AbstractTestBidiMap.this.verify(); } diff --git a/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java b/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java index 61158a975..04a7f876b 100644 --- a/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java,v 1.3 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/AbstractTestSortedBidiMap.java,v 1.4 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -75,7 +75,7 @@ import org.apache.commons.collections.map.AbstractTestSortedMap; /** * Abstract test class for {@link SortedBidiMap} methods and contracts. * - * @version $Revision: 1.3 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:16 $ * * @author Matthew Hawthorne * @author Stephen Colebourne @@ -119,13 +119,13 @@ public abstract class AbstractTestSortedBidiMap extends AbstractTestOrderedBidiM } //----------------------------------------------------------------------- - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return false; } - protected Map makeConfirmedMap() { + public Map makeConfirmedMap() { return new TreeMap(); } diff --git a/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java b/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java index f50a4d28f..ed39d48f5 100644 --- a/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java,v 1.1 2003/11/16 20:35:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestDualHashBidiMap.java,v 1.2 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -65,7 +65,7 @@ import org.apache.commons.collections.BulkTest; /** * JUnit tests. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 20:35:46 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:16 $ * * @author Matthew Hawthorne * @author Stephen Colebourne @@ -84,14 +84,14 @@ public class TestDualHashBidiMap extends AbstractTestBidiMap { super(testName); } - protected BidiMap makeEmptyBidiMap() { + public BidiMap makeEmptyBidiMap() { return new DualHashBidiMap(); } /** * Override to prevent infinite recursion of tests. */ - protected String[] ignoredTests() { + public String[] ignoredTests() { return new String[] {"TestDualHashBidiMap.bulkTestInverseMap.bulkTestInverseMap"}; } diff --git a/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java b/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java index 36d2a9a2a..bd7754f7a 100644 --- a/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java,v 1.1 2003/11/16 20:35:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestDualTreeBidiMap.java,v 1.2 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -65,7 +65,7 @@ import org.apache.commons.collections.BulkTest; /** * JUnit tests. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 20:35:46 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:16 $ * * @author Matthew Hawthorne * @author Stephen Colebourne @@ -84,14 +84,14 @@ public class TestDualTreeBidiMap extends AbstractTestSortedBidiMap { super(testName); } - protected BidiMap makeEmptyBidiMap() { + public BidiMap makeEmptyBidiMap() { return new DualTreeBidiMap(); } /** * Override to prevent infinite recursion of tests. */ - protected String[] ignoredTests() { + public String[] ignoredTests() { return new String[] {"TestDualTreeBidiMap.bulkTestInverseMap.bulkTestInverseMap"}; } diff --git a/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java b/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java index e537d2cc8..147a2102c 100644 --- a/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java,v 1.1 2003/11/16 20:35:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java,v 1.2 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import org.apache.commons.collections.BulkTest; /** * JUnit tests. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 20:35:46 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:16 $ * * @author Stephen Colebourne */ @@ -86,30 +86,30 @@ public class TestTreeBidiMap extends AbstractTestBidiMap { super(testName); } - protected BidiMap makeEmptyBidiMap() { + public BidiMap makeEmptyBidiMap() { return new TreeBidiMap(); } - protected Map makeConfirmedMap() { + public Map makeConfirmedMap() { return new TreeMap(); } /** * Override to prevent infinite recursion of tests. */ - protected String[] ignoredTests() { + public String[] ignoredTests() { return new String[] {"TestTreeBidiMap.bulkTestInverseMap.bulkTestInverseMap"}; } - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return false; } - protected boolean isSetValueSupported() { + public boolean isSetValueSupported() { return false; } diff --git a/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java b/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java index fdac1ae2f..57be8ff89 100644 --- a/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java +++ b/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java,v 1.1 2003/11/16 00:05:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/buffer/TestBlockingBuffer.java,v 1.2 2003/11/18 22:37:16 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -75,7 +75,7 @@ import org.apache.commons.collections.BufferUnderflowException; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * * @author Janek Bogucki * @author Phil Steitz @@ -95,7 +95,7 @@ public class TestBlockingBuffer extends AbstractTestObject { junit.textui.TestRunner.main(testCaseName); } - protected Object makeObject() { + public Object makeObject() { return BlockingBuffer.decorate(new MyBuffer()); } diff --git a/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java b/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java index f2370f6f8..76027dcaa 100644 --- a/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java +++ b/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java,v 1.1 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java,v 1.2 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -78,7 +78,7 @@ import org.apache.commons.collections.AbstractTestObject; * You should create a concrete subclass of this class to test any custom * {@link Collection} implementation. At minimum, you'll have to * implement the {@link #makeCollection()} method. You might want to - * override some of the additional protected methods as well: + * override some of the additional public methods as well: *

* Element Population Methods *

@@ -149,7 +149,7 @@ import org.apache.commons.collections.AbstractTestObject; * you may still use this base set of cases. Simply override the * test case (method) your {@link Collection} fails. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:18 $ * * @author Rodney Waldhoff * @author Paul Jack @@ -176,7 +176,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { /** * A collection instance that will be used for testing. */ - protected Collection collection; + public Collection collection; /** * Confirmed collection. This is an instance of a collection that is @@ -186,7 +186,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * collection, and then calling verify() to make sure your collection * still matches the confirmed collection. */ - protected Collection confirmed; + public Collection confirmed; /** * JUnit constructor. @@ -220,7 +220,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * should provide additional tests on iterator.remove() to make sure the * proper elements are removed when remove() is called on the iterator. **/ - protected boolean areEqualElementsDistinguishable() { + public boolean areEqualElementsDistinguishable() { return false; } @@ -232,7 +232,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * Default implementation returns true. Override if your collection * class does not support add or addAll. */ - protected boolean isAddSupported() { + public boolean isAddSupported() { return true; } @@ -245,7 +245,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * Default implementation returns true. Override if your collection * class does not support removal operations. */ - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return true; } @@ -253,7 +253,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * Returns true to indicate that the collection supports holding null. * The default implementation returns true; */ - protected boolean isNullSupported() { + public boolean isNullSupported() { return true; } @@ -261,7 +261,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * Returns true to indicate that the collection supports fail fast iterators. * The default implementation returns true; */ - protected boolean isFailFastSupported() { + public boolean isFailFastSupported() { return false; } @@ -270,7 +270,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * Verifies that {@link #collection} and {@link #confirmed} have * identical state. */ - protected void verify() { + public void verify() { int confirmedSize = confirmed.size(); assertEquals("Collection size should match confirmed collection's", confirmedSize, collection.size()); @@ -345,7 +345,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * collections. Invoke this method before performing a modification * test. */ - protected void resetEmpty() { + public void resetEmpty() { this.collection = makeCollection(); this.confirmed = makeConfirmedCollection(); } @@ -355,7 +355,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * collections. Invoke this method before performing a modification * test. */ - protected void resetFull() { + public void resetFull() { this.collection = makeFullCollection(); this.confirmed = makeConfirmedFullCollection(); } @@ -368,7 +368,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * * @return a confirmed empty collection */ - protected abstract Collection makeConfirmedCollection(); + public abstract Collection makeConfirmedCollection(); /** * Returns a confirmed full collection. @@ -378,12 +378,12 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * * @return a confirmed full collection */ - protected abstract Collection makeConfirmedFullCollection(); + public abstract Collection makeConfirmedFullCollection(); /** * Return a new, empty {@link Collection} to be used for testing. */ - protected abstract Collection makeCollection(); + public abstract Collection makeCollection(); /** * Returns a full collection to be used for testing. The collection @@ -393,7 +393,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * the results of {@link #getFullElements()}. Override this default * if your collection doesn't support addAll. */ - protected Collection makeFullCollection() { + public Collection makeFullCollection() { Collection c = makeCollection(); c.addAll(Arrays.asList(getFullElements())); return c; @@ -402,14 +402,14 @@ public abstract class AbstractTestCollection extends AbstractTestObject { /** * Returns an empty collection for Object tests. */ - protected Object makeObject() { + public Object makeObject() { return makeCollection(); } /** * Creates a new Map Entry that is independent of the first and the map. */ - protected Map.Entry cloneMapEntry(Map.Entry entry) { + public Map.Entry cloneMapEntry(Map.Entry entry) { HashMap map = new HashMap(); map.put(entry.getKey(), entry.getValue()); return (Map.Entry) map.entrySet().iterator().next(); @@ -426,7 +426,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * override {@link #makeFullCollection()}, you must override * this method to reflect the contents of a full collection. */ - protected Object[] getFullElements() { + public Object[] getFullElements() { if (isNullSupported()) { ArrayList list = new ArrayList(); list.addAll(Arrays.asList(getFullNonNullElements())); @@ -446,7 +446,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * to an empty or full collection, so if your collection restricts * certain kinds of elements, you should override this method. */ - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return getOtherNonNullElements(); } @@ -459,7 +459,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * the results of this method if your collection does not support * the null element. */ - protected Object[] getFullNonNullElements() { + public Object[] getFullNonNullElements() { return new Object[] { new String(""), new String("One"), @@ -487,7 +487,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * {@link #getOtherElements()}. Includes many objects * of different types. */ - protected Object[] getOtherNonNullElements() { + public Object[] getOtherNonNullElements() { return new Object[] { new Integer(0), new Float(0), @@ -507,7 +507,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * the results of this method if your collection does not support * heterogenous elements or the null element. */ - protected Object[] getFullNonNullStringElements() { + public Object[] getFullNonNullStringElements() { return new Object[] { "If","the","dull","substance","of","my","flesh","were","thought", "Injurious","distance","could","not","stop","my","way", @@ -520,7 +520,7 @@ public abstract class AbstractTestCollection extends AbstractTestObject { * the results of this method if your collection does not support * heterogenous elements or the null element. */ - protected Object[] getOtherNonNullStringElements() { + public Object[] getOtherNonNullStringElements() { return new Object[] { "For","then","despite",/* of */"space","I","would","be","brought", "From","limits","far","remote","where","thou","dost","stay" diff --git a/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java b/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java index 3ac45e95e..dd59b9042 100644 --- a/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java +++ b/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/TestCompositeCollection.java,v 1.3 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * The Apache Software License, Version 1.1 * @@ -68,7 +68,7 @@ import junit.framework.TestSuite; * {@link CompositeCollection} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:18 $ * * @author Brian McCallister * @author Phil Steitz @@ -92,11 +92,11 @@ public class TestCompositeCollection extends AbstractTestCollection { /** * Run stock collection tests without Mutator, so turn off add, remove */ - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } @@ -111,14 +111,14 @@ public class TestCompositeCollection extends AbstractTestCollection { return new HashSet(); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return new Object[] {"1", "2", "3", "4"}; } /** * Full collection consists of 5 collections, each with one element */ - protected Collection makeFullCollection() { + public Collection makeFullCollection() { CompositeCollection compositeCollection = new CompositeCollection(); Object[] elements = getFullElements(); for (int i = 0; i < elements.length; i++) { @@ -132,7 +132,7 @@ public class TestCompositeCollection extends AbstractTestCollection { /** * Full collection should look like a collection with 5 elements */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Collection collection = new HashSet(); collection.addAll(Arrays.asList(getFullElements())); return collection; diff --git a/src/test/org/apache/commons/collections/collection/TestPredicatedCollection.java b/src/test/org/apache/commons/collections/collection/TestPredicatedCollection.java index 2eec98d61..c4bb252e9 100644 --- a/src/test/org/apache/commons/collections/collection/TestPredicatedCollection.java +++ b/src/test/org/apache/commons/collections/collection/TestPredicatedCollection.java @@ -69,7 +69,7 @@ import org.apache.commons.collections.PredicateUtils; * {@link PredicatedCollection} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:18 $ * * @author Phil Steitz */ @@ -105,17 +105,17 @@ public class TestPredicatedCollection extends AbstractTestCollection { return new ArrayList(); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return new Object[] {"1", "3", "5", "7", "2", "4", "6"}; } - protected Collection makeFullCollection() { + public Collection makeFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return decorateCollection(list, truePredicate); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; diff --git a/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java b/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java index f3aa1c4e5..4ad73c732 100644 --- a/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java +++ b/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/collection/TestTransformedCollection.java,v 1.3 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.Transformer; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:18 $ * * @author Stephen Colebourne */ @@ -112,7 +112,7 @@ public class TestTransformedCollection extends AbstractTestCollection { return new ArrayList(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; @@ -122,18 +122,18 @@ public class TestTransformedCollection extends AbstractTestCollection { return TransformedCollection.decorate(new ArrayList(), NOOP_TRANSFORMER); } - protected Collection makeFullCollection() { + public Collection makeFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return TransformedCollection.decorate(list, NOOP_TRANSFORMER); } //----------------------------------------------------------------------- - protected Object[] getFullElements() { + public Object[] getFullElements() { return new Object[] {"1", "3", "5", "7", "2", "4", "6"}; } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return new Object[] {"9", "88", "678", "87", "98", "78", "99"}; } diff --git a/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java b/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java index b06ccfd26..d4c402b87 100644 --- a/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java +++ b/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java,v 1.2 2003/10/02 22:14:35 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java,v 1.3 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -92,14 +92,14 @@ public abstract class AbstractTestComparator extends AbstractTestObject { * * @return the comparator to test */ - protected abstract Comparator makeComparator(); + public abstract Comparator makeComparator(); /** * Implement this method to return a list of sorted objects. * * @return sorted objects */ - protected abstract List getComparableObjectsOrdered(); + public abstract List getComparableObjectsOrdered(); //----------------------------------------------------------------------- /** @@ -107,7 +107,7 @@ public abstract class AbstractTestComparator extends AbstractTestObject { * * @return a full iterator */ - protected Object makeObject() { + public Object makeObject() { return makeComparator(); } @@ -129,7 +129,7 @@ public abstract class AbstractTestComparator extends AbstractTestObject { * Overrides superclass to set the compatability to version 2 * as there were no Comparators in version 1.x. */ - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return "2"; } diff --git a/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java b/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java index 1ea8d74ce..36c266b6f 100644 --- a/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java +++ b/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java,v 1.6 2003/10/06 21:02:50 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestBooleanComparator.java,v 1.7 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -67,7 +67,7 @@ import junit.framework.TestSuite; /** * Tests for {@link BooleanComparator}. * - * @version $Revision: 1.6 $ $Date: 2003/10/06 21:02:50 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:18 $ * * @author Rodney Waldhoff */ @@ -87,11 +87,11 @@ public class TestBooleanComparator extends AbstractTestComparator { // collections testing framework // ------------------------------------------------------------------------ - protected Comparator makeComparator() { + public Comparator makeComparator() { return new BooleanComparator(); } - protected List getComparableObjectsOrdered() { + public List getComparableObjectsOrdered() { List list = new ArrayList(); list.add(new Boolean(false)); list.add(Boolean.FALSE); diff --git a/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java b/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java index 42d8fa517..5655514f1 100644 --- a/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java +++ b/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java,v 1.3 2003/10/01 22:14:48 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestComparableComparator.java,v 1.4 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -67,7 +67,7 @@ import junit.framework.TestSuite; /** * Tests for ComparableComparator. * - * @version $Revision: 1.3 $ $Date: 2003/10/01 22:14:48 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:18 $ * * @author Unknown */ @@ -81,11 +81,11 @@ public class TestComparableComparator extends AbstractTestComparator { return new TestSuite(TestComparableComparator.class); } - protected Comparator makeComparator() { + public Comparator makeComparator() { return new ComparableComparator(); } - protected List getComparableObjectsOrdered() { + public List getComparableObjectsOrdered() { List list = new LinkedList(); list.add(new Integer(1)); list.add(new Integer(2)); diff --git a/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java b/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java index e9949e80a..52ceb3774 100644 --- a/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java +++ b/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java,v 1.7 2003/10/01 22:14:48 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestComparatorChain.java,v 1.8 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import junit.framework.TestSuite; /** * Tests for ComparatorChain. * - * @version $Revision: 1.7 $ $Date: 2003/10/01 22:14:48 $ + * @version $Revision: 1.8 $ $Date: 2003/11/18 22:37:18 $ * * @author Unknown */ @@ -82,7 +82,7 @@ public class TestComparatorChain extends AbstractTestComparator { return new TestSuite(TestComparatorChain.class); } - protected Comparator makeComparator() { + public Comparator makeComparator() { ComparatorChain chain = new ComparatorChain(new ColumnComparator(0)); chain.addComparator(new ColumnComparator(1),true); // reverse the second column chain.addComparator(new ColumnComparator(2),false); @@ -159,7 +159,7 @@ public class TestComparatorChain extends AbstractTestComparator { assertTrue(chain.compare(new Integer(4), new Integer(4)) == 0); } - protected List getComparableObjectsOrdered() { + public List getComparableObjectsOrdered() { List list = new LinkedList(); // this is the correct order assuming a // "0th forward, 1st reverse, 2nd forward" sort diff --git a/src/test/org/apache/commons/collections/comparators/TestNullComparator.java b/src/test/org/apache/commons/collections/comparators/TestNullComparator.java index 75749940e..7cf8b93e0 100644 --- a/src/test/org/apache/commons/collections/comparators/TestNullComparator.java +++ b/src/test/org/apache/commons/collections/comparators/TestNullComparator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestNullComparator.java,v 1.6 2003/10/01 22:14:48 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestNullComparator.java,v 1.7 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -67,7 +67,7 @@ import junit.framework.TestSuite; /** * Test the NullComparator. * - * @version $Revision: 1.6 $ $Date: 2003/10/01 22:14:48 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:18 $ * * @author Michael A. Smith */ @@ -93,11 +93,11 @@ public abstract class TestNullComparator extends AbstractTestComparator { super(testName); } - protected Comparator makeComparator() { + public Comparator makeComparator() { return new NullComparator(); } - protected List getComparableObjectsOrdered() { + public List getComparableObjectsOrdered() { List list = new LinkedList(); list.add(new Integer(1)); list.add(new Integer(2)); diff --git a/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java b/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java index 0d0030dc2..2cde50bab 100644 --- a/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java +++ b/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java,v 1.6 2003/10/01 22:14:48 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/comparators/TestReverseComparator.java,v 1.7 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import junit.framework.TestSuite; /** * Tests for ReverseComparator. * - * @version $Revision: 1.6 $ $Date: 2003/10/01 22:14:48 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:18 $ * * @author Unknown */ @@ -96,11 +96,11 @@ public class TestReverseComparator extends AbstractTestComparator { * * @return Comparator that returns "natural" order */ - protected Comparator makeComparator() { + public Comparator makeComparator() { return new ReverseComparator(Collections.reverseOrder()); } - protected List getComparableObjectsOrdered() { + public List getComparableObjectsOrdered() { List list = new LinkedList(); list.add(new Integer(1)); list.add(new Integer(2)); diff --git a/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java b/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java index e6aaeeb9a..1625806f3 100644 --- a/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java +++ b/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java,v 1.4 2003/11/08 18:46:57 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestIterator.java,v 1.5 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.AbstractTestObject; * overriding the supportsXxx() methods if necessary. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2003/11/08 18:46:57 $ + * @version $Revision: 1.5 $ $Date: 2003/11/18 22:37:14 $ * * @author Morgan Delagrange * @author Stephen Colebourne @@ -93,21 +93,21 @@ public abstract class AbstractTestIterator extends AbstractTestObject { * * @return an empty iterator */ - protected abstract Iterator makeEmptyIterator(); + public abstract Iterator makeEmptyIterator(); /** * Implement this method to return an iterator over a collection with elements. * * @return a full iterator */ - protected abstract Iterator makeFullIterator(); + public abstract Iterator makeFullIterator(); /** * Implements the abstract superclass method to return the full iterator. * * @return a full iterator */ - protected Object makeObject() { + public Object makeObject() { return makeFullIterator(); } @@ -117,7 +117,7 @@ public abstract class AbstractTestIterator extends AbstractTestObject { * * @return true if Iterator can be empty */ - protected boolean supportsEmptyIterator() { + public boolean supportsEmptyIterator() { return true; } @@ -127,7 +127,7 @@ public abstract class AbstractTestIterator extends AbstractTestObject { * * @return true if Iterator can be full */ - protected boolean supportsFullIterator() { + public boolean supportsFullIterator() { return true; } @@ -137,14 +137,14 @@ public abstract class AbstractTestIterator extends AbstractTestObject { * * @return true if Iterator supports remove */ - protected boolean supportsRemove() { + public boolean supportsRemove() { return true; } /** * Allows subclasses to add complex cross verification */ - protected void verify() { + public void verify() { // do nothing } diff --git a/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java b/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java index 297396e42..da2255f2a 100644 --- a/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java +++ b/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java,v 1.3 2003/10/09 20:18:25 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestListIterator.java,v 1.4 2003/11/18 22:37:13 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import java.util.NoSuchElementException; * overriding the supportsXxx() methods if necessary. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2003/10/09 20:18:25 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:13 $ * * @author Rodney Waldhoff * @author Stephen Colebourne @@ -93,21 +93,21 @@ public abstract class AbstractTestListIterator extends AbstractTestIterator { * * @return an empty iterator */ - protected abstract ListIterator makeEmptyListIterator(); + public abstract ListIterator makeEmptyListIterator(); /** * Implement this method to return a list iterator over a collection with elements. * * @return a full iterator */ - protected abstract ListIterator makeFullListIterator(); + public abstract ListIterator makeFullListIterator(); /** * Implements the abstract superclass method to return the list iterator. * * @return an empty iterator */ - protected Iterator makeEmptyIterator() { + public Iterator makeEmptyIterator() { return makeEmptyListIterator(); } @@ -116,7 +116,7 @@ public abstract class AbstractTestListIterator extends AbstractTestIterator { * * @return a full iterator */ - protected Iterator makeFullIterator() { + public Iterator makeFullIterator() { return makeFullListIterator(); } @@ -126,7 +126,7 @@ public abstract class AbstractTestListIterator extends AbstractTestIterator { * * @return true if Iterator supports add */ - protected boolean supportsAdd() { + public boolean supportsAdd() { return true; } @@ -136,7 +136,7 @@ public abstract class AbstractTestListIterator extends AbstractTestIterator { * * @return true if Iterator supports set */ - protected boolean supportsSet() { + public boolean supportsSet() { return true; } @@ -144,7 +144,7 @@ public abstract class AbstractTestListIterator extends AbstractTestIterator { * The value to be used in the add and set tests. * Default is null. */ - protected Object addSetValue() { + public Object addSetValue() { return null; } diff --git a/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java b/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java index 9632e80d6..4ec9ff9cf 100644 --- a/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java +++ b/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java,v 1.3 2003/11/08 18:46:57 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/AbstractTestMapIterator.java,v 1.4 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import java.util.Set; * overriding the supportsXxx() methods if necessary. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2003/11/08 18:46:57 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:14 $ * * @author Stephen Colebourne */ @@ -93,14 +93,14 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * * @return an empty iterator */ - protected abstract MapIterator makeEmptyMapIterator(); + public abstract MapIterator makeEmptyMapIterator(); /** * Implement this method to return a map iterator over a map with elements. * * @return a full iterator */ - protected abstract MapIterator makeFullMapIterator(); + public abstract MapIterator makeFullMapIterator(); /** * Implement this method to return the map which contains the same data as the @@ -108,7 +108,7 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * * @return a full map which can be updated */ - protected abstract Map getMap(); + public abstract Map getMap(); /** * Implement this method to return the confirmed map which contains the same @@ -116,14 +116,14 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * * @return a full map which can be updated */ - protected abstract Map getConfirmedMap(); + public abstract Map getConfirmedMap(); /** * Implements the abstract superclass method to return the list iterator. * * @return an empty iterator */ - protected final Iterator makeEmptyIterator() { + public final Iterator makeEmptyIterator() { return makeEmptyMapIterator(); } @@ -132,7 +132,7 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * * @return a full iterator */ - protected final Iterator makeFullIterator() { + public final Iterator makeFullIterator() { return makeFullMapIterator(); } @@ -142,7 +142,7 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * * @return true if Iterator supports set */ - protected boolean supportsSetValue() { + public boolean supportsSetValue() { return true; } @@ -150,7 +150,7 @@ public abstract class AbstractTestMapIterator extends AbstractTestIterator { * The values to be used in the add and set tests. * Default is two strings. */ - protected Object[] addSetValues() { + public Object[] addSetValues() { return new Object[] {"A", "B"}; } diff --git a/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java b/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java index e4ea8f28d..491fa60b1 100644 --- a/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java +++ b/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java,v 1.3 2003/11/16 20:35:47 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/TestUnmodifiableMapIterator.java,v 1.4 2003/11/18 22:37:13 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import org.apache.commons.collections.bidimap.DualHashBidiMap; /** * Tests the UnmodifiableMapIterator. * - * @version $Revision: 1.3 $ $Date: 2003/11/16 20:35:47 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:13 $ * * @author Stephen Colebourne */ @@ -92,7 +92,7 @@ public class TestUnmodifiableMapIterator extends AbstractTestMapIterator { return UnmodifiableMapIterator.decorate(((BidiMap) getMap()).mapIterator()); } - protected Map getMap() { + public Map getMap() { Map testMap = new DualHashBidiMap(); testMap.put("A", "a"); testMap.put("B", "b"); @@ -100,7 +100,7 @@ public class TestUnmodifiableMapIterator extends AbstractTestMapIterator { return testMap; } - protected Map getConfirmedMap() { + public Map getConfirmedMap() { Map testMap = new HashMap(); testMap.put("A", "a"); testMap.put("B", "b"); diff --git a/src/test/org/apache/commons/collections/list/AbstractTestList.java b/src/test/org/apache/commons/collections/list/AbstractTestList.java index d25016808..62aa5d1f8 100644 --- a/src/test/org/apache/commons/collections/list/AbstractTestList.java +++ b/src/test/org/apache/commons/collections/list/AbstractTestList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/AbstractTestList.java,v 1.1 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/AbstractTestList.java,v 1.2 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -86,7 +86,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; * test case (method) your {@link List} fails or override one of the * protected methods from AbstractTestCollection. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:14 $ * * @author Rodney Waldhoff * @author Paul Jack @@ -112,7 +112,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * Default implementation returns true. Override if your collection * class does not support set. */ - protected boolean isSetSupported() { + public boolean isSetSupported() { return true; } @@ -121,7 +121,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * Verifies that the test list implementation matches the confirmed list * implementation. */ - protected void verify() { + public void verify() { super.verify(); List list1 = getList(); @@ -153,7 +153,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { /** * Returns an empty {@link ArrayList}. */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { ArrayList list = new ArrayList(); return list; } @@ -161,7 +161,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { /** * Returns a full {@link ArrayList}. */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { ArrayList list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; @@ -172,14 +172,14 @@ public abstract class AbstractTestList extends AbstractTestCollection { * * @return an empty list for testing. */ - protected abstract List makeEmptyList(); + public abstract List makeEmptyList(); /** * Return a new, full {@link List} to be used for testing. * * @return a full list for testing */ - protected List makeFullList() { + public List makeFullList() { // only works if list supports optional "addAll(Collection)" List list = makeEmptyList(); list.addAll(Arrays.asList(getFullElements())); @@ -191,7 +191,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * * @return an empty list to be used for testing */ - protected final Collection makeCollection() { + public final Collection makeCollection() { return makeEmptyList(); } @@ -200,7 +200,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * * @return a full list to be used for testing */ - protected final Collection makeFullCollection() { + public final Collection makeFullCollection() { return makeFullList(); } @@ -210,7 +210,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * * @return the collection field as a List */ - protected List getList() { + public List getList() { return (List) collection; } @@ -219,7 +219,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { * * @return the confirmed field as a List */ - protected List getConfirmedList() { + public List getConfirmedList() { return (List) confirmed; } @@ -1028,7 +1028,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { } - static class BulkTestSubList extends AbstractTestList { + public static class BulkTestSubList extends AbstractTestList { private AbstractTestList outer; @@ -1039,48 +1039,48 @@ public abstract class AbstractTestList extends AbstractTestCollection { } - protected Object[] getFullElements() { + public Object[] getFullElements() { List l = Arrays.asList(outer.getFullElements()); return l.subList(3, l.size() - 3).toArray(); } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return outer.getOtherElements(); } - protected boolean isAddSupported() { + public boolean isAddSupported() { return outer.isAddSupported(); } - protected boolean isSetSupported() { + public boolean isSetSupported() { return outer.isSetSupported(); } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return outer.isRemoveSupported(); } - protected List makeEmptyList() { + public List makeEmptyList() { return outer.makeFullList().subList(4, 4); } - protected List makeFullList() { + public List makeFullList() { int size = getFullElements().length; return outer.makeFullList().subList(3, size - 3); } - protected void resetEmpty() { + public void resetEmpty() { outer.resetFull(); this.collection = outer.getList().subList(4, 4); this.confirmed = outer.getConfirmedList().subList(4, 4); } - protected void resetFull() { + public void resetFull() { outer.resetFull(); int size = outer.confirmed.size(); this.collection = outer.getList().subList(3, size - 3); @@ -1088,7 +1088,7 @@ public abstract class AbstractTestList extends AbstractTestCollection { } - protected void verify() { + public void verify() { super.verify(); outer.verify(); } diff --git a/src/test/org/apache/commons/collections/list/TestFixedSizeList.java b/src/test/org/apache/commons/collections/list/TestFixedSizeList.java index 83c3b4b0e..e6afcb7db 100644 --- a/src/test/org/apache/commons/collections/list/TestFixedSizeList.java +++ b/src/test/org/apache/commons/collections/list/TestFixedSizeList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestFixedSizeList.java,v 1.2 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestFixedSizeList.java,v 1.3 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import junit.framework.TestSuite; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:14 $ * * @author Stephen Colebourne */ @@ -92,17 +92,17 @@ public class TestFixedSizeList extends AbstractTestList { return FixedSizeList.decorate(new ArrayList()); } - protected List makeFullList() { + public List makeFullList() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return FixedSizeList.decorate(list); } - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } diff --git a/src/test/org/apache/commons/collections/list/TestPredicatedList.java b/src/test/org/apache/commons/collections/list/TestPredicatedList.java index aafefcb83..365f637ef 100644 --- a/src/test/org/apache/commons/collections/list/TestPredicatedList.java +++ b/src/test/org/apache/commons/collections/list/TestPredicatedList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestPredicatedList.java,v 1.2 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestPredicatedList.java,v 1.3 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.PredicateUtils; * {@link PredicatedList} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:14 $ * * @author Phil Steitz */ @@ -102,7 +102,7 @@ public class TestPredicatedList extends AbstractTestList{ return decorateList(new ArrayList(), truePredicate); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return new Object[] {"1", "3", "5", "7", "2", "4", "6"}; } diff --git a/src/test/org/apache/commons/collections/list/TestSetUniqueList.java b/src/test/org/apache/commons/collections/list/TestSetUniqueList.java index fef049b1f..b8707c627 100644 --- a/src/test/org/apache/commons/collections/list/TestSetUniqueList.java +++ b/src/test/org/apache/commons/collections/list/TestSetUniqueList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestSetUniqueList.java,v 1.2 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestSetUniqueList.java,v 1.3 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import junit.textui.TestRunner; * JUnit tests. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:14 $ * * @author Matthew Hawthorne */ @@ -90,7 +90,7 @@ public class TestSetUniqueList extends AbstractTestList { } //----------------------------------------------------------------------- - protected List makeEmptyList() { + public List makeEmptyList() { return new SetUniqueList(new ArrayList(), new HashSet()); } @@ -105,7 +105,7 @@ public class TestSetUniqueList extends AbstractTestList { } catch (UnsupportedOperationException ex) {} } - protected Object[] getFullNonNullElements() { + public Object[] getFullNonNullElements() { // override to avoid duplicate "One" return new Object[] { new String(""), @@ -206,7 +206,7 @@ public class TestSetUniqueList extends AbstractTestList { } } - protected void verify() { + public void verify() { super.verify(); if (extraVerify) { diff --git a/src/test/org/apache/commons/collections/list/TestTransformedList.java b/src/test/org/apache/commons/collections/list/TestTransformedList.java index 8a1b90cc7..dac98b17e 100644 --- a/src/test/org/apache/commons/collections/list/TestTransformedList.java +++ b/src/test/org/apache/commons/collections/list/TestTransformedList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestTransformedList.java,v 1.2 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestTransformedList.java,v 1.3 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:14 $ * * @author Stephen Colebourne */ @@ -96,7 +96,7 @@ public class TestTransformedList extends AbstractTestList { return new ArrayList(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; @@ -106,7 +106,7 @@ public class TestTransformedList extends AbstractTestList { return TransformedList.decorate(new ArrayList(), TestTransformedCollection.NOOP_TRANSFORMER); } - protected List makeFullList() { + public List makeFullList() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return TransformedList.decorate(list, TestTransformedCollection.NOOP_TRANSFORMER); diff --git a/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java b/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java index d6495ffff..90b028f81 100644 --- a/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java +++ b/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java,v 1.2 2003/11/16 22:15:09 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestUnmodifiableList.java,v 1.3 2003/11/18 22:37:14 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.map.TestPredicatedSortedMap; * {@link UnmodifiableList} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:09 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:14 $ * * @author Phil Steitz */ @@ -102,15 +102,15 @@ public class TestUnmodifiableList extends AbstractTestList{ return UnmodifiableList.decorate(list); } - protected boolean isSetSupported() { + public boolean isSetSupported() { return false; } - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } //-------------------------------------------------------------------- diff --git a/src/test/org/apache/commons/collections/map/AbstractTestMap.java b/src/test/org/apache/commons/collections/map/AbstractTestMap.java index 18c3cf51c..3aa9582cf 100644 --- a/src/test/org/apache/commons/collections/map/AbstractTestMap.java +++ b/src/test/org/apache/commons/collections/map/AbstractTestMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestMap.java,v 1.1 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestMap.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -158,7 +158,7 @@ import org.apache.commons.collections.set.AbstractTestSet; * @author Rodney Waldhoff * @author Paul Jack * @author Stephen Colebourne - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ */ public abstract class AbstractTestMap extends AbstractTestObject { @@ -204,7 +204,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support put adding. */ - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return true; } @@ -217,7 +217,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support put changing. */ - protected boolean isPutChangeSupported() { + public boolean isPutChangeSupported() { return true; } @@ -230,7 +230,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Override if your collection class does not support setValue but does * support put changing. */ - protected boolean isSetValueSupported() { + public boolean isSetValueSupported() { return isPutChangeSupported(); } @@ -242,7 +242,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support removal operations. */ - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return true; } @@ -254,7 +254,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support null keys. */ - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return true; } @@ -266,7 +266,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support null values. */ - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return true; } @@ -278,7 +278,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Default implementation returns true. * Override if your collection class does not support duplicate values. */ - protected boolean isAllowDuplicateValues() { + public boolean isAllowDuplicateValues() { return true; } @@ -289,7 +289,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * default implementation constructs a set of String keys, and includes a * single null key if {@link #isAllowNullKey()} returns true. */ - protected Object[] getSampleKeys() { + public Object[] getSampleKeys() { Object[] result = new Object[] { "blah", "foo", "bar", "baz", "tmp", "gosh", "golly", "gee", "hello", "goodbye", "we'll", "see", "you", "all", "again", @@ -301,11 +301,11 @@ public abstract class AbstractTestMap extends AbstractTestObject { } - protected Object[] getOtherKeys() { + public Object[] getOtherKeys() { return getOtherNonNullStringElements(); } - protected Object[] getOtherValues() { + public Object[] getOtherValues() { return getOtherNonNullStringElements(); } @@ -317,7 +317,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * collection does not support heterogenous elements or the null element. *

*/ - protected Object[] getOtherNonNullStringElements() { + public Object[] getOtherNonNullStringElements() { return new Object[] { "For","then","despite",/* of */"space","I","would","be","brought", "From","limits","far","remote","where","thou","dost","stay" @@ -333,7 +333,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * two values that are the same if {@link #isAllowDuplicateValues()} returns * true. */ - protected Object[] getSampleValues() { + public Object[] getSampleValues() { Object[] result = new Object[] { "blahv", "foov", "barv", "bazv", "tmpv", "goshv", "gollyv", "geev", "hellov", "goodbyev", "we'llv", "seev", "youv", "allv", "againv", @@ -355,7 +355,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * that are the same if {@link #isAllowDuplicateValues()} returns * true. */ - protected Object[] getNewSampleValues() { + public Object[] getNewSampleValues() { Object[] result = new Object[] { (isAllowNullValue() && isAllowDuplicateValues()) ? null : "newnonnullvalue", "newvalue", @@ -371,7 +371,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Helper method to add all the mappings described by {@link * #getSampleKeys()} and {@link #getSampleValues()}. */ - protected void addSampleMappings(Map m) { + public void addSampleMappings(Map m) { Object[] keys = getSampleKeys(); Object[] values = getSampleValues(); @@ -405,7 +405,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * * @return the map to be tested */ - protected abstract Map makeEmptyMap(); + public abstract Map makeEmptyMap(); /** * Return a new, populated map. The mappings in the map should match the @@ -416,7 +416,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * * @return the map to be tested */ - protected Map makeFullMap() { + public Map makeFullMap() { Map m = makeEmptyMap(); addSampleMappings(m); return m; @@ -436,14 +436,14 @@ public abstract class AbstractTestMap extends AbstractTestObject { * * @return a map that is known to be valid */ - protected Map makeConfirmedMap() { + public Map makeConfirmedMap() { return new HashMap(); } /** * Creates a new Map Entry that is independent of the first and the map. */ - protected Map.Entry cloneMapEntry(Map.Entry entry) { + public Map.Entry cloneMapEntry(Map.Entry entry) { HashMap map = new HashMap(); map.put(entry.getKey(), entry.getValue()); return (Map.Entry) map.entrySet().iterator().next(); @@ -452,7 +452,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { /** * Gets the compatability version, needed for package access. */ - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return super.getCompatibilityVersion(); } //----------------------------------------------------------------------- @@ -1130,49 +1130,49 @@ public abstract class AbstractTestMap extends AbstractTestObject { } // Have to implement manually; entrySet doesn't support addAll - protected Object[] getFullElements() { + public Object[] getFullElements() { Object[] k = getSampleKeys(); Object[] v = getSampleValues(); return makeEntryArray(k, v); } // Have to implement manually; entrySet doesn't support addAll - protected Object[] getOtherElements() { + public Object[] getOtherElements() { Object[] k = getOtherKeys(); Object[] v = getOtherValues(); return makeEntryArray(k, v); } - protected Set makeEmptySet() { + public Set makeEmptySet() { return makeEmptyMap().entrySet(); } - protected Set makeFullSet() { + public Set makeFullSet() { return makeFullMap().entrySet(); } - protected boolean isAddSupported() { + public boolean isAddSupported() { // Collection views don't support add operations. return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { // Entry set should only support remove if map does return AbstractTestMap.this.isRemoveSupported(); } - protected boolean supportsEmptyCollections() { + public boolean supportsEmptyCollections() { return AbstractTestMap.this.supportsEmptyCollections(); } - protected boolean supportsFullCollections() { + public boolean supportsFullCollections() { return AbstractTestMap.this.supportsFullCollections(); } - protected void resetFull() { + public void resetFull() { AbstractTestMap.this.resetFull(); collection = map.entrySet(); TestMapEntrySet.this.confirmed = AbstractTestMap.this.confirmed.entrySet(); } - protected void resetEmpty() { + public void resetEmpty() { AbstractTestMap.this.resetEmpty(); collection = map.entrySet(); TestMapEntrySet.this.confirmed = AbstractTestMap.this.confirmed.entrySet(); @@ -1244,7 +1244,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { verify(); } - protected Map.Entry getEntry(Iterator itConfirmed, Object key) { + public Map.Entry getEntry(Iterator itConfirmed, Object key) { Map.Entry entry = null; while (itConfirmed.hasNext()) { Map.Entry temp = (Map.Entry) itConfirmed.next(); @@ -1262,7 +1262,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { return entry; } - protected void verify() { + public void verify() { super.verify(); AbstractTestMap.this.verify(); } @@ -1285,51 +1285,51 @@ public abstract class AbstractTestMap extends AbstractTestObject { public TestMapKeySet() { super(""); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return getSampleKeys(); } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return getOtherKeys(); } - protected Set makeEmptySet() { + public Set makeEmptySet() { return makeEmptyMap().keySet(); } - protected Set makeFullSet() { + public Set makeFullSet() { return makeFullMap().keySet(); } - protected boolean isNullSupported() { + public boolean isNullSupported() { return AbstractTestMap.this.isAllowNullKey(); } - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return AbstractTestMap.this.isRemoveSupported(); } - protected boolean supportsEmptyCollections() { + public boolean supportsEmptyCollections() { return AbstractTestMap.this.supportsEmptyCollections(); } - protected boolean supportsFullCollections() { + public boolean supportsFullCollections() { return AbstractTestMap.this.supportsFullCollections(); } - protected void resetEmpty() { + public void resetEmpty() { AbstractTestMap.this.resetEmpty(); collection = map.keySet(); TestMapKeySet.this.confirmed = AbstractTestMap.this.confirmed.keySet(); } - protected void resetFull() { + public void resetFull() { AbstractTestMap.this.resetFull(); collection = map.keySet(); TestMapKeySet.this.confirmed = AbstractTestMap.this.confirmed.keySet(); } - protected void verify() { + public void verify() { super.verify(); AbstractTestMap.this.verify(); } @@ -1354,67 +1354,67 @@ public abstract class AbstractTestMap extends AbstractTestObject { super(""); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return getSampleValues(); } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return getOtherValues(); } - protected Collection makeCollection() { + public Collection makeCollection() { return makeEmptyMap().values(); } - protected Collection makeFullCollection() { + public Collection makeFullCollection() { return makeFullMap().values(); } - protected boolean isNullSupported() { + public boolean isNullSupported() { return AbstractTestMap.this.isAllowNullKey(); } - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return AbstractTestMap.this.isRemoveSupported(); } - protected boolean supportsEmptyCollections() { + public boolean supportsEmptyCollections() { return AbstractTestMap.this.supportsEmptyCollections(); } - protected boolean supportsFullCollections() { + public boolean supportsFullCollections() { return AbstractTestMap.this.supportsFullCollections(); } - protected boolean areEqualElementsDistinguishable() { + public boolean areEqualElementsDistinguishable() { // equal values are associated with different keys, so they are // distinguishable. return true; } - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { // never gets called, reset methods are overridden return null; } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { // never gets called, reset methods are overridden return null; } - protected void resetFull() { + public void resetFull() { AbstractTestMap.this.resetFull(); collection = map.values(); TestMapValues.this.confirmed = AbstractTestMap.this.confirmed.values(); } - protected void resetEmpty() { + public void resetEmpty() { AbstractTestMap.this.resetEmpty(); collection = map.values(); TestMapValues.this.confirmed = AbstractTestMap.this.confirmed.values(); } - protected void verify() { + public void verify() { super.verify(); AbstractTestMap.this.verify(); } @@ -1429,7 +1429,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, * {@link #values} and {@link #confirmed} fields to empty. */ - protected void resetEmpty() { + public void resetEmpty() { this.map = makeEmptyMap(); views(); this.confirmed = makeConfirmedMap(); @@ -1439,7 +1439,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { * Resets the {@link #map}, {@link #entrySet}, {@link #keySet}, * {@link #values} and {@link #confirmed} fields to full. */ - protected void resetFull() { + public void resetFull() { this.map = makeFullMap(); views(); this.confirmed = makeConfirmedMap(); @@ -1471,14 +1471,14 @@ public abstract class AbstractTestMap extends AbstractTestObject { * compared; and containsAll tests are run on the * collection views. */ - protected void verify() { + public void verify() { verifyMap(); verifyEntrySet(); verifyKeySet(); verifyValues(); } - protected void verifyMap() { + public void verifyMap() { int size = confirmed.size(); boolean empty = confirmed.isEmpty(); assertEquals("Map should be same size as HashMap", @@ -1498,7 +1498,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { // causing LRUMap to change). } - protected void verifyEntrySet() { + public void verifyEntrySet() { int size = confirmed.size(); boolean empty = confirmed.isEmpty(); assertEquals("entrySet should be same size as HashMap's" + @@ -1517,7 +1517,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { confirmed.entrySet(), entrySet); } - protected void verifyKeySet() { + public void verifyKeySet() { int size = confirmed.size(); boolean empty = confirmed.isEmpty(); assertEquals("keySet should be same size as HashMap's" + @@ -1536,7 +1536,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { confirmed.keySet(), keySet); } - protected void verifyValues() { + public void verifyValues() { List known = new ArrayList(confirmed.values()); List test = new ArrayList(values); @@ -1566,7 +1566,7 @@ public abstract class AbstractTestMap extends AbstractTestObject { /** * Erases any leftover instance variables by setting them to null. */ - protected void tearDown() throws Exception { + public void tearDown() throws Exception { map = null; keySet = null; entrySet = null; diff --git a/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java b/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java index e92ef3711..59616b714 100644 --- a/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java +++ b/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java,v 1.1 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/AbstractTestSortedMap.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import org.apache.commons.collections.BulkTest; /** * Abstract test class for {@link java.util.SortedMap} methods and contracts. * - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -91,7 +91,7 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { * * @return false */ - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } @@ -100,7 +100,7 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { * * @return a map that is known to be valid */ - protected Map makeConfirmedMap() { + public Map makeConfirmedMap() { return new TreeMap(); } @@ -147,17 +147,17 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { super(name); this.main = main; } - protected void resetEmpty() { + public void resetEmpty() { // needed to init verify correctly main.resetEmpty(); super.resetEmpty(); } - protected void resetFull() { + public void resetFull() { // needed to init verify correctly main.resetFull(); super.resetFull(); } - protected void verify() { + public void verify() { // cross verify changes on view with changes on main map super.verify(); main.verify(); @@ -172,38 +172,38 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { return null; // block infinite recursion } - protected Object[] getSampleKeys() { + public Object[] getSampleKeys() { return subSortedKeys.toArray(); } - protected Object[] getSampleValues() { + public Object[] getSampleValues() { return subSortedValues.toArray(); } - protected Object[] getNewSampleValues() { + public Object[] getNewSampleValues() { return subSortedNewValues.toArray(); } - protected String getCompatibilityVersion() { + public String getCompatibilityVersion() { return main.getCompatibilityVersion(); } - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return main.isAllowNullKey(); } - protected boolean isAllowNullValue() { + public boolean isAllowNullValue() { return main.isAllowNullValue(); } - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return main.isPutAddSupported(); } - protected boolean isPutChangeSupported() { + public boolean isPutChangeSupported() { return main.isPutChangeSupported(); } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return main.isRemoveSupported(); } - protected boolean supportsEmptyCollections() { + public boolean supportsEmptyCollections() { return false; } - protected boolean supportsFullCollections() { + public boolean supportsFullCollections() { return false; } } @@ -225,11 +225,11 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { this.subSortedValues.subList(SUBSIZE, this.subSortedValues.size()).clear(); this.subSortedNewValues.addAll(Arrays.asList(main.getNewSampleValues()).subList(0, SUBSIZE)); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { // done this way so toKey is correctly set in the returned map return ((SortedMap) main.makeEmptyMap()).headMap(toKey); } - protected Map makeFullMap() { + public Map makeFullMap() { return ((SortedMap) main.makeFullMap()).headMap(toKey); } public void testHeadMapOutOfRange() { @@ -262,11 +262,11 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { this.subSortedValues.subList(0, this.subSortedValues.size() - SUBSIZE).clear(); this.subSortedNewValues.addAll(Arrays.asList(main.getNewSampleValues()).subList(0, SUBSIZE)); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { // done this way so toKey is correctly set in the returned map return ((SortedMap) main.makeEmptyMap()).tailMap(fromKey); } - protected Map makeFullMap() { + public Map makeFullMap() { return ((SortedMap) main.makeFullMap()).tailMap(fromKey); } public void testTailMapOutOfRange() { @@ -306,11 +306,11 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap { SUBSIZE, this.main.getNewSampleValues().length - SUBSIZE)); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { // done this way so toKey is correctly set in the returned map return ((SortedMap) main.makeEmptyMap()).subMap(fromKey, toKey); } - protected Map makeFullMap() { + public Map makeFullMap() { return ((SortedMap) main.makeFullMap()).subMap(fromKey, toKey); } public void testSubMapOutOfRange() { diff --git a/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java b/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java index d5b0a2ba7..2978154ee 100644 --- a/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java +++ b/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -68,7 +68,7 @@ import junit.framework.TestSuite; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -87,21 +87,21 @@ public class TestFixedSizeMap extends AbstractTestMap { junit.textui.TestRunner.main(testCaseName); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return FixedSizeMap.decorate(new HashMap()); } - protected Map makeFullMap() { + public Map makeFullMap() { Map map = new HashMap(); addSampleMappings(map); return FixedSizeMap.decorate(map); } - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } diff --git a/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java b/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java index c861c6d98..c5328a12a 100644 --- a/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java +++ b/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import org.apache.commons.collections.BulkTest; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -93,17 +93,17 @@ public class TestFixedSizeSortedMap extends AbstractTestSortedMap { return FixedSizeSortedMap.decorate(new TreeMap()); } - protected Map makeFullMap() { + public Map makeFullMap() { SortedMap map = new TreeMap(); addSampleMappings(map); return FixedSizeSortedMap.decorate(map); } - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } diff --git a/src/test/org/apache/commons/collections/map/TestLazyMap.java b/src/test/org/apache/commons/collections/map/TestLazyMap.java index c6ff5035f..7a80d643a 100644 --- a/src/test/org/apache/commons/collections/map/TestLazyMap.java +++ b/src/test/org/apache/commons/collections/map/TestLazyMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestLazyMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestLazyMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.FactoryUtils; * {@link LazyMap} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -99,7 +99,7 @@ public class TestLazyMap extends AbstractTestMap { return LazyMap.decorate(map, factory); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return decorateMap(new HashMap(), nullFactory); } diff --git a/src/test/org/apache/commons/collections/map/TestLazySortedMap.java b/src/test/org/apache/commons/collections/map/TestLazySortedMap.java index 777f69c11..bf8ebdd0a 100644 --- a/src/test/org/apache/commons/collections/map/TestLazySortedMap.java +++ b/src/test/org/apache/commons/collections/map/TestLazySortedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestLazySortedMap.java,v 1.1 2003/11/16 00:05:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestLazySortedMap.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -74,7 +74,7 @@ import org.apache.commons.collections.TransformerUtils; * {@link LazySortedMap} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.1 $ $Date: 2003/11/16 00:05:46 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -103,7 +103,7 @@ public class TestLazySortedMap extends TestLazyMap { return decorateMap(new TreeMap(), nullFactory); } - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } diff --git a/src/test/org/apache/commons/collections/map/TestListOrderedMap.java b/src/test/org/apache/commons/collections/map/TestListOrderedMap.java index dea4b6e50..1cd957942 100644 --- a/src/test/org/apache/commons/collections/map/TestListOrderedMap.java +++ b/src/test/org/apache/commons/collections/map/TestListOrderedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestListOrderedMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestListOrderedMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -75,7 +75,7 @@ import org.apache.commons.collections.iterators.MapIterator; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Henri Yandell * @author Stephen Colebourne @@ -109,39 +109,35 @@ public class TestListOrderedMap extends AbstractTestMap { super("TestOrderedMapIterator"); } - protected Object addSetValue() { - return TestListOrderedMap.this.getNewSampleValues()[0]; - } - - protected boolean supportsRemove() { + public boolean supportsRemove() { return TestListOrderedMap.this.isRemoveSupported(); } - protected boolean supportsSetValue() { + public boolean supportsSetValue() { return TestListOrderedMap.this.isSetValueSupported(); } - protected MapIterator makeEmptyMapIterator() { + public MapIterator makeEmptyMapIterator() { resetEmpty(); return ((ListOrderedMap) TestListOrderedMap.this.map).mapIterator(); } - protected MapIterator makeFullMapIterator() { + public MapIterator makeFullMapIterator() { resetFull(); return ((ListOrderedMap) TestListOrderedMap.this.map).mapIterator(); } - protected Map getMap() { + public Map getMap() { // assumes makeFullMapIterator() called first return TestListOrderedMap.this.map; } - protected Map getConfirmedMap() { + public Map getConfirmedMap() { // assumes makeFullMapIterator() called first return TestListOrderedMap.this.confirmed; } - protected void verify() { + public void verify() { super.verify(); TestListOrderedMap.this.verify(); } diff --git a/src/test/org/apache/commons/collections/map/TestPredicatedMap.java b/src/test/org/apache/commons/collections/map/TestPredicatedMap.java index f064a65a6..c3c72184c 100644 --- a/src/test/org/apache/commons/collections/map/TestPredicatedMap.java +++ b/src/test/org/apache/commons/collections/map/TestPredicatedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestPredicatedMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestPredicatedMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.PredicateUtils; * {@link PredicatedMap} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -100,7 +100,7 @@ public class TestPredicatedMap extends AbstractTestMap{ return PredicatedMap.decorate(map, keyPredicate, valuePredicate); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return decorateMap(new HashMap(), truePredicate, truePredicate); } diff --git a/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java b/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java index 6be2befbe..f20633c7c 100644 --- a/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java +++ b/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java,v 1.1 2003/11/16 00:05:46 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestPredicatedSortedMap.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.Predicate; * {@link PredicatedSortedMap} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.1 $ $Date: 2003/11/16 00:05:46 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -106,7 +106,7 @@ public class TestPredicatedSortedMap extends TestPredicatedMap{ return decorateMap(new TreeMap(), testPredicate, testPredicate); } - protected boolean isAllowNullKey() { + public boolean isAllowNullKey() { return false; } diff --git a/src/test/org/apache/commons/collections/map/TestTransformedMap.java b/src/test/org/apache/commons/collections/map/TestTransformedMap.java index d94180f46..5a548a904 100644 --- a/src/test/org/apache/commons/collections/map/TestTransformedMap.java +++ b/src/test/org/apache/commons/collections/map/TestTransformedMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestTransformedMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestTransformedMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -90,7 +90,7 @@ public class TestTransformedMap extends AbstractTestMap { junit.textui.TestRunner.main(testCaseName); } - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return TransformedMap.decorate(new HashMap(), TestTransformedCollection.NOOP_TRANSFORMER, TestTransformedCollection.NOOP_TRANSFORMER); } diff --git a/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java b/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java index 012233872..b4b7b6a2f 100644 --- a/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java +++ b/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestUnmodifiableMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import junit.framework.TestSuite; * {@link UnmodifiableMap} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -93,23 +93,23 @@ public class TestUnmodifiableMap extends AbstractTestMap{ //------------------------------------------------------------------- - protected Map makeEmptyMap() { + public Map makeEmptyMap() { return UnmodifiableMap.decorate(new HashMap()); } - protected boolean isPutChangeSupported() { + public boolean isPutChangeSupported() { return false; } - protected boolean isPutAddSupported() { + public boolean isPutAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; } - protected Map makeFullMap() { + public Map makeFullMap() { Map m = new HashMap(); addSampleMappings(m); return UnmodifiableMap.decorate(m); diff --git a/src/test/org/apache/commons/collections/observed/TestObservableBag.java b/src/test/org/apache/commons/collections/observed/TestObservableBag.java index 7a9b63f6f..05a967bef 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableBag.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableBag.java,v 1.4 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableBag.java,v 1.5 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.bag.AbstractTestBag; * {@link ObservableBag} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.5 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -89,7 +89,7 @@ public class TestObservableBag extends AbstractTestBag implements ObservedTestHe } //----------------------------------------------------------------------- - protected Bag makeBag() { + public Bag makeBag() { return ObservableBag.decorate(new HashBag(), ObservedTestHelper.LISTENER); } diff --git a/src/test/org/apache/commons/collections/observed/TestObservableBuffer.java b/src/test/org/apache/commons/collections/observed/TestObservableBuffer.java index 0952fbe2f..8f530ebde 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableBuffer.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableBuffer.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableBuffer.java,v 1.4 2003/11/16 22:15:11 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableBuffer.java,v 1.5 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; * {@link ObservableBuffer} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:11 $ + * @version $Revision: 1.5 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -96,7 +96,7 @@ public class TestObservableBuffer extends AbstractTestCollection implements Obse return new ArrayStack(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { ArrayStack stack = new ArrayStack(); stack.addAll(Arrays.asList(getFullElements())); return stack; @@ -106,7 +106,7 @@ public class TestObservableBuffer extends AbstractTestCollection implements Obse return ObservableBuffer.decorate(new ArrayStack(), ObservedTestHelper.LISTENER); } - protected Collection makeFullCollection() { + public Collection makeFullCollection() { List stack = new ArrayStack(); stack.addAll(Arrays.asList(getFullElements())); return ObservableBuffer.decorate(stack, ObservedTestHelper.LISTENER); diff --git a/src/test/org/apache/commons/collections/observed/TestObservableCollection.java b/src/test/org/apache/commons/collections/observed/TestObservableCollection.java index 91fb51ff5..393e98a58 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableCollection.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableCollection.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableCollection.java,v 1.3 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableCollection.java,v 1.4 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; * {@link ObservedCollection} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -96,7 +96,7 @@ public class TestObservableCollection extends AbstractTestCollection implements return new ArrayList(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return list; @@ -106,7 +106,7 @@ public class TestObservableCollection extends AbstractTestCollection implements return ObservableCollection.decorate(new ArrayList(), ObservedTestHelper.LISTENER); } - protected Collection makeFullCollection() { + public Collection makeFullCollection() { List list = new ArrayList(); list.addAll(Arrays.asList(getFullElements())); return ObservableCollection.decorate(list, ObservedTestHelper.LISTENER); diff --git a/src/test/org/apache/commons/collections/observed/TestObservableList.java b/src/test/org/apache/commons/collections/observed/TestObservableList.java index da1c3e5ee..65aa0083b 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableList.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableList.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableList.java,v 1.3 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableList.java,v 1.4 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.list.AbstractTestList; * {@link ObservedList} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -95,7 +95,7 @@ public class TestObservableList extends AbstractTestList implements ObservedTest return ObservableList.decorate(new ArrayList(), ObservedTestHelper.LISTENER); } - protected List makeFullList() { + public List makeFullList() { List set = new ArrayList(); set.addAll(Arrays.asList(getFullElements())); return ObservableList.decorate(set, ObservedTestHelper.LISTENER); diff --git a/src/test/org/apache/commons/collections/observed/TestObservableSet.java b/src/test/org/apache/commons/collections/observed/TestObservableSet.java index 01e411279..462792849 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableSet.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSet.java,v 1.3 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSet.java,v 1.4 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.set.AbstractTestSet; * {@link ObservedSet} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.3 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.4 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -91,11 +91,11 @@ public class TestObservableSet extends AbstractTestSet implements ObservedTestHe } //----------------------------------------------------------------------- - protected Set makeEmptySet() { + public Set makeEmptySet() { return ObservableSet.decorate(new HashSet(), ObservedTestHelper.LISTENER); } - protected Set makeFullSet() { + public Set makeFullSet() { Set set = new HashSet(); set.addAll(Arrays.asList(getFullElements())); return ObservableSet.decorate(set, ObservedTestHelper.LISTENER); diff --git a/src/test/org/apache/commons/collections/observed/TestObservableSortedBag.java b/src/test/org/apache/commons/collections/observed/TestObservableSortedBag.java index 426d82cfe..f1157de88 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableSortedBag.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableSortedBag.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedBag.java,v 1.4 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedBag.java,v 1.5 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -69,7 +69,7 @@ import org.apache.commons.collections.bag.AbstractTestSortedBag; * {@link ObservedSortedBag} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.5 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -89,7 +89,7 @@ public class TestObservableSortedBag extends AbstractTestSortedBag implements Ob } //----------------------------------------------------------------------- - protected Bag makeBag() { + public Bag makeBag() { return ObservableSortedBag.decorate(new TreeBag(), ObservedTestHelper.LISTENER); } diff --git a/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java b/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java index 6f36fcd27..4674b7075 100644 --- a/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java +++ b/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedSet.java,v 1.6 2003/11/16 22:15:12 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedSet.java,v 1.7 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.set.AbstractTestSortedSet; * {@link ObservedSortedSet} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.6 $ $Date: 2003/11/16 22:15:12 $ + * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -92,11 +92,11 @@ public class TestObservableSortedSet extends AbstractTestSortedSet implements Ob } //----------------------------------------------------------------------- - protected Set makeEmptySet() { + public Set makeEmptySet() { return ObservableSortedSet.decorate(new TreeSet(), ObservedTestHelper.LISTENER); } - protected Set makeFullSet() { + public Set makeFullSet() { SortedSet set = new TreeSet(); set.addAll(Arrays.asList(getFullElements())); return ObservableSortedSet.decorate(set, ObservedTestHelper.LISTENER); diff --git a/src/test/org/apache/commons/collections/pairs/AbstractTestMapEntry.java b/src/test/org/apache/commons/collections/pairs/AbstractTestMapEntry.java index 01e0d5dfa..417d74a56 100644 --- a/src/test/org/apache/commons/collections/pairs/AbstractTestMapEntry.java +++ b/src/test/org/apache/commons/collections/pairs/AbstractTestMapEntry.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/pairs/Attic/AbstractTestMapEntry.java,v 1.2 2003/11/02 19:44:37 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/pairs/Attic/AbstractTestMapEntry.java,v 1.3 2003/11/18 22:37:18 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -70,7 +70,7 @@ import junit.framework.TestCase; * type being tested. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/02 19:44:37 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:18 $ * * @author Neil O'Toole */ @@ -94,7 +94,7 @@ public abstract class AbstractTestMapEntry extends TestCase { * This implementation simply calls {@link #makeMapEntry(Object, Object)} * with null for key and value. Subclasses can override this method if desired. */ - protected Map.Entry makeMapEntry() { + public Map.Entry makeMapEntry() { return makeMapEntry(null, null); } @@ -103,19 +103,19 @@ public abstract class AbstractTestMapEntry extends TestCase { * Subclasses should override this method to return a Map.Entry * of the type being tested. */ - protected abstract Map.Entry makeMapEntry(Object key, Object value); + public abstract Map.Entry makeMapEntry(Object key, Object value); /** * Makes a Map.Entry of a type that's known to work correctly. */ - protected Map.Entry makeKnownMapEntry() { + public Map.Entry makeKnownMapEntry() { return makeKnownMapEntry(null, null); } /** * Makes a Map.Entry of a type that's known to work correctly. */ - protected Map.Entry makeKnownMapEntry(Object key, Object value) { + public Map.Entry makeKnownMapEntry(Object key, Object value) { Map map = new HashMap(1); map.put(key, value); Map.Entry entry = (Map.Entry) map.entrySet().iterator().next(); diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractByteCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractByteCollection.java deleted file mode 100644 index a839026c2..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractByteCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractByteCollection.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorByteIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestAbstractByteCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractByteCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractByteCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - ByteCollection col = new ByteCollectionImpl(); - try { - col.add((byte)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class ByteCollectionImpl extends AbstractByteCollection { - public ByteCollectionImpl() { - } - - public ByteIterator iterator() { - return new IteratorByteIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractCharCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractCharCollection.java deleted file mode 100644 index 586294566..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractCharCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractCharCollection.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorCharIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestAbstractCharCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractCharCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractCharCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - CharCollection col = new CharCollectionImpl(); - try { - col.add((char)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class CharCollectionImpl extends AbstractCharCollection { - public CharCollectionImpl() { - } - - public CharIterator iterator() { - return new IteratorCharIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractDoubleCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractDoubleCollection.java deleted file mode 100644 index 78eb8f1e3..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractDoubleCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractDoubleCollection.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorDoubleIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestAbstractDoubleCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractDoubleCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractDoubleCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - DoubleCollection col = new DoubleCollectionImpl(); - try { - col.add((double)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class DoubleCollectionImpl extends AbstractDoubleCollection { - public DoubleCollectionImpl() { - } - - public DoubleIterator iterator() { - return new IteratorDoubleIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractFloatCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractFloatCollection.java deleted file mode 100644 index b51a61894..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractFloatCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractFloatCollection.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorFloatIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestAbstractFloatCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractFloatCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractFloatCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - FloatCollection col = new FloatCollectionImpl(); - try { - col.add((float)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class FloatCollectionImpl extends AbstractFloatCollection { - public FloatCollectionImpl() { - } - - public FloatIterator iterator() { - return new IteratorFloatIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractIntCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractIntCollection.java deleted file mode 100644 index accb397b1..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractIntCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractIntCollection.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorIntIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestAbstractIntCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractIntCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractIntCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - IntCollection col = new IntCollectionImpl(); - try { - col.add(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class IntCollectionImpl extends AbstractIntCollection { - public IntCollectionImpl() { - } - - public IntIterator iterator() { - return new IteratorIntIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java b/src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java deleted file mode 100644 index 8191270a3..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractLongArrayList.java,v 1.10 2003/11/16 22:15:11 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; - -/** - * @version $Revision: 1.10 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - * @deprecated this should have been removed along with the others - */ -public abstract class TestAbstractLongArrayList extends AbstractTestList { - - //------------------------------------------------------------ Conventional - - public TestAbstractLongArrayList(String testName) { - super(testName); - } - - //---------------------------------------------------------------- Abstract - - abstract protected AbstractLongList createList(); - - //------------------------------------------------------- TestList interface - - public List makeEmptyList() { - return createList(); - } - - //------------------------------------------------------------------- Tests - - public void testAddGet() { - AbstractLongList list = createList(); - for(long i=0L;i<1000L;i++) { - list.addLong(i); - } - for(int i=0;i<1000;i++) { - assertEquals((long)i,list.getLong(i)); - } - } - - public void testAddGetLargeValues() { - AbstractLongList list = createList(); - for(long i=0L;i<1000L;i++) { - long value = ((long)(Integer.MAX_VALUE)); - value += i; - list.addLong(value); - } - for(long i=0L;i<1000L;i++) { - long value = ((long)(Integer.MAX_VALUE)); - value += i; - assertEquals(value,list.getLong((int)i)); - } - } - - - /** - * Returns an array of Long objects for testing. - */ - protected Object[] getFullElements() { - Long[] result = new Long[19]; - for (int i = 0; i < result.length; i++) { - result[i] = new Long(i + 19); - } - return result; - } - - - /** - * Returns an array of Long objects for testing. - */ - protected Object[] getOtherElements() { - Long[] result = new Long[16]; - for (int i = 0; i < result.length; i++) { - result[i] = new Long(i + 48); - } - return result; - } - - public void testCanonicalEmptyCollectionExists() { - } - - - public void testCanonicalFullCollectionExists() { - } - - public void testEmptyListCompatibility() { - } - - public void testFullListCompatibility() { - } - - public void testCollectionIteratorFailFast() { - } - - public void testListSubListFailFastOnAdd() { - } - - public void testListSubListFailFastOnRemove() { - } - - - -} - diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractLongCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractLongCollection.java deleted file mode 100644 index 7636feca7..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractLongCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractLongCollection.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorLongIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestAbstractLongCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractLongCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractLongCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - LongCollection col = new LongCollectionImpl(); - try { - col.add((long)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class LongCollectionImpl extends AbstractLongCollection { - public LongCollectionImpl() { - } - - public LongIterator iterator() { - return new IteratorLongIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestAbstractShortCollection.java b/src/test/org/apache/commons/collections/primitives/TestAbstractShortCollection.java deleted file mode 100644 index 116455a86..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAbstractShortCollection.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractShortCollection.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Collections; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.adapters.IteratorShortIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestAbstractShortCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestAbstractShortCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestAbstractShortCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - ShortCollection col = new ShortCollectionImpl(); - try { - col.add((short)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - // inner classes - // ------------------------------------------------------------------------ - - - static class ShortCollectionImpl extends AbstractShortCollection { - public ShortCollectionImpl() { - } - - public ShortIterator iterator() { - return new IteratorShortIterator(Collections.EMPTY_LIST.iterator()); - } - - public int size() { - return 0; - } - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestAll.java b/src/test/org/apache/commons/collections/primitives/TestAll.java deleted file mode 100644 index bc098b73d..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestAll.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAll.java,v 1.22 2003/09/27 10:54:06 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.22 $ $Date: 2003/09/27 10:54:06 $ - * @author Rodney Waldhoff - */ -public class TestAll extends TestCase { - public TestAll(String testName) { - super(testName); - } - - public static void main(String args[]) { - String[] testCaseName = { TestAll.class.getName() }; - junit.textui.TestRunner.main(testCaseName); - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTest(TestAbstractByteCollection.suite()); - suite.addTest(TestRandomAccessByteList.suite()); - suite.addTest(TestArrayByteList.suite()); - - suite.addTest(TestAbstractShortCollection.suite()); - suite.addTest(TestRandomAccessShortList.suite()); - suite.addTest(TestArrayShortList.suite()); - suite.addTest(TestArrayUnsignedByteList.suite()); - - suite.addTest(TestAbstractCharCollection.suite()); - suite.addTest(TestRandomAccessCharList.suite()); - suite.addTest(TestArrayCharList.suite()); - - suite.addTest(TestIntCollections.suite()); - suite.addTest(TestAbstractIntCollection.suite()); - suite.addTest(TestRandomAccessIntList.suite()); - suite.addTest(TestArrayIntList.suite()); - suite.addTest(TestArrayUnsignedShortList.suite()); - - suite.addTest(TestAbstractLongCollection.suite()); - suite.addTest(TestRandomAccessLongList.suite()); - suite.addTest(TestArrayLongList.suite()); - suite.addTest(TestArrayUnsignedIntList.suite()); - - suite.addTest(TestAbstractFloatCollection.suite()); - suite.addTest(TestRandomAccessFloatList.suite()); - suite.addTest(TestArrayFloatList.suite()); - - suite.addTest(TestAbstractDoubleCollection.suite()); - suite.addTest(TestRandomAccessDoubleList.suite()); - suite.addTest(TestArrayDoubleList.suite()); - - suite.addTest(org.apache.commons.collections.primitives.adapters.TestAll.suite()); - suite.addTest(org.apache.commons.collections.primitives.decorators.TestAll.suite()); - - return suite; - } -} - diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayByteList.java b/src/test/org/apache/commons/collections/primitives/TestArrayByteList.java deleted file mode 100644 index 4d918b679..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayByteList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayByteList.java,v 1.5 2003/10/05 20:48:59 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.5 $ $Date: 2003/10/05 20:48:59 $ - * @author Rodney Waldhoff - */ -public class TestArrayByteList extends TestByteList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayByteList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayByteList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected ByteList makeEmptyByteList() { - return new ArrayByteList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayByteList.bulkTestSubList.testFullListSerialization", - "TestArrayByteList.bulkTestSubList.testEmptyListSerialization", - "TestArrayByteList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayByteList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayByteList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayByteList.bulkTestSubList.testFullListCompatibility", - "TestArrayByteList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayByteList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - ByteList list = new ArrayByteList(); - for (int i = 0; i < 1000; i++) { - byte value = ((byte) (Byte.MAX_VALUE)); - value -= i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - byte value = ((byte) (Byte.MAX_VALUE)); - value -= i; - assertEquals(value, list.get(i)); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayByteList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayByteList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayByteList expected = new ArrayByteList(); - for(int i=0;i<10;i++) { - expected.add((byte)i); - } - ArrayByteList list = new ArrayByteList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayByteList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayByteList list = new ArrayByteList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((byte)i); - } - - for(int i=0;i<10;i++) { - assertEquals((byte)i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((byte)i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((byte)i); - } - - for(int i=0;i<5;i++) { - assertEquals((byte)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((byte)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((byte)(2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayCharList.java b/src/test/org/apache/commons/collections/primitives/TestArrayCharList.java deleted file mode 100644 index da7ab1bf0..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayCharList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayCharList.java,v 1.4 2003/10/05 20:48:59 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:59 $ - * @author Rodney Waldhoff - */ -public class TestArrayCharList extends TestCharList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayCharList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayCharList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected CharList makeEmptyCharList() { - return new ArrayCharList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayCharList.bulkTestSubList.testFullListSerialization", - "TestArrayCharList.bulkTestSubList.testEmptyListSerialization", - "TestArrayCharList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayCharList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayCharList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayCharList.bulkTestSubList.testFullListCompatibility", - "TestArrayCharList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayCharList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - CharList list = new ArrayCharList(); - for (int i = 0; i < 1000; i++) { - char value = ((char) (Character.MAX_VALUE)); - value -= i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - char value = ((char) (Character.MAX_VALUE)); - value -= i; - assertEquals(value, list.get(i)); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayCharList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayCharList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayCharList expected = new ArrayCharList(); - for(int i=0;i<10;i++) { - expected.add((char)i); - } - ArrayCharList list = new ArrayCharList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayCharList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayCharList list = new ArrayCharList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((char)i); - } - - for(int i=0;i<10;i++) { - assertEquals((char)i,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((char)i,list.get(i), 0f); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((char)i); - } - - for(int i=0;i<5;i++) { - assertEquals((char)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((char)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((char)(2*i)+1,list.get(i), 0f); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayDoubleList.java b/src/test/org/apache/commons/collections/primitives/TestArrayDoubleList.java deleted file mode 100644 index fe5a1fe6d..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayDoubleList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayDoubleList.java,v 1.4 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayDoubleList extends TestDoubleList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayDoubleList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayDoubleList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected DoubleList makeEmptyDoubleList() { - return new ArrayDoubleList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayDoubleList.bulkTestSubList.testFullListSerialization", - "TestArrayDoubleList.bulkTestSubList.testEmptyListSerialization", - "TestArrayDoubleList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayDoubleList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayDoubleList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayDoubleList.bulkTestSubList.testFullListCompatibility", - "TestArrayDoubleList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayDoubleList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - DoubleList list = new ArrayDoubleList(); - for (int i = 0; i < 1000; i++) { - double value = ((double) (Double.MAX_VALUE)); - value -= i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - double value = ((double) (Double.MAX_VALUE)); - value -= i; - assertEquals(value, list.get(i), 0f); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayDoubleList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayDoubleList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayDoubleList expected = new ArrayDoubleList(); - for(int i=0;i<10;i++) { - expected.add((double)i); - } - ArrayDoubleList list = new ArrayDoubleList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayDoubleList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayDoubleList list = new ArrayDoubleList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((double)i); - } - - for(int i=0;i<10;i++) { - assertEquals((double)i,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((double)i,list.get(i), 0f); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((double)i); - } - - for(int i=0;i<5;i++) { - assertEquals((double)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((double)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((double)(2*i)+1,list.get(i), 0f); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayFloatList.java b/src/test/org/apache/commons/collections/primitives/TestArrayFloatList.java deleted file mode 100644 index 9609f76d8..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayFloatList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayFloatList.java,v 1.4 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayFloatList extends TestFloatList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayFloatList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayFloatList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected FloatList makeEmptyFloatList() { - return new ArrayFloatList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayFloatList.bulkTestSubList.testFullListSerialization", - "TestArrayFloatList.bulkTestSubList.testEmptyListSerialization", - "TestArrayFloatList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayFloatList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayFloatList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayFloatList.bulkTestSubList.testFullListCompatibility", - "TestArrayFloatList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayFloatList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - FloatList list = new ArrayFloatList(); - for (int i = 0; i < 1000; i++) { - float value = ((float) (Float.MAX_VALUE)); - value -= i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - float value = ((float) (Float.MAX_VALUE)); - value -= i; - assertEquals(value, list.get(i), 0f); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayFloatList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayFloatList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayFloatList expected = new ArrayFloatList(); - for(int i=0;i<10;i++) { - expected.add((float)i); - } - ArrayFloatList list = new ArrayFloatList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayFloatList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayFloatList list = new ArrayFloatList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((float)i); - } - - for(int i=0;i<10;i++) { - assertEquals((float)i,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((float)i,list.get(i), 0f); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((float)i); - } - - for(int i=0;i<5;i++) { - assertEquals((float)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((float)(2*i)+1,list.get(i), 0f); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((float)(2*i)+1,list.get(i), 0f); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayIntList.java b/src/test/org/apache/commons/collections/primitives/TestArrayIntList.java deleted file mode 100644 index 1bc48c666..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayIntList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayIntList.java,v 1.14 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.14 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayIntList extends TestIntList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayIntList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayIntList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected IntList makeEmptyIntList() { - return new ArrayIntList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayIntList.bulkTestSubList.testFullListSerialization", - "TestArrayIntList.bulkTestSubList.testEmptyListSerialization", - "TestArrayIntList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayIntList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayIntList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayIntList.bulkTestSubList.testFullListCompatibility", - "TestArrayIntList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayIntList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - IntList list = new ArrayIntList(); - for (int i = 0; i < 1000; i++) { - int value = ((int) (Short.MAX_VALUE)); - value += i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - int value = ((int) (Short.MAX_VALUE)); - value += i; - assertEquals(value, list.get(i)); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayIntList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayIntList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayIntList expected = new ArrayIntList(); - for(int i=0;i<10;i++) { - expected.add(i); - } - ArrayIntList list = new ArrayIntList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayIntList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayIntList list = new ArrayIntList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add(i); - } - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement(i); - } - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayLongList.java b/src/test/org/apache/commons/collections/primitives/TestArrayLongList.java deleted file mode 100644 index e397f858d..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayLongList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayLongList.java,v 1.4 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayLongList extends TestLongList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayLongList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayLongList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected LongList makeEmptyLongList() { - return new ArrayLongList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayLongList.bulkTestSubList.testFullListSerialization", - "TestArrayLongList.bulkTestSubList.testEmptyListSerialization", - "TestArrayLongList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayLongList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayLongList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayLongList.bulkTestSubList.testFullListCompatibility", - "TestArrayLongList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayLongList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - LongList list = new ArrayLongList(); - for (int i = 0; i < 1000; i++) { - long value = ((long) (Integer.MAX_VALUE)); - value += i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - long value = ((long) (Integer.MAX_VALUE)); - value += i; - assertEquals(value, list.get(i)); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayLongList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayLongList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayLongList expected = new ArrayLongList(); - for(int i=0;i<10;i++) { - expected.add((long)i); - } - ArrayLongList list = new ArrayLongList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayLongList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayLongList list = new ArrayLongList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((long)i); - } - - for(int i=0;i<10;i++) { - assertEquals((long)i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((long)i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((long)i); - } - - for(int i=0;i<5;i++) { - assertEquals((long)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((long)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((long)(2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayShortList.java b/src/test/org/apache/commons/collections/primitives/TestArrayShortList.java deleted file mode 100644 index 7a0b812d8..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayShortList.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayShortList.java,v 1.4 2003/10/05 20:48:59 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:59 $ - * @author Rodney Waldhoff - */ -public class TestArrayShortList extends TestShortList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayShortList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayShortList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected ShortList makeEmptyShortList() { - return new ArrayShortList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayShortList.bulkTestSubList.testFullListSerialization", - "TestArrayShortList.bulkTestSubList.testEmptyListSerialization", - "TestArrayShortList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayShortList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayShortList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayShortList.bulkTestSubList.testFullListCompatibility", - "TestArrayShortList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayShortList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testAddGetLargeValues() { - ShortList list = new ArrayShortList(); - for (int i = 0; i < 1000; i++) { - short value = ((short) (Integer.MAX_VALUE)); - value += i; - list.add(value); - } - for (int i = 0; i < 1000; i++) { - short value = ((short) (Integer.MAX_VALUE)); - value += i; - assertEquals(value, list.get(i)); - } - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayShortList(0)); - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayShortList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayShortList expected = new ArrayShortList(); - for(int i=0;i<10;i++) { - expected.add((short)i); - } - ArrayShortList list = new ArrayShortList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayShortList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayShortList list = new ArrayShortList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((short)i); - } - - for(int i=0;i<10;i++) { - assertEquals((short)i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals((short)i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((short)i); - } - - for(int i=0;i<5;i++) { - assertEquals((short)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((short)(2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((short)(2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedByteList.java b/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedByteList.java deleted file mode 100644 index 14d47fdd8..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedByteList.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayUnsignedByteList.java,v 1.4 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayUnsignedByteList extends TestShortList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayUnsignedByteList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayUnsignedByteList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected ShortList makeEmptyShortList() { - return new ArrayUnsignedByteList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayUnsignedByteList.bulkTestSubList.testFullListSerialization", - "TestArrayUnsignedByteList.bulkTestSubList.testEmptyListSerialization", - "TestArrayUnsignedByteList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayUnsignedByteList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayUnsignedByteList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayUnsignedByteList.bulkTestSubList.testFullListCompatibility", - "TestArrayUnsignedByteList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayUnsignedByteList.bulkTestSubList.testSimpleSerialization" - }; - } - - protected short[] getFullShorts() { - short[] result = new short[19]; - for(int i = 0; i < result.length; i++) { - result[i] = (short)(ArrayUnsignedByteList.MAX_VALUE - i); - } - return result; - } - - // tests - // ------------------------------------------------------------------------ - - // @TODO need to add serialized form to cvs - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayUnsignedByteList(0)); - } - - public void testIllegalArgumentExceptionWhenElementOutOfRange() { - ArrayUnsignedByteList list = new ArrayUnsignedByteList(); - list.add(ArrayUnsignedByteList.MIN_VALUE); - list.add(ArrayUnsignedByteList.MAX_VALUE); - try { - list.add((short)-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - try { - list.add((short)(ArrayUnsignedByteList.MAX_VALUE+1)); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayUnsignedByteList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayUnsignedByteList expected = new ArrayUnsignedByteList(); - for(int i=0;i<10;i++) { - expected.add((short)i); - } - ArrayUnsignedByteList list = new ArrayUnsignedByteList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayUnsignedByteList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayUnsignedByteList list = new ArrayUnsignedByteList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add((short)i); - } - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement((short)i); - } - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedIntList.java b/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedIntList.java deleted file mode 100644 index 2ee669824..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedIntList.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayUnsignedIntList.java,v 1.4 2003/10/05 20:48:59 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/05 20:48:59 $ - * @author Rodney Waldhoff - */ -public class TestArrayUnsignedIntList extends TestLongList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayUnsignedIntList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayUnsignedIntList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected LongList makeEmptyLongList() { - return new ArrayUnsignedIntList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayUnsignedLongList.bulkTestSubList.testFullListSerialization", - "TestArrayUnsignedLongList.bulkTestSubList.testEmptyListSerialization", - "TestArrayUnsignedLongList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayUnsignedLongList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayUnsignedLongList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayUnsignedLongList.bulkTestSubList.testFullListCompatibility", - "TestArrayUnsignedLongList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayUnsignedLongList.bulkTestSubList.testSimpleSerialization" - }; - } - - protected long[] getFullLongs() { - long[] result = new long[19]; - for(int i = 0; i < result.length; i++) { - result[i] = ((long)Integer.MAX_VALUE - 1L - (long)i); - } - return result; - } - - // tests - // ------------------------------------------------------------------------ - - // @TODO need to add serialized form to cvs - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayUnsignedIntList(0)); - } - - public void testIllegalArgumentExceptionWhenElementOutOfRange() { - ArrayUnsignedIntList list = new ArrayUnsignedIntList(); - list.add(ArrayUnsignedIntList.MIN_VALUE); - list.add(ArrayUnsignedIntList.MAX_VALUE); - try { - list.add(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - try { - list.add(ArrayUnsignedIntList.MAX_VALUE+1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayUnsignedIntList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayUnsignedIntList expected = new ArrayUnsignedIntList(); - for(int i=0;i<10;i++) { - expected.add(i); - } - ArrayUnsignedIntList list = new ArrayUnsignedIntList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayUnsignedIntList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayUnsignedIntList list = new ArrayUnsignedIntList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add(i); - } - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement(i); - } - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedShortList.java b/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedShortList.java deleted file mode 100644 index 9679810fa..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestArrayUnsignedShortList.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestArrayUnsignedShortList.java,v 1.14 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; - -/** - * @version $Revision: 1.14 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestArrayUnsignedShortList extends TestIntList { - - // conventional - // ------------------------------------------------------------------------ - - public TestArrayUnsignedShortList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestArrayUnsignedShortList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected IntList makeEmptyIntList() { - return new ArrayUnsignedShortList(); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestArrayUnsignedShortList.bulkTestSubList.testFullListSerialization", - "TestArrayUnsignedShortList.bulkTestSubList.testEmptyListSerialization", - "TestArrayUnsignedShortList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestArrayUnsignedShortList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestArrayUnsignedShortList.bulkTestSubList.testEmptyListCompatibility", - "TestArrayUnsignedShortList.bulkTestSubList.testFullListCompatibility", - "TestArrayUnsignedShortList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestArrayUnsignedShortList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - // @TODO need to add serialized form to cvs - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testZeroInitialCapacityIsValid() { - assertNotNull(new ArrayUnsignedShortList(0)); - } - - public void testIllegalArgumentExceptionWhenElementOutOfRange() { - ArrayUnsignedShortList list = new ArrayUnsignedShortList(); - list.add(ArrayUnsignedShortList.MIN_VALUE); - list.add(ArrayUnsignedShortList.MAX_VALUE); - try { - list.add(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - try { - list.add(ArrayUnsignedShortList.MAX_VALUE+1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testNegativeInitialCapacityIsInvalid() { - try { - new ArrayUnsignedShortList(-1); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - } - - public void testCopyConstructor() { - ArrayUnsignedShortList expected = new ArrayUnsignedShortList(); - for(int i=0;i<10;i++) { - expected.add(i); - } - ArrayUnsignedShortList list = new ArrayUnsignedShortList(expected); - assertEquals(10,list.size()); - assertEquals(expected,list); - } - - public void testCopyConstructorWithNull() { - try { - new ArrayUnsignedShortList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - - public void testTrimToSize() { - ArrayUnsignedShortList list = new ArrayUnsignedShortList(); - for(int j=0;j<3;j++) { - assertTrue(list.isEmpty()); - - list.trimToSize(); - - assertTrue(list.isEmpty()); - - for(int i=0;i<10;i++) { - list.add(i); - } - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<10;i++) { - assertEquals(i,list.get(i)); - } - - for(int i=0;i<10;i+=2) { - list.removeElement(i); - } - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.trimToSize(); - - for(int i=0;i<5;i++) { - assertEquals((2*i)+1,list.get(i)); - } - - list.clear(); - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestByteIterator.java b/src/test/org/apache/commons/collections/primitives/TestByteIterator.java deleted file mode 100644 index 6913663cc..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestByteIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestByteIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.ByteIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestByteIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return ByteIteratorIterator.wrap(makeEmptyByteIterator()); - } - - public Iterator makeFullIterator() { - return ByteIteratorIterator.wrap(makeFullByteIterator()); - } - - - protected abstract ByteIterator makeEmptyByteIterator(); - protected abstract ByteIterator makeFullByteIterator(); - protected abstract byte[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - byte[] elements = getFullElements(); - ByteIterator iter = makeFullByteIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.ByteListList; -import org.apache.commons.collections.primitives.adapters.ListByteList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestByteList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: byte list - // ------------------------------------------------------------------------ - - protected abstract ByteList makeEmptyByteList(); - - protected ByteList makeFullByteList() { - ByteList list = makeEmptyByteList(); - byte[] values = getFullBytes(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public abstract class TestByteListIterator extends TestByteIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ByteIterator makeEmptyByteIterator() { - return makeEmptyByteListIterator(); - } - - public ByteIterator makeFullByteIterator() { - return makeFullByteListIterator(); - } - - public abstract ByteListIterator makeEmptyByteListIterator(); - public abstract ByteListIterator makeFullByteListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestCharIterator.java b/src/test/org/apache/commons/collections/primitives/TestCharIterator.java deleted file mode 100644 index df07752ea..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestCharIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestCharIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.CharIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestCharIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return CharIteratorIterator.wrap(makeEmptyCharIterator()); - } - - public Iterator makeFullIterator() { - return CharIteratorIterator.wrap(makeFullCharIterator()); - } - - - protected abstract CharIterator makeEmptyCharIterator(); - protected abstract CharIterator makeFullCharIterator(); - protected abstract char[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - char[] elements = getFullElements(); - CharIterator iter = makeFullCharIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.CharListList; -import org.apache.commons.collections.primitives.adapters.ListCharList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestCharList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: char list - // ------------------------------------------------------------------------ - - protected abstract CharList makeEmptyCharList(); - - protected CharList makeFullCharList() { - CharList list = makeEmptyCharList(); - char[] values = getFullChars(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public abstract class TestCharListIterator extends TestCharIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public CharIterator makeEmptyCharIterator() { - return makeEmptyCharListIterator(); - } - - public CharIterator makeFullCharIterator() { - return makeFullCharListIterator(); - } - - public abstract CharListIterator makeEmptyCharListIterator(); - public abstract CharListIterator makeFullCharListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestDoubleIterator.java b/src/test/org/apache/commons/collections/primitives/TestDoubleIterator.java deleted file mode 100644 index 24683ca26..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestDoubleIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestDoubleIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.DoubleIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestDoubleIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return DoubleIteratorIterator.wrap(makeEmptyDoubleIterator()); - } - - public Iterator makeFullIterator() { - return DoubleIteratorIterator.wrap(makeFullDoubleIterator()); - } - - - protected abstract DoubleIterator makeEmptyDoubleIterator(); - protected abstract DoubleIterator makeFullDoubleIterator(); - protected abstract double[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - double[] elements = getFullElements(); - DoubleIterator iter = makeFullDoubleIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.DoubleListList; -import org.apache.commons.collections.primitives.adapters.ListDoubleList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestDoubleList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: double list - // ------------------------------------------------------------------------ - - protected abstract DoubleList makeEmptyDoubleList(); - - protected DoubleList makeFullDoubleList() { - DoubleList list = makeEmptyDoubleList(); - double[] values = getFullDoubles(); - for(int i=0;i>> 32))); - } - assertEquals(hash,list.hashCode()); - } - - public void testEqualsWithTwoDoubleLists() { - DoubleList one = makeEmptyDoubleList(); - assertEquals("Equals is reflexive on empty list",one,one); - DoubleList two = makeEmptyDoubleList(); - assertEquals("Empty lists are equal",one,two); - assertEquals("Equals is symmetric on empty lists",two,one); - - one.add((double)1); - assertEquals("Equals is reflexive on non empty list",one,one); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - two.add((double)1); - assertEquals("Non empty lists are equal",one,two); - assertEquals("Equals is symmetric on non empty list",one,two); - - one.add((double)1); one.add((double)2); one.add((double)3); one.add((double)5); one.add((double)8); - assertEquals("Equals is reflexive on larger non empty list",one,one); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - two.add((double)1); two.add((double)2); two.add((double)3); two.add((double)5); two.add((double)8); - assertEquals("Larger non empty lists are equal",one,two); - assertEquals("Equals is symmetric on larger non empty list",two,one); - - one.add((double)9); - two.add((double)10); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - } - - public void testDoubleSubListEquals() { - DoubleList one = makeEmptyDoubleList(); - assertEquals(one,one.subList(0,0)); - assertEquals(one.subList(0,0),one); - - one.add((double)1); - assertEquals(one,one.subList(0,1)); - assertEquals(one.subList(0,1),one); - - one.add((double)1); one.add((double)2); one.add((double)3); one.add((double)5); one.add((double)8); - assertEquals(one.subList(0,4),one.subList(0,4)); - assertEquals(one.subList(3,5),one.subList(3,5)); - } - - public void testEqualsWithDoubleListAndList() { - DoubleList ilist = makeEmptyDoubleList(); - List list = new ArrayList(); - - assertTrue("Unwrapped, empty List should not be equal to empty DoubleList.",!ilist.equals(list)); - assertTrue("Unwrapped, empty DoubleList should not be equal to empty List.",!list.equals(ilist)); - - assertEquals(new ListDoubleList(list),ilist); - assertEquals(ilist,new ListDoubleList(list)); - assertEquals(new DoubleListList(ilist),list); - assertEquals(list,new DoubleListList(ilist)); - - ilist.add((double)1); - list.add(new Double((double)1)); - - assertTrue("Unwrapped, non-empty List is not equal to non-empty DoubleList.",!ilist.equals(list)); - assertTrue("Unwrapped, non-empty DoubleList is not equal to non-empty List.",!list.equals(ilist)); - - assertEquals(new ListDoubleList(list),ilist); - assertEquals(ilist,new ListDoubleList(list)); - assertEquals(new DoubleListList(ilist),list); - assertEquals(list,new DoubleListList(ilist)); - - ilist.add((double)1); ilist.add((double)2); ilist.add((double)3); ilist.add((double)5); ilist.add((double)8); - list.add(new Double((double)1)); list.add(new Double((double)2)); list.add(new Double((double)3)); list.add(new Double((double)5)); list.add(new Double((double)8)); - - assertTrue("Unwrapped, non-empty List is not equal to non-empty DoubleList.",!ilist.equals(list)); - assertTrue("Unwrapped, non-empty DoubleList is not equal to non-empty List.",!list.equals(ilist)); - - assertEquals(new ListDoubleList(list),ilist); - assertEquals(ilist,new ListDoubleList(list)); - assertEquals(new DoubleListList(ilist),list); - assertEquals(list,new DoubleListList(ilist)); - - } - - public void testClearAndSize() { - DoubleList list = makeEmptyDoubleList(); - assertEquals(0, list.size()); - for(int i = 0; i < 100; i++) { - list.add((double)i); - } - assertEquals(100, list.size()); - list.clear(); - assertEquals(0, list.size()); - } - - public void testRemoveViaSubList() { - DoubleList list = makeEmptyDoubleList(); - for(int i = 0; i < 100; i++) { - list.add((double)i); - } - DoubleList sub = list.subList(25,75); - assertEquals(50,sub.size()); - for(int i = 0; i < 50; i++) { - assertEquals(100-i,list.size()); - assertEquals(50-i,sub.size()); - assertEquals((double)(25+i),sub.removeElementAt(0), 0f); - assertEquals(50-i-1,sub.size()); - assertEquals(100-i-1,list.size()); - } - assertEquals(0,sub.size()); - assertEquals(50,list.size()); - } - - public void testAddGet() { - DoubleList list = makeEmptyDoubleList(); - for (int i = 0; i < 255; i++) { - list.add((double)i); - } - for (int i = 0; i < 255; i++) { - assertEquals((double)i, list.get(i), 0f); - } - } - - public void testAddAndShift() { - DoubleList list = makeEmptyDoubleList(); - list.add(0, (double)1); - assertEquals("Should have one entry", 1, list.size()); - list.add((double)3); - list.add((double)4); - list.add(1, (double)2); - for(int i = 0; i < 4; i++) { - assertEquals("Should get entry back", (double)(i + 1), list.get(i), 0f); - } - list.add(0, (double)0); - for (int i = 0; i < 5; i++) { - assertEquals("Should get entry back", (double)i, list.get(i), 0f); - } - } - - public void testIsSerializable() throws Exception { - DoubleList list = makeFullDoubleList(); - assertTrue(list instanceof Serializable); - byte[] ser = writeExternalFormToBytes((Serializable)list); - DoubleList deser = (DoubleList)(readExternalFormFromBytes(ser)); - assertEquals(list,deser); - assertEquals(deser,list); - } - - public void testDoubleListSerializeDeserializeThenCompare() throws Exception { - DoubleList list = makeFullDoubleList(); - if(list instanceof Serializable) { - byte[] ser = writeExternalFormToBytes((Serializable)list); - DoubleList deser = (DoubleList)(readExternalFormFromBytes(ser)); - assertEquals("obj != deserialize(serialize(obj))",list,deser); - } - } - - public void testSubListsAreNotSerializable() throws Exception { - DoubleList list = makeFullDoubleList().subList(2,3); - assertTrue( ! (list instanceof Serializable) ); - } - - public void testSubListOutOfBounds() throws Exception { - try { - makeEmptyDoubleList().subList(2,3); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullDoubleList().subList(-1,3); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - - try { - makeFullDoubleList().subList(5,2); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - - try { - makeFullDoubleList().subList(2,makeFullDoubleList().size()+2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - } - - public void testListIteratorOutOfBounds() throws Exception { - try { - makeEmptyDoubleList().listIterator(2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullDoubleList().listIterator(-1); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullDoubleList().listIterator(makeFullDoubleList().size()+2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - } - - public void testListIteratorSetWithoutNext() throws Exception { - DoubleListIterator iter = makeFullDoubleList().listIterator(); - try { - iter.set((double)3); - fail("Expected IllegalStateException"); - } catch(IllegalStateException e) { - // expected - } - } - - public void testListIteratorSetAfterRemove() throws Exception { - DoubleListIterator iter = makeFullDoubleList().listIterator(); - iter.next(); - iter.remove(); - try { - iter.set((double)3); - fail("Expected IllegalStateException"); - } catch(IllegalStateException e) { - // expected - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestDoubleListIterator.java b/src/test/org/apache/commons/collections/primitives/TestDoubleListIterator.java deleted file mode 100644 index 5237ae627..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestDoubleListIterator.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestDoubleListIterator.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public abstract class TestDoubleListIterator extends TestDoubleIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public DoubleIterator makeEmptyDoubleIterator() { - return makeEmptyDoubleListIterator(); - } - - public DoubleIterator makeFullDoubleIterator() { - return makeFullDoubleListIterator(); - } - - public abstract DoubleListIterator makeEmptyDoubleListIterator(); - public abstract DoubleListIterator makeFullDoubleListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestFloatIterator.java b/src/test/org/apache/commons/collections/primitives/TestFloatIterator.java deleted file mode 100644 index 6e5cd735a..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestFloatIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestFloatIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.FloatIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestFloatIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return FloatIteratorIterator.wrap(makeEmptyFloatIterator()); - } - - public Iterator makeFullIterator() { - return FloatIteratorIterator.wrap(makeFullFloatIterator()); - } - - - protected abstract FloatIterator makeEmptyFloatIterator(); - protected abstract FloatIterator makeFullFloatIterator(); - protected abstract float[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - float[] elements = getFullElements(); - FloatIterator iter = makeFullFloatIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.FloatListList; -import org.apache.commons.collections.primitives.adapters.ListFloatList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestFloatList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: float list - // ------------------------------------------------------------------------ - - protected abstract FloatList makeEmptyFloatList(); - - protected FloatList makeFullFloatList() { - FloatList list = makeEmptyFloatList(); - float[] values = getFullFloats(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public abstract class TestFloatListIterator extends TestFloatIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public FloatIterator makeEmptyFloatIterator() { - return makeEmptyFloatListIterator(); - } - - public FloatIterator makeFullFloatIterator() { - return makeFullFloatListIterator(); - } - - public abstract FloatListIterator makeEmptyFloatListIterator(); - public abstract FloatListIterator makeFullFloatListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestIntCollections.java b/src/test/org/apache/commons/collections/primitives/TestIntCollections.java deleted file mode 100644 index 41f89053d..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestIntCollections.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestIntCollections.java,v 1.4 2003/09/27 10:54:06 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.4 $ $Date: 2003/09/27 10:54:06 $ - * @author Rodney Waldhoff - */ -public class TestIntCollections extends TestCase { - - //------------------------------------------------------------ Conventional - - public TestIntCollections(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIntCollections.class); - } - - //---------------------------------------------------------------- Tests - - public void testSingletonIntListIterator() { - IntListIterator iter = IntCollections.singletonIntListIterator(17); - assertTrue(!iter.hasPrevious()); - assertTrue(iter.hasNext()); - assertEquals(17,iter.next()); - assertTrue(iter.hasPrevious()); - assertTrue(!iter.hasNext()); - assertEquals(17,iter.previous()); - try { - iter.set(18); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSingletonIntIterator() { - IntIterator iter = IntCollections.singletonIntIterator(17); - assertTrue(iter.hasNext()); - assertEquals(17,iter.next()); - assertTrue(!iter.hasNext()); - try { - iter.remove(); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSingletonIntList() { - IntList list = IntCollections.singletonIntList(17); - assertEquals(1,list.size()); - assertEquals(17,list.get(0)); - try { - list.add(18); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testUnmodifiableIntListNull() { - try { - IntCollections.unmodifiableIntList(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - public void testEmptyIntList() { - assertSame(IntCollections.EMPTY_INT_LIST,IntCollections.getEmptyIntList()); - assertTrue(IntCollections.EMPTY_INT_LIST.isEmpty()); - try { - IntCollections.EMPTY_INT_LIST.add(1); - fail("Expected UnsupportedOperationExcpetion"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testUnmodifiableIntIteratorNull() { - try { - IntCollections.unmodifiableIntIterator(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - public void testEmptyIntIterator() { - assertSame(IntCollections.EMPTY_INT_ITERATOR,IntCollections.getEmptyIntIterator()); - assertTrue(! IntCollections.EMPTY_INT_ITERATOR.hasNext()); - try { - IntCollections.EMPTY_INT_ITERATOR.remove(); - fail("Expected UnsupportedOperationExcpetion"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testUnmodifiableIntListIteratorNull() { - try { - IntCollections.unmodifiableIntListIterator(null); - fail("Expected NullPointerException"); - } catch(NullPointerException e) { - // expected - } - } - - public void testEmptyIntListIterator() { - assertSame(IntCollections.EMPTY_INT_LIST_ITERATOR,IntCollections.getEmptyIntListIterator()); - assertTrue(! IntCollections.EMPTY_INT_LIST_ITERATOR.hasNext()); - assertTrue(! IntCollections.EMPTY_INT_LIST_ITERATOR.hasPrevious()); - try { - IntCollections.EMPTY_INT_LIST_ITERATOR.add(1); - fail("Expected UnsupportedOperationExcpetion"); - } catch(UnsupportedOperationException e) { - // expected - } - } -} - diff --git a/src/test/org/apache/commons/collections/primitives/TestIntIterator.java b/src/test/org/apache/commons/collections/primitives/TestIntIterator.java deleted file mode 100644 index 2bc7ec011..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestIntIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestIntIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.IntIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestIntIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return IntIteratorIterator.wrap(makeEmptyIntIterator()); - } - - public Iterator makeFullIterator() { - return IntIteratorIterator.wrap(makeFullIntIterator()); - } - - - protected abstract IntIterator makeEmptyIntIterator(); - protected abstract IntIterator makeFullIntIterator(); - protected abstract int[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - int[] elements = getFullElements(); - IntIterator iter = makeFullIntIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.IntListList; -import org.apache.commons.collections.primitives.adapters.ListIntList; - -/** - * @version $Revision: 1.12 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestIntList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: int list - // ------------------------------------------------------------------------ - - protected abstract IntList makeEmptyIntList(); - - protected IntList makeFullIntList() { - IntList list = makeEmptyIntList(); - int[] values = getFullIntegers(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public abstract class TestIntListIterator extends TestIntIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public IntIterator makeEmptyIntIterator() { - return makeEmptyIntListIterator(); - } - - public IntIterator makeFullIntIterator() { - return makeFullIntListIterator(); - } - - public abstract IntListIterator makeEmptyIntListIterator(); - public abstract IntListIterator makeFullIntListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestLongIterator.java b/src/test/org/apache/commons/collections/primitives/TestLongIterator.java deleted file mode 100644 index c200935d3..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestLongIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestLongIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.LongIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestLongIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return LongIteratorIterator.wrap(makeEmptyLongIterator()); - } - - public Iterator makeFullIterator() { - return LongIteratorIterator.wrap(makeFullLongIterator()); - } - - - protected abstract LongIterator makeEmptyLongIterator(); - protected abstract LongIterator makeFullLongIterator(); - protected abstract long[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - long[] elements = getFullElements(); - LongIterator iter = makeFullLongIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.ListLongList; -import org.apache.commons.collections.primitives.adapters.LongListList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestLongList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: long list - // ------------------------------------------------------------------------ - - protected abstract LongList makeEmptyLongList(); - - protected LongList makeFullLongList() { - LongList list = makeEmptyLongList(); - long[] values = getFullLongs(); - for(int i=0;i>> 32))); - } - assertEquals(hash,list.hashCode()); - } - - public void testEqualsWithTwoLongLists() { - LongList one = makeEmptyLongList(); - assertEquals("Equals is reflexive on empty list",one,one); - LongList two = makeEmptyLongList(); - assertEquals("Empty lists are equal",one,two); - assertEquals("Equals is symmetric on empty lists",two,one); - - one.add((long)1); - assertEquals("Equals is reflexive on non empty list",one,one); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - two.add((long)1); - assertEquals("Non empty lists are equal",one,two); - assertEquals("Equals is symmetric on non empty list",one,two); - - one.add((long)1); one.add((long)2); one.add((long)3); one.add((long)5); one.add((long)8); - assertEquals("Equals is reflexive on larger non empty list",one,one); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - two.add((long)1); two.add((long)2); two.add((long)3); two.add((long)5); two.add((long)8); - assertEquals("Larger non empty lists are equal",one,two); - assertEquals("Equals is symmetric on larger non empty list",two,one); - - one.add((long)9); - two.add((long)10); - assertTrue(!one.equals(two)); - assertTrue(!two.equals(one)); - - } - - public void testLongSubListEquals() { - LongList one = makeEmptyLongList(); - assertEquals(one,one.subList(0,0)); - assertEquals(one.subList(0,0),one); - - one.add((long)1); - assertEquals(one,one.subList(0,1)); - assertEquals(one.subList(0,1),one); - - one.add((long)1); one.add((long)2); one.add((long)3); one.add((long)5); one.add((long)8); - assertEquals(one.subList(0,4),one.subList(0,4)); - assertEquals(one.subList(3,5),one.subList(3,5)); - } - - public void testEqualsWithLongListAndList() { - LongList ilist = makeEmptyLongList(); - List list = new ArrayList(); - - assertTrue("Unwrapped, empty List should not be equal to empty LongList.",!ilist.equals(list)); - assertTrue("Unwrapped, empty LongList should not be equal to empty List.",!list.equals(ilist)); - - assertEquals(new ListLongList(list),ilist); - assertEquals(ilist,new ListLongList(list)); - assertEquals(new LongListList(ilist),list); - assertEquals(list,new LongListList(ilist)); - - ilist.add((long)1); - list.add(new Long(1)); - - assertTrue("Unwrapped, non-empty List is not equal to non-empty LongList.",!ilist.equals(list)); - assertTrue("Unwrapped, non-empty LongList is not equal to non-empty List.",!list.equals(ilist)); - - assertEquals(new ListLongList(list),ilist); - assertEquals(ilist,new ListLongList(list)); - assertEquals(new LongListList(ilist),list); - assertEquals(list,new LongListList(ilist)); - - ilist.add(1); ilist.add(2); ilist.add(3); ilist.add(5); ilist.add(8); - list.add(new Long(1)); list.add(new Long(2)); list.add(new Long(3)); list.add(new Long(5)); list.add(new Long(8)); - - assertTrue("Unwrapped, non-empty List is not equal to non-empty LongList.",!ilist.equals(list)); - assertTrue("Unwrapped, non-empty LongList is not equal to non-empty List.",!list.equals(ilist)); - - assertEquals(new ListLongList(list),ilist); - assertEquals(ilist,new ListLongList(list)); - assertEquals(new LongListList(ilist),list); - assertEquals(list,new LongListList(ilist)); - - } - - public void testClearAndSize() { - LongList list = makeEmptyLongList(); - assertEquals(0, list.size()); - for(int i = 0; i < 100; i++) { - list.add((long)i); - } - assertEquals(100, list.size()); - list.clear(); - assertEquals(0, list.size()); - } - - public void testRemoveViaSubList() { - LongList list = makeEmptyLongList(); - for(int i = 0; i < 100; i++) { - list.add((long)i); - } - LongList sub = list.subList(25,75); - assertEquals(50,sub.size()); - for(int i = 0; i < 50; i++) { - assertEquals(100-i,list.size()); - assertEquals(50-i,sub.size()); - assertEquals(25+i,sub.removeElementAt(0)); - assertEquals(50-i-1,sub.size()); - assertEquals(100-i-1,list.size()); - } - assertEquals(0,sub.size()); - assertEquals(50,list.size()); - } - - public void testAddGet() { - LongList list = makeEmptyLongList(); - for (int i = 0; i < 1000; i++) { - list.add((long)i); - } - for (int i = 0; i < 1000; i++) { - assertEquals((long)i, list.get(i)); - } - } - - public void testAddAndShift() { - LongList list = makeEmptyLongList(); - list.add(0, (long)1); - assertEquals("Should have one entry", 1, list.size()); - list.add((long)3); - list.add((long)4); - list.add(1, (long)2); - for(int i = 0; i < 4; i++) { - assertEquals("Should get entry back", (long)(i + 1), list.get(i)); - } - list.add(0, (long)0); - for (int i = 0; i < 5; i++) { - assertEquals("Should get entry back", (long)i, list.get(i)); - } - } - - public void testIsSerializable() throws Exception { - LongList list = makeFullLongList(); - assertTrue(list instanceof Serializable); - byte[] ser = writeExternalFormToBytes((Serializable)list); - LongList deser = (LongList)(readExternalFormFromBytes(ser)); - assertEquals(list,deser); - assertEquals(deser,list); - } - - public void testLongListSerializeDeserializeThenCompare() throws Exception { - LongList list = makeFullLongList(); - if(list instanceof Serializable) { - byte[] ser = writeExternalFormToBytes((Serializable)list); - LongList deser = (LongList)(readExternalFormFromBytes(ser)); - assertEquals("obj != deserialize(serialize(obj))",list,deser); - } - } - - public void testSubListsAreNotSerializable() throws Exception { - LongList list = makeFullLongList().subList(2,3); - assertTrue( ! (list instanceof Serializable) ); - } - - public void testSubListOutOfBounds() throws Exception { - try { - makeEmptyLongList().subList(2,3); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullLongList().subList(-1,3); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - - try { - makeFullLongList().subList(5,2); - fail("Expected IllegalArgumentException"); - } catch(IllegalArgumentException e) { - // expected - } - - try { - makeFullLongList().subList(2,makeFullLongList().size()+2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - } - - public void testListIteratorOutOfBounds() throws Exception { - try { - makeEmptyLongList().listIterator(2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullLongList().listIterator(-1); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - - try { - makeFullLongList().listIterator(makeFullLongList().size()+2); - fail("Expected IndexOutOfBoundsException"); - } catch(IndexOutOfBoundsException e) { - // expected - } - } - - public void testListIteratorSetWithoutNext() throws Exception { - LongListIterator iter = makeFullLongList().listIterator(); - try { - iter.set(3); - fail("Expected IllegalStateException"); - } catch(IllegalStateException e) { - // expected - } - } - - public void testListIteratorSetAfterRemove() throws Exception { - LongListIterator iter = makeFullLongList().listIterator(); - iter.next(); - iter.remove(); - try { - iter.set(3); - fail("Expected IllegalStateException"); - } catch(IllegalStateException e) { - // expected - } - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestLongListIterator.java b/src/test/org/apache/commons/collections/primitives/TestLongListIterator.java deleted file mode 100644 index d98555ef7..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestLongListIterator.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestLongListIterator.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public abstract class TestLongListIterator extends TestLongIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public LongIterator makeEmptyLongIterator() { - return makeEmptyLongListIterator(); - } - - public LongIterator makeFullLongIterator() { - return makeFullLongListIterator(); - } - - public abstract LongListIterator makeEmptyLongListIterator(); - public abstract LongListIterator makeFullLongListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessByteList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessByteList.java deleted file mode 100644 index 719dc46b0..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessByteList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessByteList.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessByteList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessByteList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessByteList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessByteList list = new AbstractRandomAccessByteListImpl(); - try { - list.add((byte)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(byte)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessByteList list = new AbstractRandomAccessByteListImpl(); - ByteList list2 = new ArrayByteList(); - list2.add((byte)3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessByteList list = new AbstractRandomAccessByteListImpl(); - try { - list.set(0,(byte)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessByteList list = new AbstractRandomAccessByteListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessByteListImpl extends RandomAccessByteList { - public AbstractRandomAccessByteListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.ByteList#get(int) - */ - public byte get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.ByteCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessCharList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessCharList.java deleted file mode 100644 index d7ff9c131..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessCharList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessCharList.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessCharList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessCharList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessCharList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessCharList list = new AbstractRandomAccessCharListImpl(); - try { - list.add((char)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(char)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessCharList list = new AbstractRandomAccessCharListImpl(); - CharList list2 = new ArrayCharList(); - list2.add((char)3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessCharList list = new AbstractRandomAccessCharListImpl(); - try { - list.set(0,(char)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessCharList list = new AbstractRandomAccessCharListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessCharListImpl extends RandomAccessCharList { - public AbstractRandomAccessCharListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.CharList#get(int) - */ - public char get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.CharCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessDoubleList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessDoubleList.java deleted file mode 100644 index 7b10b18a3..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessDoubleList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessDoubleList.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessDoubleList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessDoubleList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessDoubleList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessDoubleList list = new AbstractRandomAccessDoubleListImpl(); - try { - list.add((double)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(double)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessDoubleList list = new AbstractRandomAccessDoubleListImpl(); - DoubleList list2 = new ArrayDoubleList(); - list2.add((double)3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessDoubleList list = new AbstractRandomAccessDoubleListImpl(); - try { - list.set(0,(double)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessDoubleList list = new AbstractRandomAccessDoubleListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessDoubleListImpl extends RandomAccessDoubleList { - public AbstractRandomAccessDoubleListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.DoubleList#get(int) - */ - public double get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.DoubleCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessFloatList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessFloatList.java deleted file mode 100644 index 4c8ecf7f6..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessFloatList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessFloatList.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessFloatList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessFloatList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessFloatList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessFloatList list = new AbstractRandomAccessFloatListImpl(); - try { - list.add((float)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(float)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessFloatList list = new AbstractRandomAccessFloatListImpl(); - FloatList list2 = new ArrayFloatList(); - list2.add((float)3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessFloatList list = new AbstractRandomAccessFloatListImpl(); - try { - list.set(0,(float)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessFloatList list = new AbstractRandomAccessFloatListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessFloatListImpl extends RandomAccessFloatList { - public AbstractRandomAccessFloatListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.FloatList#get(int) - */ - public float get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.FloatCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessIntList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessIntList.java deleted file mode 100644 index effd2a988..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessIntList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessIntList.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessIntList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessIntList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessIntList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessIntList list = new AbstractRandomAccessIntListImpl(); - try { - list.add(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessIntList list = new AbstractRandomAccessIntListImpl(); - IntList list2 = new ArrayIntList(); - list2.add(3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessIntList list = new AbstractRandomAccessIntListImpl(); - try { - list.set(0,1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessIntList list = new AbstractRandomAccessIntListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessIntListImpl extends RandomAccessIntList { - public AbstractRandomAccessIntListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.IntList#get(int) - */ - public int get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.IntCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessLongList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessLongList.java deleted file mode 100644 index 1519a828a..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessLongList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessLongList.java,v 1.2 2003/08/31 17:28:40 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:40 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessLongList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessLongList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessLongList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessLongList list = new AbstractRandomAccessLongListImpl(); - try { - list.add((long)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(long)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessLongList list = new AbstractRandomAccessLongListImpl(); - LongList list2 = new ArrayLongList(); - list2.add(3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessLongList list = new AbstractRandomAccessLongListImpl(); - try { - list.set(0,(long)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessLongList list = new AbstractRandomAccessLongListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessLongListImpl extends RandomAccessLongList { - public AbstractRandomAccessLongListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.LongList#get(int) - */ - public long get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.LongCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestRandomAccessShortList.java b/src/test/org/apache/commons/collections/primitives/TestRandomAccessShortList.java deleted file mode 100644 index 44e854ce7..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestRandomAccessShortList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestRandomAccessShortList.java,v 1.2 2003/08/31 17:28:41 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public class TestRandomAccessShortList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestRandomAccessShortList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestRandomAccessShortList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testAddIsUnsupportedByDefault() { - RandomAccessShortList list = new AbstractRandomAccessShortListImpl(); - try { - list.add((short)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - list.set(0,(short)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testAddAllIsUnsupportedByDefault() { - RandomAccessShortList list = new AbstractRandomAccessShortListImpl(); - ShortList list2 = new ArrayShortList(); - list2.add((short)3); - try { - list.addAll(list2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testSetIsUnsupportedByDefault() { - RandomAccessShortList list = new AbstractRandomAccessShortListImpl(); - try { - list.set(0,(short)1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public void testRemoveElementIsUnsupportedByDefault() { - RandomAccessShortList list = new AbstractRandomAccessShortListImpl(); - try { - list.removeElementAt(0); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - // inner classes - // ------------------------------------------------------------------------ - - - static class AbstractRandomAccessShortListImpl extends RandomAccessShortList { - public AbstractRandomAccessShortListImpl() { - } - - /** - * @see org.apache.commons.collections.primitives.ShortList#get(int) - */ - public short get(int index) { - throw new IndexOutOfBoundsException(); - } - - /** - * @see org.apache.commons.collections.primitives.ShortCollection#size() - */ - public int size() { - return 0; - } - - } -} diff --git a/src/test/org/apache/commons/collections/primitives/TestShortIterator.java b/src/test/org/apache/commons/collections/primitives/TestShortIterator.java deleted file mode 100644 index 8476d04d2..000000000 --- a/src/test/org/apache/commons/collections/primitives/TestShortIterator.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestShortIterator.java,v 1.3 2003/10/01 21:54:56 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.adapters.ShortIteratorIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:56 $ - * @author Rodney Waldhoff - */ -public abstract class TestShortIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return ShortIteratorIterator.wrap(makeEmptyShortIterator()); - } - - public Iterator makeFullIterator() { - return ShortIteratorIterator.wrap(makeFullShortIterator()); - } - - - protected abstract ShortIterator makeEmptyShortIterator(); - protected abstract ShortIterator makeFullShortIterator(); - protected abstract short[] getFullElements(); - - // tests - // ------------------------------------------------------------------------ - - public void testNextHasNextRemove() { - short[] elements = getFullElements(); - ShortIterator iter = makeFullShortIterator(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.adapters.ListShortList; -import org.apache.commons.collections.primitives.adapters.ShortListList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:11 $ - * @author Rodney Waldhoff - */ -public abstract class TestShortList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortList(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - // collections testing framework: short list - // ------------------------------------------------------------------------ - - protected abstract ShortList makeEmptyShortList(); - - protected ShortList makeFullShortList() { - ShortList list = makeEmptyShortList(); - short[] values = getFullShorts(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:41 $ - * @author Rodney Waldhoff - */ -public abstract class TestShortListIterator extends TestShortIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortListIterator(String testName) { - super(testName); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ShortIterator makeEmptyShortIterator() { - return makeEmptyShortListIterator(); - } - - public ShortIterator makeFullShortIterator() { - return makeFullShortListIterator(); - } - - public abstract ShortListIterator makeEmptyShortListIterator(); - public abstract ShortListIterator makeFullShortListIterator(); - - // tests - // ------------------------------------------------------------------------ - - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestAll.java b/src/test/org/apache/commons/collections/primitives/adapters/TestAll.java deleted file mode 100644 index e3bb0609c..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestAll.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestAll.java,v 1.10 2003/08/31 17:28:38 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.10 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestAll extends TestCase { - public TestAll(String testName) { - super(testName); - } - - public static void main(String args[]) { - String[] testCaseName = { TestAll.class.getName() }; - junit.textui.TestRunner.main(testCaseName); - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTest(TestCollectionByteCollection.suite()); - suite.addTest(TestByteCollectionCollection.suite()); - suite.addTest(TestByteListList.suite()); - suite.addTest(TestListByteList.suite()); - suite.addTest(TestIteratorByteIterator.suite()); - suite.addTest(TestListIteratorByteListIterator.suite()); - suite.addTest(TestByteIteratorIterator.suite()); - suite.addTest(TestByteListIteratorListIterator.suite()); - - suite.addTest(TestCollectionShortCollection.suite()); - suite.addTest(TestShortCollectionCollection.suite()); - suite.addTest(TestShortListList.suite()); - suite.addTest(TestListShortList.suite()); - suite.addTest(TestIteratorShortIterator.suite()); - suite.addTest(TestListIteratorShortListIterator.suite()); - suite.addTest(TestShortIteratorIterator.suite()); - suite.addTest(TestShortListIteratorListIterator.suite()); - - suite.addTest(TestCollectionCharCollection.suite()); - suite.addTest(TestCharCollectionCollection.suite()); - suite.addTest(TestCharListList.suite()); - suite.addTest(TestListCharList.suite()); - suite.addTest(TestIteratorCharIterator.suite()); - suite.addTest(TestListIteratorCharListIterator.suite()); - suite.addTest(TestCharIteratorIterator.suite()); - suite.addTest(TestCharListIteratorListIterator.suite()); - - suite.addTest(TestCollectionIntCollection.suite()); - suite.addTest(TestIntCollectionCollection.suite()); - suite.addTest(TestIntListList.suite()); - suite.addTest(TestListIntList.suite()); - suite.addTest(TestIteratorIntIterator.suite()); - suite.addTest(TestListIteratorIntListIterator.suite()); - suite.addTest(TestIntIteratorIterator.suite()); - suite.addTest(TestIntListIteratorListIterator.suite()); - - suite.addTest(TestCollectionLongCollection.suite()); - suite.addTest(TestLongCollectionCollection.suite()); - suite.addTest(TestLongListList.suite()); - suite.addTest(TestListLongList.suite()); - suite.addTest(TestIteratorLongIterator.suite()); - suite.addTest(TestListIteratorLongListIterator.suite()); - suite.addTest(TestLongIteratorIterator.suite()); - suite.addTest(TestLongListIteratorListIterator.suite()); - - suite.addTest(TestCollectionFloatCollection.suite()); - suite.addTest(TestFloatCollectionCollection.suite()); - suite.addTest(TestFloatListList.suite()); - suite.addTest(TestListFloatList.suite()); - suite.addTest(TestIteratorFloatIterator.suite()); - suite.addTest(TestListIteratorFloatListIterator.suite()); - suite.addTest(TestFloatIteratorIterator.suite()); - suite.addTest(TestFloatListIteratorListIterator.suite()); - - suite.addTest(TestCollectionDoubleCollection.suite()); - suite.addTest(TestDoubleCollectionCollection.suite()); - suite.addTest(TestDoubleListList.suite()); - suite.addTest(TestListDoubleList.suite()); - suite.addTest(TestIteratorDoubleIterator.suite()); - suite.addTest(TestListIteratorDoubleListIterator.suite()); - suite.addTest(TestDoubleIteratorIterator.suite()); - suite.addTest(TestDoubleListIteratorListIterator.suite()); - - suite.addTest(org.apache.commons.collections.primitives.adapters.io.TestAll.suite()); - - return suite; - } -} - diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestByteCollectionCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestByteCollectionCollection.java deleted file mode 100644 index f01652578..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestByteCollectionCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestByteCollectionCollection.java,v 1.4 2003/11/16 22:15:08 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayByteList; -import org.apache.commons.collections.primitives.ByteList; -import org.apache.commons.collections.primitives.RandomAccessByteList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestByteCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestByteCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - ByteList list = new ArrayByteList(); - for(int i=0;i<10;i++) { - list.add((byte)i); - } - return new ByteCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(ByteCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = ByteCollectionCollection.wrap(new ArrayByteList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = ByteCollectionCollection.wrap(new RandomAccessByteList() { - public byte get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestByteIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestByteIteratorIterator.java deleted file mode 100644 index a0eaf6448..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestByteIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestByteIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayByteList; -import org.apache.commons.collections.primitives.ByteList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestByteIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestByteIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return ByteIteratorIterator.wrap(makeEmptyByteList().iterator()); - } - - public Iterator makeFullIterator() { - return ByteIteratorIterator.wrap(makeFullByteList().iterator()); - } - - protected ByteList makeEmptyByteList() { - return new ArrayByteList(); - } - - protected ByteList makeFullByteList() { - ByteList list = makeEmptyByteList(); - byte[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayByteList; -import org.apache.commons.collections.primitives.ByteList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestByteListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestByteListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return ByteListIteratorListIterator.wrap(makeEmptyByteList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return ByteListIteratorListIterator.wrap(makeFullByteList().listIterator()); - } - - protected ByteList makeEmptyByteList() { - return new ArrayByteList(); - } - - protected ByteList makeFullByteList() { - ByteList list = makeEmptyByteList(); - byte[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayByteList; -import org.apache.commons.collections.primitives.RandomAccessByteList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestByteListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestByteListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new ByteListList(new ArrayByteList()); - } - - protected Object[] getFullElements() { - Byte[] elts = new Byte[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayCharList; -import org.apache.commons.collections.primitives.CharList; -import org.apache.commons.collections.primitives.RandomAccessCharList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestCharCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCharCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - CharList list = new ArrayCharList(); - for(int i=0;i<10;i++) { - list.add((char)i); - } - return new CharCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CharCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = CharCollectionCollection.wrap(new ArrayCharList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = CharCollectionCollection.wrap(new RandomAccessCharList() { - public char get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCharIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCharIteratorIterator.java deleted file mode 100644 index 916f1cf14..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCharIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCharIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayCharList; -import org.apache.commons.collections.primitives.CharList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestCharIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCharIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return CharIteratorIterator.wrap(makeEmptyCharList().iterator()); - } - - public Iterator makeFullIterator() { - return CharIteratorIterator.wrap(makeFullCharList().iterator()); - } - - protected CharList makeEmptyCharList() { - return new ArrayCharList(); - } - - protected CharList makeFullCharList() { - CharList list = makeEmptyCharList(); - char[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayCharList; -import org.apache.commons.collections.primitives.CharList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestCharListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCharListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return CharListIteratorListIterator.wrap(makeEmptyCharList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return CharListIteratorListIterator.wrap(makeFullCharList().listIterator()); - } - - protected CharList makeEmptyCharList() { - return new ArrayCharList(); - } - - protected CharList makeFullCharList() { - CharList list = makeEmptyCharList(); - char[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayCharList; -import org.apache.commons.collections.primitives.RandomAccessCharList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestCharListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestCharListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new CharListList(new ArrayCharList()); - } - - protected Object[] getFullElements() { - Character[] elts = new Character[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ByteCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionByteCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionByteCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionByteCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Byte((byte)i)); - } - return new CollectionByteCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionByteCollection.wrap(null)); - } - - public void testWrapSerializable() { - ByteCollection collection = CollectionByteCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - ByteCollection collection = CollectionByteCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionCharCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionCharCollection.java deleted file mode 100644 index deec34021..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionCharCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionCharCollection.java,v 1.3 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.CharCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionCharCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionCharCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionCharCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Character((char)i)); - } - return new CollectionCharCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionCharCollection.wrap(null)); - } - - public void testWrapSerializable() { - CharCollection collection = CollectionCharCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - CharCollection collection = CollectionCharCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionDoubleCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionDoubleCollection.java deleted file mode 100644 index a97af49ef..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionDoubleCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionDoubleCollection.java,v 1.3 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.DoubleCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionDoubleCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionDoubleCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionDoubleCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Double((double)i)); - } - return new CollectionDoubleCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionDoubleCollection.wrap(null)); - } - - public void testWrapSerializable() { - DoubleCollection collection = CollectionDoubleCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - DoubleCollection collection = CollectionDoubleCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionFloatCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionFloatCollection.java deleted file mode 100644 index 1f4570b6a..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionFloatCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionFloatCollection.java,v 1.3 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.FloatCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionFloatCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionFloatCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionFloatCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Float((float)i)); - } - return new CollectionFloatCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionFloatCollection.wrap(null)); - } - - public void testWrapSerializable() { - FloatCollection collection = CollectionFloatCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - FloatCollection collection = CollectionFloatCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionIntCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionIntCollection.java deleted file mode 100644 index 6de6618fd..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionIntCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionIntCollection.java,v 1.4 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.IntCollection; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionIntCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionIntCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionIntCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Integer(i)); - } - return new CollectionIntCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionIntCollection.wrap(null)); - } - - public void testWrapSerializable() { - IntCollection collection = CollectionIntCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - IntCollection collection = CollectionIntCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionLongCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionLongCollection.java deleted file mode 100644 index 442510495..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionLongCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionLongCollection.java,v 1.3 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.LongCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionLongCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionLongCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionLongCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Long(i)); - } - return new CollectionLongCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionLongCollection.wrap(null)); - } - - public void testWrapSerializable() { - LongCollection collection = CollectionLongCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - LongCollection collection = CollectionLongCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionShortCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionShortCollection.java deleted file mode 100644 index 39a5b4af5..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestCollectionShortCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCollectionShortCollection.java,v 1.3 2003/10/02 22:14:31 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ShortCollection; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:31 $ - * @author Rodney Waldhoff - */ -public class TestCollectionShortCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestCollectionShortCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCollectionShortCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - List list = new ArrayList(); - for(int i=0;i<10;i++) { - list.add(new Short((short)i)); - } - return new CollectionShortCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(CollectionShortCollection.wrap(null)); - } - - public void testWrapSerializable() { - ShortCollection collection = CollectionShortCollection.wrap(new ArrayList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - ShortCollection collection = CollectionShortCollection.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleCollectionCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleCollectionCollection.java deleted file mode 100644 index fb1846539..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleCollectionCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestDoubleCollectionCollection.java,v 1.4 2003/11/16 22:15:08 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayDoubleList; -import org.apache.commons.collections.primitives.DoubleList; -import org.apache.commons.collections.primitives.RandomAccessDoubleList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestDoubleCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestDoubleCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - DoubleList list = new ArrayDoubleList(); - for(int i=0;i<10;i++) { - list.add((double)i); - } - return new DoubleCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(DoubleCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = DoubleCollectionCollection.wrap(new ArrayDoubleList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = DoubleCollectionCollection.wrap(new RandomAccessDoubleList() { - public double get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleIteratorIterator.java deleted file mode 100644 index 638029057..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestDoubleIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestDoubleIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayDoubleList; -import org.apache.commons.collections.primitives.DoubleList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestDoubleIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestDoubleIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return DoubleIteratorIterator.wrap(makeEmptyDoubleList().iterator()); - } - - public Iterator makeFullIterator() { - return DoubleIteratorIterator.wrap(makeFullDoubleList().iterator()); - } - - protected DoubleList makeEmptyDoubleList() { - return new ArrayDoubleList(); - } - - protected DoubleList makeFullDoubleList() { - DoubleList list = makeEmptyDoubleList(); - double[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayDoubleList; -import org.apache.commons.collections.primitives.DoubleList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestDoubleListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestDoubleListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return DoubleListIteratorListIterator.wrap(makeEmptyDoubleList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return DoubleListIteratorListIterator.wrap(makeFullDoubleList().listIterator()); - } - - protected DoubleList makeEmptyDoubleList() { - return new ArrayDoubleList(); - } - - protected DoubleList makeFullDoubleList() { - DoubleList list = makeEmptyDoubleList(); - double[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayDoubleList; -import org.apache.commons.collections.primitives.RandomAccessDoubleList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestDoubleListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestDoubleListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestDoubleListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new DoubleListList(new ArrayDoubleList()); - } - - protected Object[] getFullElements() { - Double[] elts = new Double[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayFloatList; -import org.apache.commons.collections.primitives.FloatList; -import org.apache.commons.collections.primitives.RandomAccessFloatList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestFloatCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestFloatCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - FloatList list = new ArrayFloatList(); - for(int i=0;i<10;i++) { - list.add((float)i); - } - return new FloatCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(FloatCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = FloatCollectionCollection.wrap(new ArrayFloatList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = FloatCollectionCollection.wrap(new RandomAccessFloatList() { - public float get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestFloatIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestFloatIteratorIterator.java deleted file mode 100644 index 8a259c204..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestFloatIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestFloatIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayFloatList; -import org.apache.commons.collections.primitives.FloatList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestFloatIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestFloatIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return FloatIteratorIterator.wrap(makeEmptyFloatList().iterator()); - } - - public Iterator makeFullIterator() { - return FloatIteratorIterator.wrap(makeFullFloatList().iterator()); - } - - protected FloatList makeEmptyFloatList() { - return new ArrayFloatList(); - } - - protected FloatList makeFullFloatList() { - FloatList list = makeEmptyFloatList(); - float[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayFloatList; -import org.apache.commons.collections.primitives.FloatList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestFloatListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestFloatListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return FloatListIteratorListIterator.wrap(makeEmptyFloatList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return FloatListIteratorListIterator.wrap(makeFullFloatList().listIterator()); - } - - protected FloatList makeEmptyFloatList() { - return new ArrayFloatList(); - } - - protected FloatList makeFullFloatList() { - FloatList list = makeEmptyFloatList(); - float[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayFloatList; -import org.apache.commons.collections.primitives.RandomAccessFloatList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestFloatListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestFloatListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestFloatListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new FloatListList(new ArrayFloatList()); - } - - protected Object[] getFullElements() { - Float[] elts = new Float[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.RandomAccessIntList; - -/** - * @version $Revision: 1.6 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestIntCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIntCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - IntList list = new ArrayIntList(); - for(int i=0;i<10;i++) { - list.add(i); - } - return new IntCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(IntCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = IntCollectionCollection.wrap(new ArrayIntList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = IntCollectionCollection.wrap(new RandomAccessIntList() { - public int get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestIntIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestIntIteratorIterator.java deleted file mode 100644 index 4e234f8e7..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestIntIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestIntIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestIntIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIntIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return IntIteratorIterator.wrap(makeEmptyIntList().iterator()); - } - - public Iterator makeFullIterator() { - return IntIteratorIterator.wrap(makeFullIntList().iterator()); - } - - protected IntList makeEmptyIntList() { - return new ArrayIntList(); - } - - protected IntList makeFullIntList() { - IntList list = makeEmptyIntList(); - int[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntList; - -/** - * @version $Revision: 1.6 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestIntListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIntListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return IntListIteratorListIterator.wrap(makeEmptyIntList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return IntListIteratorListIterator.wrap(makeFullIntList().listIterator()); - } - - protected IntList makeEmptyIntList() { - return new ArrayIntList(); - } - - protected IntList makeFullIntList() { - IntList list = makeEmptyIntList(); - int[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.RandomAccessIntList; - -/** - * @version $Revision: 1.7 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestIntListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestIntListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestIntListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new IntListList(new ArrayIntList()); - } - - protected Object[] getFullElements() { - Integer[] elts = new Integer[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ByteIterator; -import org.apache.commons.collections.primitives.TestByteIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorByteIterator extends TestByteIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorByteIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorByteIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ByteIterator makeEmptyByteIterator() { - return IteratorByteIterator.wrap(makeEmptyList().iterator()); - } - - public ByteIterator makeFullByteIterator() { - return IteratorByteIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - byte[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.CharIterator; -import org.apache.commons.collections.primitives.TestCharIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorCharIterator extends TestCharIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorCharIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorCharIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public CharIterator makeEmptyCharIterator() { - return IteratorCharIterator.wrap(makeEmptyList().iterator()); - } - - public CharIterator makeFullCharIterator() { - return IteratorCharIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - char[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.DoubleIterator; -import org.apache.commons.collections.primitives.TestDoubleIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorDoubleIterator extends TestDoubleIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorDoubleIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorDoubleIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public DoubleIterator makeEmptyDoubleIterator() { - return IteratorDoubleIterator.wrap(makeEmptyList().iterator()); - } - - public DoubleIterator makeFullDoubleIterator() { - return IteratorDoubleIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - double[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.FloatIterator; -import org.apache.commons.collections.primitives.TestFloatIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorFloatIterator extends TestFloatIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorFloatIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorFloatIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public FloatIterator makeEmptyFloatIterator() { - return IteratorFloatIterator.wrap(makeEmptyList().iterator()); - } - - public FloatIterator makeFullFloatIterator() { - return IteratorFloatIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - float[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.TestIntIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorIntIterator extends TestIntIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorIntIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorIntIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public IntIterator makeEmptyIntIterator() { - return IteratorIntIterator.wrap(makeEmptyList().iterator()); - } - - public IntIterator makeFullIntIterator() { - return IteratorIntIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - int[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.LongIterator; -import org.apache.commons.collections.primitives.TestLongIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorLongIterator extends TestLongIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorLongIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorLongIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public LongIterator makeEmptyLongIterator() { - return IteratorLongIterator.wrap(makeEmptyList().iterator()); - } - - public LongIterator makeFullLongIterator() { - return IteratorLongIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - long[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ShortIterator; -import org.apache.commons.collections.primitives.TestShortIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestIteratorShortIterator extends TestShortIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestIteratorShortIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestIteratorShortIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ShortIterator makeEmptyShortIterator() { - return IteratorShortIterator.wrap(makeEmptyList().iterator()); - } - - public ShortIterator makeFullShortIterator() { - return IteratorShortIterator.wrap(makeFullList().iterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - short[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.ByteList; -import org.apache.commons.collections.primitives.TestByteList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListByteList extends TestByteList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListByteList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListByteList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestByteList#makeEmptyByteList() - */ - protected ByteList makeEmptyByteList() { - return new ListByteList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListByteList.bulkTestSubList.testFullListSerialization", - "TestListByteList.bulkTestSubList.testEmptyListSerialization", - "TestListByteList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListByteList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListByteList.bulkTestSubList.testEmptyListCompatibility", - "TestListByteList.bulkTestSubList.testFullListCompatibility", - "TestListByteList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListByteList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListByteList.wrap(null)); - } - - public void testWrapSerializable() { - ByteList list = ListByteList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - ByteList list = ListByteList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListCharList.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListCharList.java deleted file mode 100644 index 15731fed2..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListCharList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListCharList.java,v 1.3 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.CharList; -import org.apache.commons.collections.primitives.TestCharList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListCharList extends TestCharList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListCharList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListCharList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestCharList#makeEmptyCharList() - */ - protected CharList makeEmptyCharList() { - return new ListCharList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListCharList.bulkTestSubList.testFullListSerialization", - "TestListCharList.bulkTestSubList.testEmptyListSerialization", - "TestListCharList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListCharList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListCharList.bulkTestSubList.testEmptyListCompatibility", - "TestListCharList.bulkTestSubList.testFullListCompatibility", - "TestListCharList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListCharList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListCharList.wrap(null)); - } - - public void testWrapSerializable() { - CharList list = ListCharList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - CharList list = ListCharList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListDoubleList.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListDoubleList.java deleted file mode 100644 index 09c31297d..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListDoubleList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListDoubleList.java,v 1.3 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.DoubleList; -import org.apache.commons.collections.primitives.TestDoubleList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListDoubleList extends TestDoubleList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListDoubleList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListDoubleList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestDoubleList#makeEmptyDoubleList() - */ - protected DoubleList makeEmptyDoubleList() { - return new ListDoubleList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListDoubleList.bulkTestSubList.testFullListSerialization", - "TestListDoubleList.bulkTestSubList.testEmptyListSerialization", - "TestListDoubleList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListDoubleList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListDoubleList.bulkTestSubList.testEmptyListCompatibility", - "TestListDoubleList.bulkTestSubList.testFullListCompatibility", - "TestListDoubleList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListDoubleList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListDoubleList.wrap(null)); - } - - public void testWrapSerializable() { - DoubleList list = ListDoubleList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - DoubleList list = ListDoubleList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListFloatList.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListFloatList.java deleted file mode 100644 index 328fe0900..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListFloatList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListFloatList.java,v 1.3 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.FloatList; -import org.apache.commons.collections.primitives.TestFloatList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListFloatList extends TestFloatList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListFloatList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListFloatList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestFloatList#makeEmptyFloatList() - */ - protected FloatList makeEmptyFloatList() { - return new ListFloatList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListFloatList.bulkTestSubList.testFullListSerialization", - "TestListFloatList.bulkTestSubList.testEmptyListSerialization", - "TestListFloatList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListFloatList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListFloatList.bulkTestSubList.testEmptyListCompatibility", - "TestListFloatList.bulkTestSubList.testFullListCompatibility", - "TestListFloatList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListFloatList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListFloatList.wrap(null)); - } - - public void testWrapSerializable() { - FloatList list = ListFloatList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - FloatList list = ListFloatList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListIntList.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListIntList.java deleted file mode 100644 index 82ed923a3..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListIntList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListIntList.java,v 1.6 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.TestIntList; - -/** - * @version $Revision: 1.6 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListIntList extends TestIntList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIntList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListIntList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestIntList#makeEmptyIntList() - */ - protected IntList makeEmptyIntList() { - return new ListIntList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListIntList.bulkTestSubList.testFullListSerialization", - "TestListIntList.bulkTestSubList.testEmptyListSerialization", - "TestListIntList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListIntList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListIntList.bulkTestSubList.testEmptyListCompatibility", - "TestListIntList.bulkTestSubList.testFullListCompatibility", - "TestListIntList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListIntList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListIntList.wrap(null)); - } - - public void testWrapSerializable() { - IntList list = ListIntList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - IntList list = ListIntList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorByteListIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorByteListIterator.java deleted file mode 100644 index e9b6ec110..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListIteratorByteListIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListIteratorByteListIterator.java,v 1.2 2003/08/31 17:28:38 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ByteListIterator; -import org.apache.commons.collections.primitives.TestByteListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorByteListIterator extends TestByteListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorByteListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorByteListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ByteListIterator makeEmptyByteListIterator() { - return ListIteratorByteListIterator.wrap(makeEmptyList().listIterator()); - } - - public ByteListIterator makeFullByteListIterator() { - return ListIteratorByteListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - byte[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.CharListIterator; -import org.apache.commons.collections.primitives.TestCharListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorCharListIterator extends TestCharListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorCharListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorCharListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public CharListIterator makeEmptyCharListIterator() { - return ListIteratorCharListIterator.wrap(makeEmptyList().listIterator()); - } - - public CharListIterator makeFullCharListIterator() { - return ListIteratorCharListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - char[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.DoubleListIterator; -import org.apache.commons.collections.primitives.TestDoubleListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorDoubleListIterator extends TestDoubleListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorDoubleListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorDoubleListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public DoubleListIterator makeEmptyDoubleListIterator() { - return ListIteratorDoubleListIterator.wrap(makeEmptyList().listIterator()); - } - - public DoubleListIterator makeFullDoubleListIterator() { - return ListIteratorDoubleListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - double[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.FloatListIterator; -import org.apache.commons.collections.primitives.TestFloatListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorFloatListIterator extends TestFloatListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorFloatListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorFloatListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public FloatListIterator makeEmptyFloatListIterator() { - return ListIteratorFloatListIterator.wrap(makeEmptyList().listIterator()); - } - - public FloatListIterator makeFullFloatListIterator() { - return ListIteratorFloatListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - float[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntListIterator; -import org.apache.commons.collections.primitives.TestIntListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorIntListIterator extends TestIntListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorIntListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorIntListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public IntListIterator makeEmptyIntListIterator() { - return ListIteratorIntListIterator.wrap(makeEmptyList().listIterator()); - } - - public IntListIterator makeFullIntListIterator() { - return ListIteratorIntListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - int[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.LongListIterator; -import org.apache.commons.collections.primitives.TestLongListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorLongListIterator extends TestLongListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorLongListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorLongListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public LongListIterator makeEmptyLongListIterator() { - return ListIteratorLongListIterator.wrap(makeEmptyList().listIterator()); - } - - public LongListIterator makeFullLongListIterator() { - return ListIteratorLongListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - long[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ShortListIterator; -import org.apache.commons.collections.primitives.TestShortListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $ - * @author Rodney Waldhoff - */ -public class TestListIteratorShortListIterator extends TestShortListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestListIteratorShortListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestListIteratorShortListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ShortListIterator makeEmptyShortListIterator() { - return ListIteratorShortListIterator.wrap(makeEmptyList().listIterator()); - } - - public ShortListIterator makeFullShortListIterator() { - return ListIteratorShortListIterator.wrap(makeFullList().listIterator()); - } - - protected List makeEmptyList() { - return new ArrayList(); - } - - protected List makeFullList() { - List list = makeEmptyList(); - short[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.LongList; -import org.apache.commons.collections.primitives.TestLongList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListLongList extends TestLongList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListLongList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListLongList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestLongList#makeEmptyLongList() - */ - protected LongList makeEmptyLongList() { - return new ListLongList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListLongList.bulkTestSubList.testFullListSerialization", - "TestListLongList.bulkTestSubList.testEmptyListSerialization", - "TestListLongList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListLongList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListLongList.bulkTestSubList.testEmptyListCompatibility", - "TestListLongList.bulkTestSubList.testFullListCompatibility", - "TestListLongList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListLongList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListLongList.wrap(null)); - } - - public void testWrapSerializable() { - LongList list = ListLongList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - LongList list = ListLongList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestListShortList.java b/src/test/org/apache/commons/collections/primitives/adapters/TestListShortList.java deleted file mode 100644 index 5d37fc9ee..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestListShortList.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestListShortList.java,v 1.3 2003/10/05 20:48:58 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.AbstractList; -import java.util.ArrayList; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.primitives.ShortList; -import org.apache.commons.collections.primitives.TestShortList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/05 20:48:58 $ - * @author Rodney Waldhoff - */ -public class TestListShortList extends TestShortList { - - // conventional - // ------------------------------------------------------------------------ - - public TestListShortList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestListShortList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - /** - * @see org.apache.commons.collections.primitives.TestShortList#makeEmptyShortList() - */ - protected ShortList makeEmptyShortList() { - return new ListShortList(new ArrayList()); - } - - protected String[] ignoredTests() { - // sublists are not serializable - return new String[] { - "TestListShortList.bulkTestSubList.testFullListSerialization", - "TestListShortList.bulkTestSubList.testEmptyListSerialization", - "TestListShortList.bulkTestSubList.testCanonicalEmptyCollectionExists", - "TestListShortList.bulkTestSubList.testCanonicalFullCollectionExists", - "TestListShortList.bulkTestSubList.testEmptyListCompatibility", - "TestListShortList.bulkTestSubList.testFullListCompatibility", - "TestListShortList.bulkTestSubList.testSerializeDeserializeThenCompare", - "TestListShortList.bulkTestSubList.testSimpleSerialization" - }; - } - - // tests - // ------------------------------------------------------------------------ - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testEmptyListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testFullListCompatibility() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - public void testWrapNull() { - assertNull(ListShortList.wrap(null)); - } - - public void testWrapSerializable() { - ShortList list = ListShortList.wrap(new ArrayList()); - assertNotNull(list); - assertTrue(list instanceof Serializable); - } - - public void testWrapNonSerializable() { - ShortList list = ListShortList.wrap(new AbstractList() { - public Object get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(list); - assertTrue(!(list instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestLongCollectionCollection.java b/src/test/org/apache/commons/collections/primitives/adapters/TestLongCollectionCollection.java deleted file mode 100644 index 572faf3c4..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestLongCollectionCollection.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestLongCollectionCollection.java,v 1.5 2003/11/16 22:15:08 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayLongList; -import org.apache.commons.collections.primitives.LongList; -import org.apache.commons.collections.primitives.RandomAccessLongList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestLongCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestLongCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - LongList list = new ArrayLongList(); - for(int i=0;i<10;i++) { - list.add(i); - } - return new LongCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(LongCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = LongCollectionCollection.wrap(new ArrayLongList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = LongCollectionCollection.wrap(new RandomAccessLongList() { - public long get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestLongIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestLongIteratorIterator.java deleted file mode 100644 index 7a7f8c572..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestLongIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestLongIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayLongList; -import org.apache.commons.collections.primitives.LongList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestLongIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestLongIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return LongIteratorIterator.wrap(makeEmptyLongList().iterator()); - } - - public Iterator makeFullIterator() { - return LongIteratorIterator.wrap(makeFullLongList().iterator()); - } - - protected LongList makeEmptyLongList() { - return new ArrayLongList(); - } - - protected LongList makeFullLongList() { - LongList list = makeEmptyLongList(); - long[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayLongList; -import org.apache.commons.collections.primitives.LongList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestLongListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestLongListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return LongListIteratorListIterator.wrap(makeEmptyLongList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return LongListIteratorListIterator.wrap(makeFullLongList().listIterator()); - } - - protected LongList makeEmptyLongList() { - return new ArrayLongList(); - } - - protected LongList makeFullLongList() { - LongList list = makeEmptyLongList(); - long[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayLongList; -import org.apache.commons.collections.primitives.RandomAccessLongList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestLongListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestLongListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestLongListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new LongListList(new ArrayLongList()); - } - - protected Object[] getFullElements() { - Long[] elts = new Long[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.Collection; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.AbstractTestObject; -import org.apache.commons.collections.primitives.ArrayShortList; -import org.apache.commons.collections.primitives.RandomAccessShortList; -import org.apache.commons.collections.primitives.ShortList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestShortCollectionCollection extends AbstractTestObject { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortCollectionCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestShortCollectionCollection.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected Object makeObject() { - ShortList list = new ArrayShortList(); - for(int i=0;i<10;i++) { - list.add((short)i); - } - return new ShortCollectionCollection(list); - } - - public void testSerializeDeserializeThenCompare() { - // Collection.equal contract doesn't work that way - } - - /** @TODO need to add serialized form to cvs */ - public void testCanonicalEmptyCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - public void testCanonicalFullCollectionExists() { - // XXX FIX ME XXX - // need to add a serialized form to cvs - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(ShortCollectionCollection.wrap(null)); - } - - public void testWrapSerializable() { - Collection collection = ShortCollectionCollection.wrap(new ArrayShortList()); - assertNotNull(collection); - assertTrue(collection instanceof Serializable); - } - - public void testWrapNonSerializable() { - Collection collection = ShortCollectionCollection.wrap(new RandomAccessShortList() { - public short get(int i) { throw new IndexOutOfBoundsException(); } - public int size() { return 0; } - }); - assertNotNull(collection); - assertTrue(!(collection instanceof Serializable)); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/TestShortIteratorIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/TestShortIteratorIterator.java deleted file mode 100644 index f87f4de47..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/TestShortIteratorIterator.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestShortIteratorIterator.java,v 1.3 2003/10/01 21:54:55 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestIterator; -import org.apache.commons.collections.primitives.ArrayShortList; -import org.apache.commons.collections.primitives.ShortList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestShortIteratorIterator extends AbstractTestIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortIteratorIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestShortIteratorIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public Iterator makeEmptyIterator() { - return ShortIteratorIterator.wrap(makeEmptyShortList().iterator()); - } - - public Iterator makeFullIterator() { - return ShortIteratorIterator.wrap(makeFullShortList().iterator()); - } - - protected ShortList makeEmptyShortList() { - return new ArrayShortList(); - } - - protected ShortList makeFullShortList() { - ShortList list = makeEmptyShortList(); - short[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.util.Iterator; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.iterators.AbstractTestListIterator; -import org.apache.commons.collections.primitives.ArrayShortList; -import org.apache.commons.collections.primitives.ShortList; - -/** - * @version $Revision: 1.4 $ $Date: 2003/10/01 21:54:55 $ - * @author Rodney Waldhoff - */ -public class TestShortListIteratorListIterator extends AbstractTestListIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortListIteratorListIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestShortListIteratorListIterator.class); - } - - // collections testing framework - // ------------------------------------------------------------------------ - - public ListIterator makeEmptyListIterator() { - return ShortListIteratorListIterator.wrap(makeEmptyShortList().listIterator()); - } - - public ListIterator makeFullListIterator() { - return ShortListIteratorListIterator.wrap(makeFullShortList().listIterator()); - } - - protected ShortList makeEmptyShortList() { - return new ArrayShortList(); - } - - protected ShortList makeFullShortList() { - ShortList list = makeEmptyShortList(); - short[] elts = getFullElements(); - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters; - -import java.io.Serializable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.BulkTest; -import org.apache.commons.collections.list.AbstractTestList; -import org.apache.commons.collections.primitives.ArrayShortList; -import org.apache.commons.collections.primitives.RandomAccessShortList; - -/** - * @version $Revision: 1.5 $ $Date: 2003/11/16 22:15:08 $ - * @author Rodney Waldhoff - */ -public class TestShortListList extends AbstractTestList { - - // conventional - // ------------------------------------------------------------------------ - - public TestShortListList(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = BulkTest.makeSuite(TestShortListList.class); - return suite; - } - - // collections testing framework - // ------------------------------------------------------------------------ - - protected List makeEmptyList() { - return new ShortListList(new ArrayShortList()); - } - - protected Object[] getFullElements() { - Short[] elts = new Short[10]; - for(int i=0;i. - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.4 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestAll extends TestCase { - public TestAll(String testName) { - super(testName); - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTest(TestInputStreamByteIterator.suite()); - suite.addTest(TestByteIteratorInputStream.suite()); - - suite.addTest(TestReaderCharIterator.suite()); - suite.addTest(TestCharIteratorReader.suite()); - - return suite; - } -} - diff --git a/src/test/org/apache/commons/collections/primitives/adapters/io/TestByteIteratorInputStream.java b/src/test/org/apache/commons/collections/primitives/adapters/io/TestByteIteratorInputStream.java deleted file mode 100644 index 46aa1858a..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/io/TestByteIteratorInputStream.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/io/Attic/TestByteIteratorInputStream.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.InputStream; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ArrayByteList; -import org.apache.commons.collections.primitives.ByteList; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestByteIteratorInputStream extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestByteIteratorInputStream(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestByteIteratorInputStream.class); - } - - // ------------------------------------------------------------------------ - - - - // ------------------------------------------------------------------------ - - public void testReadNonEmpty() throws Exception { - ByteList list = new ArrayByteList(); - for(int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { - list.add((byte)i); - } - - InputStream in = new ByteIteratorInputStream(list.iterator()); - for(int i = Byte.MIN_VALUE; i <= Byte.MAX_VALUE; i++) { - assertEquals(0xFF&i,in.read()); - } - assertEquals(-1,in.read()); - assertEquals(-1,in.read()); - } - - public void testReadEmpty() throws Exception { - ByteList list = new ArrayByteList(); - InputStream in = new ByteIteratorInputStream(list.iterator()); - assertEquals(-1,in.read()); - assertEquals(-1,in.read()); - } - - public void testAdaptNull() { - assertNull(ByteIteratorInputStream.adapt(null)); - } - - public void testAdaptNonNull() { - assertNotNull(ByteIteratorInputStream.adapt(new ArrayByteList().iterator())); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/io/TestCharIteratorReader.java b/src/test/org/apache/commons/collections/primitives/adapters/io/TestCharIteratorReader.java deleted file mode 100644 index 4f3c8e481..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/io/TestCharIteratorReader.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/io/Attic/TestCharIteratorReader.java,v 1.3 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.Reader; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ArrayCharList; -import org.apache.commons.collections.primitives.CharList; - -/** - * @version $Revision: 1.3 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestCharIteratorReader extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestCharIteratorReader(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestCharIteratorReader.class); - } - - // ------------------------------------------------------------------------ - - - - // ------------------------------------------------------------------------ - - public void testReadNonEmpty() throws Exception { - String str = "The quick brown fox jumped over the lazy dogs."; - CharList list = new ArrayCharList(); - for(int i = 0; i < str.length(); i++) { - list.add(str.charAt(i)); - } - - Reader in = new CharIteratorReader(list.iterator()); - for(int i = 0; i < str.length(); i++) { - assertEquals(str.charAt(i),in.read()); - } - assertEquals(-1,in.read()); - assertEquals(-1,in.read()); - in.close(); - } - - public void testReadEmpty() throws Exception { - CharList list = new ArrayCharList(); - Reader in = new CharIteratorReader(list.iterator()); - assertEquals(-1,in.read()); - assertEquals(-1,in.read()); - in.close(); - } - - public void testAdaptNull() { - assertNull(CharIteratorReader.adapt(null)); - } - - public void testAdaptNonNull() { - assertNotNull(CharIteratorReader.adapt(new ArrayCharList().iterator())); - } - -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/io/TestInputStreamByteIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/io/TestInputStreamByteIterator.java deleted file mode 100644 index fe6df1d80..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/io/TestInputStreamByteIterator.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/io/Attic/TestInputStreamByteIterator.java,v 1.3 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.ByteIterator; -import org.apache.commons.collections.primitives.TestByteIterator; - -/** - * @version $Revision: 1.3 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestInputStreamByteIterator extends TestByteIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestInputStreamByteIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestInputStreamByteIterator.class); - } - - // ------------------------------------------------------------------------ - - public boolean supportsRemove() { - return false; - } - - protected ByteIterator makeEmptyByteIterator() { - return new InputStreamByteIterator(new ByteArrayInputStream(new byte[0])); - } - - protected ByteIterator makeFullByteIterator() { - return new InputStreamByteIterator(new ByteArrayInputStream(getFullElements())); - } - - protected byte[] getFullElements() { - byte[] bytes = new byte[256]; - for(int i=0; i < 256; i++) { - bytes[i] = (byte)(i-128); - } - return bytes; - } - - - // ------------------------------------------------------------------------ - - public void testErrorThrowingStream() { - InputStream errStream = new InputStream() { - public int read() throws IOException { - throw new IOException(); - } - }; - - ByteIterator iter = new InputStreamByteIterator(errStream); - try { - iter.hasNext(); - fail("Expected RuntimeException"); - } catch(RuntimeException e) { - // expected - } - try { - iter.next(); - fail("Expected RuntimeException"); - } catch(RuntimeException e) { - // expected - } - } - - public void testAdaptNull() { - assertNull(InputStreamByteIterator.adapt(null)); - } - - public void testAdaptNonNull() { - assertNotNull(InputStreamByteIterator.adapt(new ByteArrayInputStream(new byte[0]))); - } -} diff --git a/src/test/org/apache/commons/collections/primitives/adapters/io/TestReaderCharIterator.java b/src/test/org/apache/commons/collections/primitives/adapters/io/TestReaderCharIterator.java deleted file mode 100644 index 2a6f502e8..000000000 --- a/src/test/org/apache/commons/collections/primitives/adapters/io/TestReaderCharIterator.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/io/Attic/TestReaderCharIterator.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.adapters.io; - -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.CharIterator; -import org.apache.commons.collections.primitives.TestCharIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestReaderCharIterator extends TestCharIterator { - - // conventional - // ------------------------------------------------------------------------ - - public TestReaderCharIterator(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestReaderCharIterator.class); - } - - // ------------------------------------------------------------------------ - - public boolean supportsRemove() { - return false; - } - - protected CharIterator makeEmptyCharIterator() { - return new ReaderCharIterator(new StringReader("")); - } - - protected CharIterator makeFullCharIterator() { - return new ReaderCharIterator(new StringReader(new String(getFullElements()))); - } - - protected char[] getFullElements() { - return "The quick brown fox jumped over the lazy dogs.".toCharArray(); - } - - - // ------------------------------------------------------------------------ - - public void testErrorThrowingReader() { - Reader errReader = new Reader() { - public int read(char[] buf, int off, int len) throws IOException { - throw new IOException(); - } - - public void close() throws IOException { - } - }; - - CharIterator iter = new ReaderCharIterator(errReader); - try { - iter.hasNext(); - fail("Expected RuntimeException"); - } catch(RuntimeException e) { - // expected - } - try { - iter.next(); - fail("Expected RuntimeException"); - } catch(RuntimeException e) { - // expected - } - } - - public void testAdaptNull() { - assertNull(ReaderCharIterator.adapt(null)); - } - - public void testAdaptNonNull() { - assertNotNull(ReaderCharIterator.adapt(new StringReader(""))); - } -} diff --git a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntIteratorTest.java b/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntIteratorTest.java deleted file mode 100644 index ac82615a2..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntIteratorTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/BaseUnmodifiableIntIteratorTest.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.TestCase; - -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntList; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public abstract class BaseUnmodifiableIntIteratorTest extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public BaseUnmodifiableIntIteratorTest(String testName) { - super(testName); - } - - - // framework - // ------------------------------------------------------------------------ - protected abstract IntIterator makeUnmodifiableIntIterator(); - - protected IntIterator makeIntIterator() { - IntList list = new ArrayIntList(); - for(int i=0;i<10;i++) { - list.add(i); - } - return list.iterator(); - } - - // tests - // ------------------------------------------------------------------------ - - public final void testIntIteratorNotModifiable() { - IntIterator iter = makeUnmodifiableIntIterator(); - assertTrue(iter.hasNext()); - iter.next(); - try { - iter.remove(); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public final void testIterateIntIterator() { - IntIterator iter = makeUnmodifiableIntIterator(); - for(IntIterator expected = makeIntIterator(); expected.hasNext(); ) { - assertTrue(iter.hasNext()); - assertEquals(expected.next(),iter.next()); - } - assertTrue(! iter.hasNext() ); - } - -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListIteratorTest.java b/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListIteratorTest.java deleted file mode 100644 index e688ea125..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListIteratorTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/BaseUnmodifiableIntListIteratorTest.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public abstract class BaseUnmodifiableIntListIteratorTest extends BaseUnmodifiableIntIteratorTest { - - // conventional - // ------------------------------------------------------------------------ - - public BaseUnmodifiableIntListIteratorTest(String testName) { - super(testName); - } - - - // framework - // ------------------------------------------------------------------------ - - protected abstract IntListIterator makeUnmodifiableIntListIterator(); - - protected IntIterator makeUnmodifiableIntIterator() { - return makeUnmodifiableIntListIterator(); - } - - protected IntIterator makeIntIterator() { - return makeIntListIterator(); - } - - protected IntListIterator makeIntListIterator() { - IntList list = new ArrayIntList(); - for(int i=0;i<10;i++) { - list.add(i); - } - return list.listIterator(); - } - - // tests - // ------------------------------------------------------------------------ - - public final void testIntListIteratorNotModifiable() { - IntListIterator iter = makeUnmodifiableIntListIterator(); - assertTrue(iter.hasNext()); - iter.next(); - try { - iter.remove(); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - iter.add(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - try { - iter.set(3); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - public final void testIterateIntListIterator() { - IntListIterator iter = makeUnmodifiableIntListIterator(); - IntListIterator expected = makeIntListIterator(); - - assertTrue(! iter.hasPrevious()); - - while( expected.hasNext() ) { - assertTrue(iter.hasNext()); - assertEquals(expected.nextIndex(),iter.nextIndex()); - assertEquals(expected.previousIndex(),iter.previousIndex()); - assertEquals(expected.next(),iter.next()); - assertTrue(iter.hasPrevious()); - assertEquals(expected.nextIndex(),iter.nextIndex()); - assertEquals(expected.previousIndex(),iter.previousIndex()); - } - - assertTrue(! iter.hasNext() ); - - while( expected.hasPrevious() ) { - assertTrue(iter.hasPrevious()); - assertEquals(expected.nextIndex(),iter.nextIndex()); - assertEquals(expected.previousIndex(),iter.previousIndex()); - assertEquals(expected.previous(),iter.previous()); - assertTrue(iter.hasNext()); - assertEquals(expected.nextIndex(),iter.nextIndex()); - assertEquals(expected.previousIndex(),iter.previousIndex()); - } - assertTrue(! iter.hasPrevious() ); - } - -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListTest.java b/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListTest.java deleted file mode 100644 index 367c3b295..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/BaseUnmodifiableIntListTest.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/BaseUnmodifiableIntListTest.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.TestCase; - -import org.apache.commons.collections.primitives.ArrayIntList; -import org.apache.commons.collections.primitives.IntIterator; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public abstract class BaseUnmodifiableIntListTest extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public BaseUnmodifiableIntListTest(String testName) { - super(testName); - } - - // framework - // ------------------------------------------------------------------------ - - protected abstract IntList makeUnmodifiableIntList(); - - protected IntList makeIntList() { - IntList list = new ArrayIntList(); - for(int i=0;i<10;i++) { - list.add(i); - } - return list; - } - - // tests - // ------------------------------------------------------------------------ - - public final void testNotModifiable() throws Exception { - assertListNotModifiable(makeUnmodifiableIntList()); - } - - public final void testSublistNotModifiable() throws Exception { - IntList list = makeUnmodifiableIntList(); - assertListNotModifiable(list.subList(0,list.size()-2)); - } - - public final void testIteratorNotModifiable() throws Exception { - IntList list = makeUnmodifiableIntList(); - assertIteratorNotModifiable(list.iterator()); - assertIteratorNotModifiable(list.subList(0,list.size()-2).iterator()); - } - - public final void testListIteratorNotModifiable() throws Exception { - IntList list = makeUnmodifiableIntList(); - assertListIteratorNotModifiable(list.listIterator()); - assertListIteratorNotModifiable(list.subList(0,list.size()-2).listIterator()); - assertListIteratorNotModifiable(list.listIterator(1)); - assertListIteratorNotModifiable(list.subList(0,list.size()-2).listIterator(1)); - } - - // util - // ------------------------------------------------------------------------ - - private void assertListIteratorNotModifiable(IntListIterator iter) throws Exception { - assertIteratorNotModifiable(iter); - - assertTrue(iter.hasPrevious()); - - try { - iter.set(2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - iter.add(2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - private void assertIteratorNotModifiable(IntIterator iter) throws Exception { - assertTrue(iter.hasNext()); - iter.next(); - - try { - iter.remove(); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } - - private void assertListNotModifiable(IntList list) throws Exception { - try { - list.add(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.add(1,2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.addAll(makeIntList()); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.addAll(1,makeIntList()); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.removeElementAt(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.removeElement(1); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.removeAll(makeIntList()); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.retainAll(makeIntList()); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.clear(); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - - try { - list.set(1,2); - fail("Expected UnsupportedOperationException"); - } catch(UnsupportedOperationException e) { - // expected - } - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestAll.java b/src/test/org/apache/commons/collections/primitives/decorators/TestAll.java deleted file mode 100644 index 00bbd3abc..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestAll.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestAll.java,v 1.5 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @version $Revision: 1.5 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestAll extends TestCase { - public TestAll(String testName) { - super(testName); - } - - public static void main(String args[]) { - String[] testCaseName = { TestAll.class.getName() }; - junit.textui.TestRunner.main(testCaseName); - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - suite.addTest(TestBaseProxyIntCollection.suite()); - suite.addTest(TestBaseProxyIntList.suite()); - suite.addTest(TestUnmodifiableIntList.suite()); - suite.addTest(TestUnmodifiableIntIterator.suite()); - suite.addTest(TestUnmodifiableIntListIterator.suite()); - - return suite; - } -} - diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntCollection.java b/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntCollection.java deleted file mode 100644 index 6261968e1..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntCollection.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestBaseProxyIntCollection.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2002-2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestBaseProxyIntCollection extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestBaseProxyIntCollection(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestBaseProxyIntCollection.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testCollectionCallsAreProxied() { - final InvocationCounter proxied = new InvocationCounter(); - IntCollection collection = new BaseProxyIntCollection() { - protected IntCollection getProxiedCollection() { - return proxied; - } - }; - - assertEquals(0,proxied.getAddCount()); - collection.add(1); - assertEquals(1,proxied.getAddCount()); - - assertEquals(0,proxied.getAddAllCount()); - collection.addAll(null); - assertEquals(1,proxied.getAddAllCount()); - - assertEquals(0,proxied.getClearCount()); - collection.clear(); - assertEquals(1,proxied.getClearCount()); - - assertEquals(0,proxied.getContainsCount()); - collection.contains(1); - assertEquals(1,proxied.getContainsCount()); - - assertEquals(0,proxied.getContainsAllCount()); - collection.containsAll(null); - assertEquals(1,proxied.getContainsAllCount()); - - assertEquals(0,proxied.getIsEmptyCount()); - collection.isEmpty(); - assertEquals(1,proxied.getIsEmptyCount()); - - assertEquals(0,proxied.getIteratorCount()); - collection.iterator(); - assertEquals(1,proxied.getIteratorCount()); - - assertEquals(0,proxied.getRemoveAllCount()); - collection.removeAll(null); - assertEquals(1,proxied.getRemoveAllCount()); - - assertEquals(0,proxied.getRetainAllCount()); - collection.retainAll(null); - assertEquals(1,proxied.getRetainAllCount()); - - assertEquals(0,proxied.getRemoveElementCount()); - collection.removeElement(1); - assertEquals(1,proxied.getRemoveElementCount()); - - assertEquals(0,proxied.getSizeCount()); - collection.size(); - assertEquals(1,proxied.getSizeCount()); - - assertEquals(0,proxied.getToArrayIntArrayCount()); - collection.toArray(new int[0]); - assertEquals(1,proxied.getToArrayIntArrayCount()); - - assertEquals(0,proxied.getToArrayCount()); - collection.toArray(); - assertEquals(1,proxied.getToArrayCount()); - - assertEquals(0,proxied.getToStringCount()); - collection.toString(); - assertEquals(1,proxied.getToStringCount()); - - assertEquals(0,proxied.getEqualsCount()); - collection.equals(null); - assertEquals(1,proxied.getEqualsCount()); - - assertEquals(0,proxied.getHashCodeCount()); - collection.hashCode(); - assertEquals(1,proxied.getHashCodeCount()); - - } - - // inner classes - // ------------------------------------------------------------------------ - - static class InvocationCounter implements IntCollection { - private int _toArrayIntArray; - private int _toArray; - private int _size; - private int _retainAll; - private int _removeElement; - private int _removeAll; - private int _iterator; - private int _isEmpty; - private int _containsAll; - private int _contains; - private int _clear; - private int _addAll; - private int _add; - - private int _equals; - private int _toString; - private int _hashCode; - - public boolean add(int element) { - _add++; - return false; - } - - public boolean addAll(IntCollection c) { - _addAll++; - return false; - } - - public void clear() { - _clear++; - } - - public boolean contains(int element) { - _contains++; - return false; - } - - public boolean containsAll(IntCollection c) { - _containsAll++; - return false; - } - - public boolean isEmpty() { - _isEmpty++; - return false; - } - - public IntIterator iterator() { - _iterator++; - return null; - } - - public boolean removeAll(IntCollection c) { - _removeAll++; - return false; - } - - public boolean removeElement(int element) { - _removeElement++; - return false; - } - - public boolean retainAll(IntCollection c) { - _retainAll++; - return false; - } - - public int size() { - _size++; - return 0; - } - - public int[] toArray() { - _toArray++; - return null; - } - - public int[] toArray(int[] a) { - _toArrayIntArray++; - return null; - } - - public boolean equals(Object obj) { - _equals++; - return false; - } - - public int hashCode() { - _hashCode++; - return 0; - } - - public String toString() { - _toString++; - return null; - } - - - public int getAddCount() { - return _add; - } - - public int getAddAllCount() { - return _addAll; - } - - public int getClearCount() { - return _clear; - } - - public int getContainsCount() { - return _contains; - } - - public int getContainsAllCount() { - return _containsAll; - } - - public int getIsEmptyCount() { - return _isEmpty; - } - - public int getIteratorCount() { - return _iterator; - } - - public int getRemoveAllCount() { - return _removeAll; - } - - public int getRemoveElementCount() { - return _removeElement; - } - - public int getRetainAllCount() { - return _retainAll; - } - - public int getSizeCount() { - return _size; - } - - public int getToArrayCount() { - return _toArray; - } - - public int getToArrayIntArrayCount() { - return _toArrayIntArray; - } - - public int getEqualsCount() { - return _equals; - } - - public int getHashCodeCount() { - return _hashCode; - } - - public int getToStringCount() { - return _toString; - } - - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntList.java b/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntList.java deleted file mode 100644 index 5b89ac0e7..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestBaseProxyIntList.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestBaseProxyIntList.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntCollection; -import org.apache.commons.collections.primitives.IntList; -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestBaseProxyIntList extends TestCase { - - // conventional - // ------------------------------------------------------------------------ - - public TestBaseProxyIntList(String testName) { - super(testName); - } - - public static Test suite() { - return new TestSuite(TestBaseProxyIntList.class); - } - - // tests - // ------------------------------------------------------------------------ - - public void testListCallsAreProxied() { - final InvocationCounter proxied = new InvocationCounter(); - BaseProxyIntList list = new BaseProxyIntList() { - protected IntList getProxiedList() { - return proxied; - } - }; - - assertSame(list.getProxiedList(),list.getProxiedCollection()); - - assertEquals(0,proxied.getAddCount()); - list.add(1,1); - assertEquals(1,proxied.getAddCount()); - - assertEquals(0,proxied.getAddAllCount()); - list.addAll(1,null); - assertEquals(1,proxied.getAddAllCount()); - - assertEquals(0,proxied.getGetCount()); - list.get(1); - assertEquals(1,proxied.getGetCount()); - - assertEquals(0,proxied.getIndexOfCount()); - list.indexOf(1); - assertEquals(1,proxied.getIndexOfCount()); - - assertEquals(0,proxied.getLastIndexOfCount()); - list.lastIndexOf(1); - assertEquals(1,proxied.getLastIndexOfCount()); - - assertEquals(0,proxied.getListIteratorCount()); - list.listIterator(); - assertEquals(1,proxied.getListIteratorCount()); - - assertEquals(0,proxied.getListIteratorFromCount()); - list.listIterator(1); - assertEquals(1,proxied.getListIteratorFromCount()); - - assertEquals(0,proxied.getRemoveElementAtCount()); - list.removeElementAt(1); - assertEquals(1,proxied.getRemoveElementAtCount()); - - assertEquals(0,proxied.getSetCount()); - list.set(1,1); - assertEquals(1,proxied.getSetCount()); - - assertEquals(0,proxied.getSubListCount()); - list.subList(1,2); - assertEquals(1,proxied.getSubListCount()); - } - - // inner classes - // ------------------------------------------------------------------------ - - static class InvocationCounter extends TestBaseProxyIntCollection.InvocationCounter implements IntList { - private int addCount; - private int addAllCount; - private int getCount; - private int indexOfCount; - private int lastIndexOfCount; - private int listIteratorCount; - private int listIteratorFromCount; - private int removeElementAtCount; - private int setCount; - private int subListCount; - - public void add(int index, int element) { - addCount++; - } - - public boolean addAll(int index, IntCollection collection) { - addAllCount++; - return false; - } - - public int get(int index) { - getCount++; - return 0; - } - - public int indexOf(int element) { - indexOfCount++; - return 0; - } - - public int lastIndexOf(int element) { - lastIndexOfCount++; - return 0; - } - - public IntListIterator listIterator() { - listIteratorCount++; - return null; - } - - public IntListIterator listIterator(int index) { - listIteratorFromCount++; - return null; - } - - public int removeElementAt(int index) { - removeElementAtCount++; - return 0; - } - - public int set(int index, int element) { - setCount++; - return 0; - } - - public IntList subList(int fromIndex, int toIndex) { - subListCount++; - return null; - } - - public int getAddAllCount() { - return addAllCount; - } - - public int getAddCount() { - return addCount; - } - - public int getGetCount() { - return getCount; - } - - public int getIndexOfCount() { - return indexOfCount; - } - - public int getLastIndexOfCount() { - return lastIndexOfCount; - } - - public int getListIteratorCount() { - return listIteratorCount; - } - - public int getListIteratorFromCount() { - return listIteratorFromCount; - } - - public int getRemoveElementAtCount() { - return removeElementAtCount; - } - - public int getSetCount() { - return setCount; - } - - public int getSubListCount() { - return subListCount; - } - - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntIterator.java b/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntIterator.java deleted file mode 100644 index 336a0cd5e..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntIterator.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestUnmodifiableIntIterator.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestUnmodifiableIntIterator extends BaseUnmodifiableIntIteratorTest { - - // conventional - // ------------------------------------------------------------------------ - - public TestUnmodifiableIntIterator(String testName) { - super(testName); - } - - - public static Test suite() { - return new TestSuite(TestUnmodifiableIntIterator.class); - } - - // framework - // ------------------------------------------------------------------------ - - protected IntIterator makeUnmodifiableIntIterator() { - return UnmodifiableIntIterator.wrap(makeIntIterator()); - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNotNull() { - assertNotNull(UnmodifiableIntIterator.wrap(makeIntIterator())); - } - - public void testWrapNull() { - assertNull(UnmodifiableIntIterator.wrap(null)); - } - - public void testWrapUnmodifiableIntIterator() { - IntIterator iter = makeUnmodifiableIntIterator(); - assertSame(iter,UnmodifiableIntIterator.wrap(iter)); - } - -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntList.java b/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntList.java deleted file mode 100644 index 8dfaf1938..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntList.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestUnmodifiableIntList.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import java.io.Serializable; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntList; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestUnmodifiableIntList extends BaseUnmodifiableIntListTest { - - // conventional - // ------------------------------------------------------------------------ - - public TestUnmodifiableIntList(String testName) { - super(testName); - } - - - public static Test suite() { - return new TestSuite(TestUnmodifiableIntList.class); - } - - // framework - // ------------------------------------------------------------------------ - - protected IntList makeUnmodifiableIntList() { - return UnmodifiableIntList.wrap(makeIntList()); - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNull() { - assertNull(UnmodifiableIntList.wrap(null)); - } - - public void testWrapUnmodifiableIntList() { - IntList list = makeUnmodifiableIntList(); - assertSame(list,UnmodifiableIntList.wrap(list)); - } - - public void testWrapSerializableIntList() { - IntList list = makeIntList(); - assertTrue(list instanceof Serializable); - assertTrue(UnmodifiableIntList.wrap(list) instanceof Serializable); - } - - public void testWrapNonSerializableIntList() { - IntList list = makeIntList(); - IntList ns = list.subList(0,list.size()); - assertTrue(!(ns instanceof Serializable)); - assertTrue(!(UnmodifiableIntList.wrap(ns) instanceof Serializable)); - } -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntListIterator.java b/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntListIterator.java deleted file mode 100644 index 2bd7939ba..000000000 --- a/src/test/org/apache/commons/collections/primitives/decorators/TestUnmodifiableIntListIterator.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/decorators/Attic/TestUnmodifiableIntListIterator.java,v 1.2 2003/08/31 17:28:45 scolebourne Exp $ - * ==================================================================== - * The Apache Software License, Version 1.1 - * - * Copyright (c) 2003 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. The end-user documentation included with the redistribution, if - * any, must include the following acknowledgement: - * "This product includes software developed by the - * Apache Software Foundation (http://www.apache.org/)." - * Alternately, this acknowledgement may appear in the software itself, - * if and wherever such third-party acknowledgements normally appear. - * - * 4. The names "The Jakarta Project", "Commons", and "Apache Software - * Foundation" must not be used to endorse or promote products derived - * from this software without prior written permission. For written - * permission, please contact apache@apache.org. - * - * 5. Products derived from this software may not be called "Apache" - * nor may "Apache" appear in their names without prior written - * permission of the Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * . - * - */ - -package org.apache.commons.collections.primitives.decorators; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.commons.collections.primitives.IntListIterator; - -/** - * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:45 $ - * @author Rodney Waldhoff - */ -public class TestUnmodifiableIntListIterator extends BaseUnmodifiableIntListIteratorTest { - - // conventional - // ------------------------------------------------------------------------ - - public TestUnmodifiableIntListIterator(String testName) { - super(testName); - } - - - public static Test suite() { - return new TestSuite(TestUnmodifiableIntListIterator.class); - } - - // framework - // ------------------------------------------------------------------------ - - protected IntListIterator makeUnmodifiableIntListIterator() { - return UnmodifiableIntListIterator.wrap(makeIntListIterator()); - } - - // tests - // ------------------------------------------------------------------------ - - public void testWrapNotNull() { - assertNotNull(UnmodifiableIntListIterator.wrap(makeIntListIterator())); - } - - public void testWrapNull() { - assertNull(UnmodifiableIntListIterator.wrap(null)); - } - - public void testWrapUnmodifiableIntListIterator() { - IntListIterator iter = makeUnmodifiableIntListIterator(); - assertSame(iter,UnmodifiableIntListIterator.wrap(iter)); - } - -} \ No newline at end of file diff --git a/src/test/org/apache/commons/collections/set/AbstractTestSet.java b/src/test/org/apache/commons/collections/set/AbstractTestSet.java index 5372b0cbe..fe44ef930 100644 --- a/src/test/org/apache/commons/collections/set/AbstractTestSet.java +++ b/src/test/org/apache/commons/collections/set/AbstractTestSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/AbstractTestSet.java,v 1.1 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/AbstractTestSet.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -80,7 +80,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection; * elements may be added; see {@link AbstractTestCollection} for more details. * * @since Commons Collections 3.0 - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ * * @author Paul Jack */ @@ -99,7 +99,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { /** * Provides additional verifications for sets. */ - protected void verify() { + public void verify() { super.verify(); assertEquals("Sets should be equal", confirmed, collection); @@ -119,7 +119,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return a confirmed empty collection */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new HashSet(); } @@ -128,7 +128,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return a confirmed full collection */ - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Collection set = makeConfirmedCollection(); set.addAll(Arrays.asList(getFullElements())); return set; @@ -139,7 +139,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return an empty set */ - protected abstract Set makeEmptySet(); + public abstract Set makeEmptySet(); /** * Makes a full set by first creating an empty set and then adding @@ -149,7 +149,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return a full set */ - protected Set makeFullSet() { + public Set makeFullSet() { Set set = makeEmptySet(); set.addAll(Arrays.asList(getFullElements())); return set; @@ -160,7 +160,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return an empty collection */ - protected final Collection makeCollection() { + public final Collection makeCollection() { return makeEmptySet(); } @@ -169,7 +169,7 @@ public abstract class AbstractTestSet extends AbstractTestCollection { * * @return a full collection */ - protected final Collection makeFullCollection() { + public final Collection makeFullCollection() { return makeFullSet(); } @@ -177,14 +177,14 @@ public abstract class AbstractTestSet extends AbstractTestCollection { /** * Return the {@link AbstractTestCollection#collection} fixture, but cast as a Set. */ - protected Set getSet() { + public Set getSet() { return (Set)collection; } /** * Return the {@link AbstractTestCollection#confirmed} fixture, but cast as a Set. */ - protected Set getConfirmedSet() { + public Set getConfirmedSet() { return (Set)confirmed; } diff --git a/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java b/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java index 05bc6902b..2daadae86 100644 --- a/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java +++ b/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java,v 1.1 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/AbstractTestSortedSet.java,v 1.2 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -74,7 +74,7 @@ import org.apache.commons.collections.BulkTest; * elements may be added; see {@link AbstractTestCollection} for more details. * * @since Commons Collections 3.0 - * @version $Revision: 1.1 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne * @author Dieter Wimberger @@ -95,7 +95,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { * Verification extension, will check the order of elements, * the sets should already be verified equal. */ - protected void verify() { + public void verify() { super.verify(); // Check that iterator returns elements in order and first() and last() @@ -126,7 +126,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { * Overridden because SortedSets don't allow null elements (normally). * @return false */ - protected boolean isNullSupported() { + public boolean isNullSupported() { return false; } @@ -136,7 +136,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { * * @return a confirmed empty collection */ - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new TreeSet(); } @@ -145,7 +145,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { * Return the {@link AbstractTestCollection#confirmed} fixture, but cast as a * SortedSet. */ - protected SortedSet getConfirmedSortedSet() { + public SortedSet getConfirmedSortedSet() { return (SortedSet) confirmed; } @@ -153,7 +153,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { /** * Override to return comparable objects. */ - protected Object[] getFullNonNullElements() { + public Object[] getFullNonNullElements() { Object[] elements = new Object[30]; for (int i = 0; i < 30; i++) { @@ -165,7 +165,7 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { /** * Override to return comparable objects. */ - protected Object[] getOtherNonNullElements() { + public Object[] getOtherNonNullElements() { Object[] elements = new Object[30]; for (int i = 0; i < 30; i++) { elements[i] = new Integer(i + i + 2); @@ -283,16 +283,16 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { } //TestSortedSetSubSet - protected boolean isNullSupported() { + public boolean isNullSupported() { return AbstractTestSortedSet.this.isNullSupported(); } //useNullValue - protected Object[] getFullElements() { + public Object[] getFullElements() { //System.out.println("getFullElements()"); return m_FullElements; } - protected Object[] getOtherElements() { + public Object[] getOtherElements() { return m_OtherElements; } @@ -310,25 +310,25 @@ public abstract class AbstractTestSortedSet extends AbstractTestSet { } } //getSubSet - protected Set makeEmptySet() { + public Set makeEmptySet() { SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullSet(); s = getSubSet(s); s.clear(); return s; } //makeEmptySet - protected Set makeFullSet() { + public Set makeFullSet() { SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullCollection(); return getSubSet(s); } //makeFullSet - protected void resetFull() { + public void resetFull() { AbstractTestSortedSet.this.resetFull(); TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) AbstractTestSortedSet.this.confirmed); TestSortedSetSubSet.this.collection = getSubSet((SortedSet) AbstractTestSortedSet.this.collection); } - protected void resetEmpty() { + public void resetEmpty() { TestSortedSetSubSet.this.resetFull(); TestSortedSetSubSet.this.confirmed.clear(); TestSortedSetSubSet.this.collection.clear(); diff --git a/src/test/org/apache/commons/collections/set/TestListOrderedSet.java b/src/test/org/apache/commons/collections/set/TestListOrderedSet.java index ca8c19a22..fdf2b3de7 100644 --- a/src/test/org/apache/commons/collections/set/TestListOrderedSet.java +++ b/src/test/org/apache/commons/collections/set/TestListOrderedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestListOrderedSet.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestListOrderedSet.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import junit.framework.TestSuite; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Henning P. Schmiedehausen * @author Stephen Colebourne @@ -91,7 +91,7 @@ public class TestListOrderedSet extends AbstractTestSet { junit.textui.TestRunner.main(testCaseName); } - protected Set makeEmptySet() { + public Set makeEmptySet() { return ListOrderedSet.decorate(new HashSet()); } diff --git a/src/test/org/apache/commons/collections/set/TestPredicatedSet.java b/src/test/org/apache/commons/collections/set/TestPredicatedSet.java index cae4bc3ac..0dec18dfa 100644 --- a/src/test/org/apache/commons/collections/set/TestPredicatedSet.java +++ b/src/test/org/apache/commons/collections/set/TestPredicatedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestPredicatedSet.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestPredicatedSet.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import org.apache.commons.collections.PredicateUtils; * {@link PredicatedSet} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -98,11 +98,11 @@ public class TestPredicatedSet extends AbstractTestSet{ return PredicatedSet.decorate(set, predicate); } - protected Set makeEmptySet() { + public Set makeEmptySet() { return decorateSet(new HashSet(), truePredicate); } - protected Object[] getFullElements() { + public Object[] getFullElements() { return new Object[] {"1", "3", "5", "7", "2", "4", "6"}; } diff --git a/src/test/org/apache/commons/collections/set/TestTransformedSet.java b/src/test/org/apache/commons/collections/set/TestTransformedSet.java index 95c6b781f..8e9699770 100644 --- a/src/test/org/apache/commons/collections/set/TestTransformedSet.java +++ b/src/test/org/apache/commons/collections/set/TestTransformedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestTransformedSet.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestTransformedSet.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -72,7 +72,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -91,21 +91,21 @@ public class TestTransformedSet extends AbstractTestSet { junit.textui.TestRunner.main(testCaseName); } - protected Collection makeConfirmedCollection() { + public Collection makeConfirmedCollection() { return new HashSet(); } - protected Collection makeConfirmedFullCollection() { + public Collection makeConfirmedFullCollection() { Set set = new HashSet(); set.addAll(Arrays.asList(getFullElements())); return set; } - protected Set makeEmptySet() { + public Set makeEmptySet() { return TransformedSet.decorate(new HashSet(), TestTransformedCollection.NOOP_TRANSFORMER); } - protected Set makeFullSet() { + public Set makeFullSet() { Set list = new HashSet(); list.addAll(Arrays.asList(getFullElements())); return TransformedSet.decorate(list, TestTransformedCollection.NOOP_TRANSFORMER); diff --git a/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java b/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java index 83ce1323f..d1052ef9f 100644 --- a/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java +++ b/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestTransformedSortedSet.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -73,7 +73,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection; * implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Stephen Colebourne */ @@ -93,11 +93,11 @@ public class TestTransformedSortedSet extends AbstractTestSortedSet { } //----------------------------------------------------------------------- - protected Set makeEmptySet() { + public Set makeEmptySet() { return TransformedSortedSet.decorate(new TreeSet(), TestTransformedCollection.NOOP_TRANSFORMER); } - protected Set makeFullSet() { + public Set makeFullSet() { SortedSet set = new TreeSet(); set.addAll(Arrays.asList(getFullElements())); return TransformedSortedSet.decorate(set, TestTransformedCollection.NOOP_TRANSFORMER); diff --git a/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java b/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java index 998e0ff8f..4b2435d09 100644 --- a/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java +++ b/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java @@ -1,5 +1,5 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java,v 1.2 2003/11/16 22:15:10 scolebourne Exp $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/set/TestUnmodifiableSortedSet.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * ==================================================================== * * The Apache Software License, Version 1.1 @@ -71,7 +71,7 @@ import junit.framework.TestSuite; * {@link UnmodifiableSortedSet} implementation. * * @since Commons Collections 3.0 - * @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:10 $ + * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ * * @author Phil Steitz */ @@ -102,11 +102,11 @@ public class TestUnmodifiableSortedSet extends AbstractTestSortedSet{ return UnmodifiableSortedSet.decorate(set); } - protected boolean isAddSupported() { + public boolean isAddSupported() { return false; } - protected boolean isRemoveSupported() { + public boolean isRemoveSupported() { return false; }