You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/10/07 01:44:56 UTC
cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections AbstractTestSortedMap.java
scolebourne 2003/10/06 16:44:56
Modified: collections/src/test/org/apache/commons/collections
AbstractTestSortedMap.java
Log:
Add first semblance of some SortedMap tests
Revision Changes Path
1.2 +26 -3 jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSortedMap.java
Index: AbstractTestSortedMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSortedMap.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTestSortedMap.java 2 Oct 2003 23:01:09 -0000 1.1
+++ AbstractTestSortedMap.java 6 Oct 2003 23:44:56 -0000 1.2
@@ -57,6 +57,9 @@
*/
package org.apache.commons.collections;
+import java.util.Iterator;
+import java.util.SortedMap;
+
/**
* Abstract test class for {@link java.util.SortedMap} methods and contracts.
*
@@ -85,6 +88,26 @@
return false;
}
-
// TODO: Add the SortedMap tests!
+
+ //-----------------------------------------------------------------------
+ public void testComparator() {
+ SortedMap sm = (SortedMap) makeFullMap();
+ // no tests I can think of
+ }
+
+ public void testFirstKey() {
+ SortedMap sm = (SortedMap) makeFullMap();
+ assertSame(sm.keySet().iterator().next(), sm.firstKey());
+ }
+
+ public void testLastKey() {
+ SortedMap sm = (SortedMap) makeFullMap();
+ Object obj = null;
+ for (Iterator it = sm.keySet().iterator(); it.hasNext();) {
+ obj = (Object) it.next();
+ }
+ assertSame(obj, sm.lastKey());
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org