You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2006/05/15 08:43:25 UTC

svn commit: r406553 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java

Author: smishura
Date: Sun May 14 23:43:21 2006
New Revision: 406553

URL: http://svn.apache.org/viewcvs?rev=406553&view=rev
Log:
Changing assertTrue to assertEquals

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java?rev=406553&r1=406552&r2=406553&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java Sun May 14 23:43:21 2006
@@ -36,8 +36,7 @@
     public void test_addAllLjava_util_Collection() {
         Collection col = new HashSet();
         col.addAll(org);
-        assertTrue("Collection is wrong size after addAll--wanted: 100 got: "
-                + col.size(), col.size() == 100);
+        assertEquals("Size", 100, col.size());
     }
 
     /**
@@ -71,13 +70,13 @@
     public void test_removeAllLjava_util_Collection() {
         Collection someCol = new HashSet(org);
         Collection anotherCol = new HashSet(org);
+
         anotherCol.remove(new Integer(5));
         someCol.removeAll(anotherCol);
-        assertTrue("Collection is the wrong size--wanted 1, got: "
-                + someCol.size(), someCol.size() == 1);
+        assertEquals("Size--wanted 1", 1, someCol.size());
+
         someCol.remove(new Integer(5));
-        assertTrue("Collection is the wrong size--wanted 0, got: "
-                + someCol.size(), someCol.size() == 0);
+        assertEquals("Size--wanted 0", 0, someCol.size());
     }
 
     /**
@@ -86,13 +85,13 @@
     public void test_retainAllLjava_util_Collection() {
         Collection someCol = new HashSet(org);
         Collection anotherCol = new HashSet(org);
+
         anotherCol.remove(new Integer(5));
         someCol.retainAll(anotherCol);
-        assertTrue("Collection is the wrong size--wanted 99, got: "
-                + someCol.size(), someCol.size() == 99);
+        assertEquals("Size--wanted 99", 99, someCol.size());
+
         someCol.add(new Integer(5));
-        assertTrue("Collection is the wrong size--wanted 100, got: "
-                + someCol.size(), someCol.size() == 100);
+        assertEquals("Size--wanted 100", 100, someCol.size());
     }
 
     /**
@@ -100,8 +99,7 @@
      */
     public void test_toArray() {
         Object[] objArray = org.toArray();
-        assertTrue("The returned array is the wrong length--wanted 100, got: "
-                + objArray.length, objArray.length == 100);
+        assertEquals("Length", 100, objArray.length);
         HashSet duplicates = new HashSet();
         for (int i = objArray.length - 1; i >= 0; i--) {
             assertTrue("The returned array has an incorrect value. At i = " + i
@@ -119,9 +117,7 @@
     public void test_toArray$Ljava_lang_Object() {
         Object[] objArray = new Object[100];
         org.toArray(objArray);
-        assertTrue(
-                "a) The returned array is the wrong length--wanted 100, got: "
-                        + objArray.length, objArray.length == 100);
+        assertEquals("a) Length", 100, objArray.length);
         HashSet duplicates = new HashSet();
         for (int i = objArray.length - 1; i >= 0; i--) {
             assertTrue("a) The returned array has an incorrect value at i = "
@@ -134,9 +130,7 @@
         Integer[] intArray = new Integer[105];
         intArray[100] = new Integer(1203);
         org.toArray(intArray);
-        assertTrue(
-                "b) The returned array is the wrong length--wanted 105, got: "
-                        + intArray.length, intArray.length == 105);
+        assertEquals("b) Length", 105, intArray.length);
         duplicates = new HashSet();
         for (int i = 99; i >= 0; i--) {
             assertTrue("b) The returned array has an incorrect value at i = "
@@ -149,9 +143,7 @@
 
         intArray = new Integer[1];
         intArray = (Integer[]) org.toArray(intArray);
-        assertTrue(
-                "c) The returned array is the wrong length--wanted 100, got: "
-                        + intArray.length, intArray.length == 100);
+        assertEquals("c) Length", 100, intArray.length);
         duplicates = new HashSet();
         for (int i = intArray.length - 1; i >= 0; i--) {
             assertTrue("c) The returned array has an incorrect value. At i = "