Commit Graph

150 Commits

Author SHA1 Message Date
Morgan James Delagrange 5e5a18bf2f fixed errors where makeMap() had been changed to makeEmptyMap()
in superclasses but not subclasses, causing the wrong objects to be
tested


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130587 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 00:31:32 +00:00
Morgan James Delagrange fa381f7937 made test classes that verify JDK contracts abstract, so that we will
not have to verify their serialization


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130586 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 00:21:46 +00:00
Morgan James Delagrange e01b230f25 took out test cases that ran against JDK classes directly
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130585 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 00:17:24 +00:00
Morgan James Delagrange 3c53553bb2 fixed funky line feeds and indicated that MultiHashMap is new to
Collections 2.x


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130584 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 00:13:37 +00:00
Morgan James Delagrange d5ab2edce1 changed compatibility version to a method, and had it default to the
maximum level of compatibility: version 1


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130583 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 00:08:07 +00:00
Rodney Waldhoff e238eff5de adding ProxyListIterator, FilterListIterator, and tests
removing unneeded import from ProxyIterartor, javadoc tweaks


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130582 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:53:20 +00:00
Morgan James Delagrange 2f293634b9 changed the makeList() method to makeEmptyList()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130581 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:51:24 +00:00
Morgan James Delagrange 9e1b45941d added base class for testing iterators
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130580 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:37:48 +00:00
Morgan James Delagrange f592daad05 added methods to allow for iterators that can't be full, or that can't be empty
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130579 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:37:38 +00:00
Morgan James Delagrange d3a61e7648 added base class for testing iterators
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130578 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:26:43 +00:00
Morgan James Delagrange eb9884cd91 more details for hasNext() testing
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130577 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:26:25 +00:00
Morgan James Delagrange 230fb16d83 was missing TestFilterIterator
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130576 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 23:15:29 +00:00
Morgan James Delagrange f9c4fd7f26 added base class for testing iterators, fixed odd line feeds in TestArrayIterator2
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130575 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 22:48:52 +00:00
Morgan James Delagrange d3bc97b77e added base class for testing iterators
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130574 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 22:43:04 +00:00
Morgan James Delagrange c7ec7fa5ef changed 'String COLLECTIONS_VERSION' to 'int COLLECTIONS_MAJOR_VERSION',
separated COLLECTIONS_MAJOR_VERSION from COMPATIBILITY_VERSION


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130573 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 20:57:08 +00:00
Morgan James Delagrange 52133cc2ef description of COLLECTIONS_VERSION constant
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130572 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 18:14:57 +00:00
Henri Yandell b7713ef824 StringStack comes from Commons.Utils.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130571 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:52:02 +00:00
Henri Yandell 2bd797f65d Merged the Commons.Utils MapUtils in. It consisted of:
safeAddToMap method.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130570 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:50:23 +00:00
Morgan James Delagrange e4605e7a79 removed testExternalizable(), redundant with test in TestMap class
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130569 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 22:26:01 +00:00
Morgan James Delagrange 32bb853f40 fixed test comments
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130568 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 22:21:50 +00:00
Morgan James Delagrange dd7f71e66d canonical forms for serialized maps in Collections 2.0
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130567 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 22:01:48 +00:00
Morgan James Delagrange eaf794f2cb constant to indicate which major release we are working on
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130566 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 22:01:32 +00:00
Morgan James Delagrange 3da4cf1ead makeMap() was removed from TestMap, replaced with makeEmptyMap()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130565 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 22:00:44 +00:00
Morgan James Delagrange afa55cbd80 externalization has changed for collections 2.0
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130564 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 21:59:31 +00:00
Morgan James Delagrange 4f2ff1d666 fixed error in serialization test
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130563 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 07:13:02 +00:00
Michael Smith 94c4dca82f Fix test failure for BeanMap.clear()
Documented deviation in behavior from Map.clear()


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130562 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 07:00:30 +00:00
Morgan James Delagrange 884b3a50e0 more specific in-memory serialization tests for SequencedHashMap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130561 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 06:25:10 +00:00
Morgan James Delagrange 93951f7a9d in-memory serialization tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130560 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 06:16:35 +00:00
Morgan James Delagrange 13d014655a Michael's alternative to the removeLRU() method
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130559 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 05:39:21 +00:00
Michael Smith 4d9246c82a Updated my email address.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130558 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:58:17 +00:00
Michael Smith 91e030ff08 Fixed the following Bag related problems:
- In Bag.java, the statement "If the bag contains less than i occurences,
the item item will be removed from the unique set" implies that if the bag
contains 5 occurences and i is 5, (5 is not less than 5) then the item will
not be removed from the unique set, even though there should be no more
occurances in the bag.

 - In AbstractBag.java, the documentation does not specify exactly what a
subcless needs to do to extend AbstractBag to make a concrete subclass.

 - AbstractBag.add(Object,int) has two calls to getCount(o), when only one
is necessary.  This wastes a few cycles to perform method invocations, a
map lookup, a cast, and a few comparisons.

 - The AbstractBag.equals(Object) method will incorrectly throw a
