harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r463380 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java: org/apache/harmony/luni/tests/java/lang/ tests/api/java/io/ tests/api/java/net/ tests/api/java/util/
Date Thu, 12 Oct 2006 18:58:39 GMT
Author: hindessm
Date: Thu Oct 12 11:58:37 2006
New Revision: 463380

URL: http://svn.apache.org/viewvc?view=rev&rev=463380
Log:
Replace assertEquals(true, blah) with assertTrue(blah).
Replace assertEquals(false, blah) with assertFalse(blah).
Replace assertTrue(blah == true) with assertTrue(blah).

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataInputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ArraysTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/BitSetTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ScannerTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/PackageTest.java
Thu Oct 12 11:58:37 2006
@@ -322,13 +322,13 @@
 			c = Class.forName("p.C", true, ucl);
 			Package p = c.getPackage();
 			assertTrue("Package isCompatibleWith fails with lower version", p
-					.isCompatibleWith("2.1.9.") == true);
+					.isCompatibleWith("2.1.9."));
 			assertTrue("Package isCompatibleWith fails with same version (1)",
-					p.isCompatibleWith("2.2.0") == true);
+					p.isCompatibleWith("2.2.0"));
 			assertTrue("Package isCompatibleWith fails with same version (2)",
-					p.isCompatibleWith("2.2") == true);
-			assertTrue("Package isCompatibleWith fails with higher version", p
-					.isCompatibleWith("2.2.0.0.1") == false);
+					p.isCompatibleWith("2.2"));
+			assertFalse("Package isCompatibleWith fails with higher version",
+                                    p.isCompatibleWith("2.2.0.0.1"));
 		} catch (Exception e) {
 			fail("Exception during isCompatibleWith test : " + e.getMessage());
 		}
@@ -350,7 +350,7 @@
 			ucl = new java.net.URLClassLoader(urls, null);
 			c = Class.forName("p.q.C", true, ucl);
 			assertTrue("Package isSealed returns wrong boolean", c.getPackage()
-					.isSealed() == true);
+					.isSealed());
 
 		} catch (Exception e) {
 			fail("Exception during isSealed test : " + e.getMessage());
@@ -373,14 +373,13 @@
 			urls[0] = resourceURL;
 			ucl = new java.net.URLClassLoader(urls, null);
 			c = Class.forName("p.C", true, ucl);
-			assertTrue(
-					"Package isSealed returns wrong boolean (1)",
-					c.getPackage().isSealed(new URL("file:/" + resPath + "/")) == false);
+			assertFalse("Package isSealed returns wrong boolean (1)",
+                                    c.getPackage().isSealed(new URL("file:/" + resPath +
"/")));
 			assertTrue("Package isSealed returns wrong boolean (2)",
 					c.getPackage()
 							.isSealed(
 									new URL("file:/" + resPath
-											+ "/Package/hyts_c.jar")) == true);
+											+ "/Package/hyts_c.jar")));
 		} catch (Exception e) {
 			fail("Exception during isSealed test : " + e.getMessage());
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataInputStreamTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataInputStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataInputStreamTest.java
Thu Oct 12 11:58:37 2006
@@ -100,7 +100,7 @@
 			os.writeBoolean(true);
 			os.close();
 			openDataInputStream();
-			assertTrue("Incorrect boolean written", dis.readBoolean() == true);
+			assertTrue("Incorrect boolean written", dis.readBoolean());
 		} catch (IOException e) {
 			fail("readBoolean test failed : " + e.getMessage());
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/DataOutputStreamTest.java
Thu Oct 12 11:58:37 2006
@@ -127,7 +127,7 @@
 			openDataInputStream();
 			boolean c = dis.readBoolean();
 			dis.close();
-			assertTrue("Incorrect boolean written", c == true);
+			assertTrue("Incorrect boolean written", c);
 		} catch (IOException e) {
 			fail("Exception during writeBoolean test : " + e.getMessage());
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/io/PrintStreamTest.java
Thu Oct 12 11:58:37 2006
@@ -97,7 +97,7 @@
 				}
 			});
 			os.print(fileString.substring(0, 501));
-			assertTrue("Checkerror should return true", os.checkError() == true);
+			assertTrue("Checkerror should return true", os.checkError());
 		} catch (Exception e) {
 			fail("Exception raised : " + e.getMessage());
 		}
@@ -312,7 +312,7 @@
 		dis = new java.io.DataInputStream(new java.io.ByteArrayInputStream(bos
 				.toByteArray()));
 		try {
-			assertTrue("Incorrect boolean written", dis.readBoolean() == true);
+			assertTrue("Incorrect boolean written", dis.readBoolean());
 		} catch (java.io.IOException e) {
 			fail("Exception during test : " + e.getMessage());
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java
Thu Oct 12 11:58:37 2006
@@ -1368,8 +1368,8 @@
 
 		assertEquals("Normalized to incorrect URI", "file:/D:/three", uri2
 				.toString());
-		assertEquals("Resolved URI is not absolute", true, uri2.isAbsolute());
-		assertEquals("Resolved URI is opaque", false, uri2.isOpaque());
+		assertTrue("Resolved URI is not absolute", uri2.isAbsolute());
+		assertFalse("Resolved URI is opaque", uri2.isOpaque());
 		assertEquals("Resolved URI has incorrect scheme  specific part",
 				"/D:/three", uri2.getRawSchemeSpecificPart());
 	}
