commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections AbstractTestMap.java
Date Sun, 02 Nov 2003 15:27:06 GMT
scolebourne    2003/11/02 07:27:06

  Modified:    collections/src/test/org/apache/commons/collections
                        AbstractTestMap.java
  Log:
  Clearer test error messages
  
  Revision  Changes    Path
  1.11      +26 -14    jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestMap.java
  
  Index: AbstractTestMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestMap.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractTestMap.java	1 Nov 2003 18:47:18 -0000	1.10
  +++ AbstractTestMap.java	2 Nov 2003 15:27:05 -0000	1.11
  @@ -1478,30 +1478,40 @@
       protected void verifyEntrySet() {
           int size = confirmed.size();
           boolean empty = confirmed.isEmpty();
  -        assertEquals("entrySet should be same size as HashMap's",
  +        assertEquals("entrySet should be same size as HashMap's" +
  +                     "\nTest: " + entrySet + "\nReal: " + confirmed.entrySet(),
                        size, entrySet.size());
  -        assertEquals("entrySet should be empty if HashMap is", 
  +        assertEquals("entrySet should be empty if HashMap is" +
  +                     "\nTest: " + entrySet + "\nReal: " + confirmed.entrySet(),
                        empty, entrySet.isEmpty());
  -        assertTrue("entrySet should contain all HashMap's elements",
  +        assertTrue("entrySet should contain all HashMap's elements" +
  +                   "\nTest: " + entrySet + "\nReal: " + confirmed.entrySet(),
                      entrySet.containsAll(confirmed.entrySet()));
  -        assertEquals("entrySet hashCodes should be the same", 
  +        assertEquals("entrySet hashCodes should be the same" +
  +                     "\nTest: " + entrySet + "\nReal: " + confirmed.entrySet(),
                        confirmed.entrySet().hashCode(), entrySet.hashCode());
  -        assertEquals("Map's entry set should still equal HashMap's", 
  +        assertEquals("Map's entry set should still equal HashMap's" +
  +                     "\nTest: " + entrySet + "\nReal: " + confirmed.entrySet(),
                        confirmed.entrySet(), entrySet);
       }
   
       protected void verifyKeySet() { 
           int size = confirmed.size();
           boolean empty = confirmed.isEmpty();
  -        assertEquals("keySet should be same size as HashMap's",
  +        assertEquals("keySet should be same size as HashMap's" +
  +                     "\nTest: " + keySet + "\nReal: " + confirmed.keySet(),
                        size, keySet.size());
  -        assertEquals("keySet should be empty if HashMap is", 
  +        assertEquals("keySet should be empty if HashMap is" +
  +                     "\nTest: " + keySet + "\nReal: " + confirmed.keySet(),
                        empty, keySet.isEmpty());
  -        assertTrue("keySet should contain all HashMap's elements",
  +        assertTrue("keySet should contain all HashMap's elements" +
  +                   "\nTest: " + keySet + "\nReal: " + confirmed.keySet(),
                      keySet.containsAll(confirmed.keySet()));
  -        assertEquals("keySet hashCodes should be the same", 
  +        assertEquals("keySet hashCodes should be the same" +
  +                     "\nTest: " + keySet + "\nReal: " + confirmed.keySet(),
                        confirmed.keySet().hashCode(), keySet.hashCode());
  -        assertEquals("Map's key set should still equal HashMap's",
  +        assertEquals("Map's key set should still equal HashMap's" +
  +                     "\nTest: " + keySet + "\nReal: " + confirmed.keySet(),
                        confirmed.keySet(), keySet);
       }
   
  @@ -1511,9 +1521,11 @@
   
           int size = confirmed.size();
           boolean empty = confirmed.isEmpty();
  -        assertEquals("values should be same size as HashMap's",
  +        assertEquals("values should be same size as HashMap's" +
  +                     "\nTest: " + test + "\nReal: " + known,
                        size, values.size());
  -        assertEquals("values should be empty if HashMap is", 
  +        assertEquals("values should be empty if HashMap is" +
  +                     "\nTest: " + test + "\nReal: " + known,
                        empty, values.isEmpty());
           assertTrue("values should contain all HashMap's elements" +
                      "\nTest: " + test + "\nReal: " + known,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message