NullPointerException if a null value is passed.  The Object.equals(Object)
API specifies "For any non-null reference value x, x.equals(null) should
return false".

 - The AbstractBag.equals(Object) method will only work if the object
passed in extends AbstractMap or implements Map.  Neither of these facts
is documented, and neither is correct.  The contract for
Object.equals(Object) states: "for any reference values x and y,
x.equals(y) should return true if and only if y.equals(x) returns true. ".
Returning true when the argument is a Map is incorrect since he reverse
(the map checking to see if its equal to the bag) will most certainly be
false.  The same can be said for AbstractMap.  A subclass of AbstractMap
may add extra data to be stored within the Bag that must also be compared
for them to be equal.  The reverse comparison (specialized subclass equals
basic abstract bap) will fail.  You can read more about this in a three-
year old, but still valid java world article:
http://www.javaworld.com/javaworld/jw-01-1999/jw-01-object.html

 - if AbstractBag.remove(Object,int) is called passing in 0 as the number
to remove and specifying an object that exists in the bag, true will be
returned from the method. Per the Bag API specification, true should only
return when an object is actually removed.  Since no objects are removed,
false should be returned instead. Additionally, if a negative number is
specified, not only is the object not removed, but object(s) are *added*
(well, in the sense that it is equivalent of calling add(o, -i))

 - the uniqueSet() method returns the set of unique objects, however the
set is modifiable.  If the underlying map implementation has the set
backed by the map (as per the map contract -- so it should), then elements
can be removed from the unique set and have them removed from the
underlying map as well.  This causes consistency problems with the Bag
since _total will then be incorrect.

 - in extractList(), getCount(current) is called each time through the
inner loop, adding lots of extra overhead.  Reversing the loop (starting
at the count and going down to 0) eliminates the excess overhead.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130557 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:39:53 +00:00
Michael Smith 5bf5481408 Added documentation, and updating formatting of some documentation
(i.e. put "code" within <code>...</code>)

Added check for a valid capacity argument passed to constructor.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130556 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 04:16:19 +00:00
Michael Smith 6bb40f4086 Implement Externalizable in SequencedHashMap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130555 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 03:17:40 +00:00
Michael Smith 2af7a322ef Odd how that compiled for me before my commit, but it doesn't
afterwards (for obvious reasons)


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130554 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 02:37:56 +00:00
Michael Smith ef5aa20db3 There is no backwards compatibility issue since this class is new
since collections 1.0.  Therefore, since the entire Map interface
is implemented, there's no reason to inherit from HashMap.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130553 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 02:34:59 +00:00
Michael Smith 95ccabfc7c Added a bunch of generic tests to the TestMap.java class. Also added
cooresponding changes to other tests.  These tests expose a few deviations from
the Map contract in BeanMap.  These should either be fixed, or BeanMap should be
documented to describe how it differs from the Map contract.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130552 13f79535-47bb-0310-9956-ffa450edef68
2002-02-22 02:18:50 +00:00
Morgan James Delagrange a87ee3a6f5 release notes portion of the release 2.0 status
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130551 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 22:20:55 +00:00
Morgan James Delagrange fa16599553 more detail for testEntrySetContains()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130550 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 20:14:37 +00:00
Morgan James Delagrange 8dc203d033 unit test to reproduce a SequencedHashMap 1.3 bug
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130549 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 20:08:15 +00:00
Morgan James Delagrange 8dddc7ac42 unit test to reproduce a SequencedHashMap 1.3 bug
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130548 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 19:57:33 +00:00
Henri Yandell 449753321f Added myself as a committer as I've been committing changes and plan to
continue committing changes unless there's disagreement.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130547 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 17:38:28 +00:00
Michael Smith 90646843f9 Fix a NullPointerException when an object passed to an entrySet method is not mapping found in the map. Exhibited with entrySet().remove(Object) and entrySet().contains(Object)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130546 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 13:46:25 +00:00
Michael Smith 31bc597e42 Added myself as a committer. This also acts as a test to make sure I have things setup properly.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130545 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 02:01:21 +00:00
Morgan James Delagrange c6be081c1d extended TestDoubleOrderedMap from TestMap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130544 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 23:48:13 +00:00
Morgan James Delagrange 9708644399 added stub for BeanMap unit tests...definitely needs more tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130543 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 23:33:23 +00:00
Morgan James Delagrange 787edf0f34 moved some generic map tests up to TestMap, and implemented a marker
interface to indicate when a TestMap class can test
put(Object,Object) operations


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130542 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 22:38:46 +00:00
Morgan James Delagrange e4a9a024e7 changed superclass from TestHashMap to TestMap, in anticipation
of making SequencedHashMap a subclass of AbstractMap


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130541 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 22:17:18 +00:00
Morgan James Delagrange ce5559b6d4 added methods for testing serialization and a simple sanity check for
all serializable collections


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130540 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 21:50:16 +00:00
Morgan James Delagrange cc0da9db95 inherit all tests from SequencedHashMap
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130539 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 20:51:38 +00:00
Morgan James Delagrange 7b2312f796 made testing of SequencedHashMap subclasses easier
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130538 13f79535-47bb-0310-9956-ffa450edef68
2002-02-20 20:50:23 +00:00