@@ -1598,8 +1598,8 @@
 
 		assertEquals("Resolved to incorrect URI", "file:/D:/one/", uri2
 				.toString());
-		assertEquals("Resolved URI is not absolute", true, uri2.isAbsolute());
-		assertEquals("Resolved URI is opaque", false, uri2.isOpaque());
+		assertTrue("Resolved URI is not absolute", uri2.isAbsolute());
+		assertFalse("Resolved URI is opaque", uri2.isOpaque());
 		assertEquals("Resolved URI has incorrect scheme  specific part",
 				"/D:/one/", uri2.getRawSchemeSpecificPart());
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ArraysTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ArraysTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ArraysTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ArraysTest.java
Thu Oct 12 11:58:37 2006
@@ -536,7 +536,7 @@
 		boolean d[] = new boolean[1000];
 		Arrays.fill(d, true);
 		for (int i = 0; i < d.length; i++)
-			assertTrue("Failed to fill boolean array correctly", d[i] == true);
+			assertTrue("Failed to fill boolean array correctly", d[i]);
 	}
 
 	/**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/BitSetTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/BitSetTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/BitSetTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/BitSetTest.java
Thu Oct 12 11:58:37 2006
@@ -126,7 +126,7 @@
 		bs.set(bs.size() - 1);
 		bs.clear();
 		assertEquals("Test2: Wrong length", 0, bs.length());
-		assertEquals("Test2: isEmpty() returned incorrect value", true, bs
+		assertTrue("Test2: isEmpty() returned incorrect value", bs
 				.isEmpty());
 		assertEquals("Test2: cardinality() returned incorrect value", 0, bs
 				.cardinality());
@@ -855,64 +855,64 @@
 		bs.set(450);
 
 		BitSet bs2 = new BitSet(8);
-		assertEquals("Test1: intersects() returned incorrect value", false, bs
+		assertFalse("Test1: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test1: intersects() returned incorrect value", false, bs2
+		assertFalse("Test1: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.set(4);
-		assertEquals("Test2: intersects() returned incorrect value", false, bs
+		assertFalse("Test2: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test2: intersects() returned incorrect value", false, bs2
+		assertFalse("Test2: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(5);
-		assertEquals("Test3: intersects() returned incorrect value", true, bs
+		assertTrue("Test3: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test3: intersects() returned incorrect value", true, bs2
+		assertTrue("Test3: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(63);
-		assertEquals("Test4: intersects() returned incorrect value", true, bs
+		assertTrue("Test4: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test4: intersects() returned incorrect value", true, bs2
+		assertTrue("Test4: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(80);
-		assertEquals("Test5: intersects() returned incorrect value", true, bs
+		assertTrue("Test5: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test5: intersects() returned incorrect value", true, bs2
+		assertTrue("Test5: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(127);
-		assertEquals("Test6: intersects() returned incorrect value", true, bs
+		assertTrue("Test6: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test6: intersects() returned incorrect value", true, bs2
+		assertTrue("Test6: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(192);
-		assertEquals("Test7: intersects() returned incorrect value", true, bs
+		assertTrue("Test7: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test7: intersects() returned incorrect value", true, bs2
+		assertTrue("Test7: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(450);
-		assertEquals("Test8: intersects() returned incorrect value", true, bs
+		assertTrue("Test8: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test8: intersects() returned incorrect value", true, bs2
+		assertTrue("Test8: intersects() returned incorrect value", bs2
 				.intersects(bs));
 
 		bs2.clear();
 		bs2.set(500);
-		assertEquals("Test9: intersects() returned incorrect value", false, bs
+		assertFalse("Test9: intersects() returned incorrect value", bs
 				.intersects(bs2));
-		assertEquals("Test9: intersects() returned incorrect value", false, bs2
+		assertFalse("Test9: intersects() returned incorrect value", bs2
 				.intersects(bs));
 	}
 
@@ -1223,34 +1223,34 @@
 	 */
 	public void test_isEmpty() {
 		BitSet bs = new BitSet(500);
-		assertEquals("Test: isEmpty() returned wrong value", true, bs.isEmpty());
+		assertTrue("Test: isEmpty() returned wrong value", bs.isEmpty());
 
 		// at bitset element 0
 		bs.set(3);
-		assertEquals("Test0: isEmpty() returned wrong value", false, bs
+		assertFalse("Test0: isEmpty() returned wrong value", bs
 				.isEmpty());
 
 		// at bitset element 1
 		bs.clear();
 		bs.set(12);
-		assertEquals("Test1: isEmpty() returned wrong value", false, bs
+		assertFalse("Test1: isEmpty() returned wrong value", bs
 				.isEmpty());
 
 		// at bitset element 2
 		bs.clear();
 		bs.set(128);
-		assertEquals("Test2: isEmpty() returned wrong value", false, bs
+		assertFalse("Test2: isEmpty() returned wrong value", bs
 				.isEmpty());
 
 		// boundary testing
 		bs.clear();
 		bs.set(459);
-		assertEquals("Test3: isEmpty() returned wrong value", false, bs
+		assertFalse("Test3: isEmpty() returned wrong value", bs
 				.isEmpty());
 
 		bs.clear();
 		bs.set(511);
-		assertEquals("Test4: isEmpty() returned wrong value", false, bs
+		assertFalse("Test4: isEmpty() returned wrong value", bs
 				.isEmpty());
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java
Thu Oct 12 11:58:37 2006
@@ -786,32 +786,32 @@
 		// test replace for an element that is not in the list
 		boolean result = Collections.replaceAll(list, new Character('1'),
 				new Character('Z'));
-		assertEquals("Test1: Collections.replaceAll() returned wrong result",
-				false, result);
+		assertFalse("Test1: Collections.replaceAll() returned wrong result",
+				result);
 		assertEquals("Test2 : ReplaceAll modified the list incorrectly",
 				string1, getString(list));
 
 		// test replace for an element that is in the list
 		result = Collections.replaceAll(list, new Character('S'),
 				new Character('K'));
-		assertEquals("Test3: Collections.replaceAll() returned wrong result",
-				true, result);
+		assertTrue("Test3: Collections.replaceAll() returned wrong result",
+				result);
 		assertEquals("Test4: ReplaceAll modified the list incorrectly",
 				(string1 = string1.replace('S', 'K')), getString(list));
 
 		// test replace for the last element in the list
 		result = Collections.replaceAll(list, new Character('Z'),
 				new Character('N'));
-		assertEquals("Test5: Collections.replaceAll() returned wrong result",
-				true, result);
+		assertTrue("Test5: Collections.replaceAll() returned wrong result",
+				result);
 		assertEquals("Test6: ReplaceAll modified the list incorrectly",
 				(string1 = string1.replace('Z', 'N')), getString(list));
 
 		// test replace for the first element in the list
 		result = Collections.replaceAll(list, new Character('A'),
 				new Character('B'));
-		assertEquals("Test7: Collections.replaceAll() returned wrong result",
-				true, result);
+		assertTrue("Test7: Collections.replaceAll() returned wrong result",
+				result);
 		assertEquals("Test8: ReplaceAll modified the list incorrectly",
 				(string1 = string1.replace('A', 'B')), getString(list));
 
@@ -822,8 +822,8 @@
 		}
 		smallList.set(4, new Integer(5));
 		result = Collections.replaceAll(smallList, new Integer(5), null);
-		assertEquals("Test9: Collections.replaceAll() returned wrong result",
-				true, result);
+		assertTrue("Test9: Collections.replaceAll() returned wrong result",
+				result);
 		for (int i = 0; i < smallList.size(); i++) {
 			if (i == 4 || i == 5)
 				assertSame("Test9: ReplaceAll didn't replace element at " + i,
@@ -836,8 +836,8 @@
 
 		// test replacing null elements with another value
 		result = Collections.replaceAll(smallList, null, new Integer(99));
-		assertEquals("Test10: Collections.replaceAll() returned wrong result",
-				true, result);
+		assertTrue("Test10: Collections.replaceAll() returned wrong result",
+				result);
 
 		for (int i = 0; i < smallList.size(); i++) {
 			if (i == 4 || i == 5)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ScannerTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ScannerTest.java?view=diff&rev=463380&r1=463379&r2=463380
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ScannerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/util/ScannerTest.java
Thu Oct 12 11:58:37 2006
@@ -529,7 +529,7 @@
         } catch (IllegalStateException e) {
             // Expected
         }
-        assertEquals(true, s.nextBoolean());
+        assertTrue(s.nextBoolean());
         result = s.match();
         assertEquals(0, result.start());
         assertEquals(4, result.end());
@@ -537,7 +537,7 @@
         assertEquals(4, result.end(0));
         assertEquals("True", result.group());
         assertEquals(0, result.groupCount());
-        assertEquals(false, s.nextBoolean());
+        assertFalse(s.nextBoolean());
         try {
             s.nextBoolean();
             fail("should throw NoSuchElementException");
@@ -552,7 +552,7 @@
         }
         
         s = new Scanner("True faLse");
-        assertEquals(true, s.nextBoolean());
+        assertTrue(s.nextBoolean());
         result = s.match();
         assertEquals(0, result.start());
         assertEquals(4, result.end());
@@ -576,7 +576,7 @@
         assertEquals(0, result.groupCount());
         
         s = new Scanner("True fase");
-        assertEquals(true, s.nextBoolean());
+        assertTrue(s.nextBoolean());
         assertEquals(0, result.groupCount());
         try {
             s.nextBoolean();
@@ -592,7 +592,7 @@
         }
         
         s = new Scanner("True fase");
-        assertEquals(true, s.nextBoolean());
+        assertTrue(s.nextBoolean());
         try {
             s.next((Pattern)null);
             fail("Should throw NullPointerException");



Mime
View raw message