harmony-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?view=rev&rev=463365
Log:
Replace assertEquals(null, blah) with assertNull.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/OutOfMemoryErrorTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URITest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/URITest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java?view=diff&rev=463365&r1=463364&r2=463365
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/InputStreamReaderTest.java
Thu Oct 12 11:28:09 2006
@@ -31,7 +31,7 @@
         in = new InputStreamReader(new ByteArrayInputStream(b), "UTF-16BE");
         in.close();
         String result = in.getEncoding();
-        assertEquals(null, result);
+        assertNull(result);
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java?view=diff&rev=463365&r1=463364&r2=463365
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/io/OutputStreamWriterTest.java
Thu Oct 12 11:28:09 2006
@@ -38,7 +38,7 @@
 			fail("Should not throw IOException");
 		}
 		String result = out.getEncoding();
-		assertEquals(null, result);
+		assertNull(result);
 	}
 
 	public void testGetEncoding_NotHistorical() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/OutOfMemoryErrorTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/OutOfMemoryErrorTest.java?view=diff&rev=463365&r1=463364&r2=463365
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/OutOfMemoryErrorTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/OutOfMemoryErrorTest.java
Thu Oct 12 11:28:09 2006
@@ -25,8 +25,8 @@
 	public void test_Constructor() {
 		// Test for method java.lang.OutOfMemoryError()
 	    Error e = new OutOfMemoryError();
-        assertEquals(null, e.getCause());
-        assertEquals(null, e.getMessage());
+        assertNull(e.getCause());
+        assertNull(e.getMessage());
 	}
 
 	/**
@@ -35,12 +35,12 @@
 	public void test_ConstructorLjava_lang_String() {
 		// Test for method java.lang.OutOfMemoryError(java.lang.String)
 		Error e = new OutOfMemoryError(null);
-        assertEquals(null, e.getMessage());
-        assertEquals(null, e.getCause());
+        assertNull(e.getMessage());
+        assertNull(e.getCause());
         
         e= new OutOfMemoryError("msg");
         assertEquals("msg", e.getMessage());
-        assertEquals(null, e.getCause());
+        assertNull(e.getCause());
 	}
 
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URITest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URITest.java?view=diff&rev=463365&r1=463364&r2=463365
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URITest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/java/net/URITest.java
Thu Oct 12 11:28:09 2006
@@ -40,7 +40,7 @@
 		// if port value is negative, the authority should be considered registry-based.
 		URI uri = new URI("http://host:-8096/path/index.html");
 		assertEquals("Assert 2: returned wrong port value,", -1, uri.getPort());
-		assertEquals("Assert 3: returned wrong host value,", null, uri.getHost());
+		assertNull("Assert 3: returned wrong host value,", uri.getHost());
 		try {
 			uri.parseServerAuthority();
 			fail("Assert 4: Expected URISyntaxException");
@@ -50,7 +50,7 @@
 		
 		uri = new URI("http","//myhost:-8096", null);
 		assertEquals("Assert 5: returned wrong port value,", -1, uri.getPort());
-		assertEquals("Assert 6: returned wrong host value,", null, uri.getHost());
+		assertNull("Assert 6: returned wrong host value,", uri.getHost());
 		try {
 			uri.parseServerAuthority();
 			fail("Assert 7: Expected URISyntaxException");

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java?view=diff&rev=463365&r1=463364&r2=463365
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java
Thu Oct 12 11:28:09 2006
@@ -268,8 +268,8 @@
 	 */
 	public void test_getByNameLjava_lang_String() {
 		try {
-			assertTrue("validate null handled ok", null == NetworkInterface
-					.getByName(null));
+			assertNull("validate null handled ok",
+                                   NetworkInterface.getByName(null));
 			fail("getByName did not throw NullPointerException for null argument");
 		} catch (NullPointerException e) {
 		} catch (Exception e) {
@@ -278,9 +278,8 @@
 		}
 
 		try {
-			assertTrue(
-					"validate handled ok if we ask for name not associated with any interface",
-					null == NetworkInterface.getByName("8not a name4"));
+			assertNull("validate handled ok if we ask for name not associated with any interface",
+                                   NetworkInterface.getByName("8not a name4"));
 		} catch (Exception e) {
 			fail("getByName, unknown inetAddress - raised exception : "
 					+ e.getMessage());
@@ -331,8 +330,8 @@
 		addressBytes[3] = 0;
 
 		try {
-			assertTrue("validate null handled ok", null == NetworkInterface
-					.getByInetAddress(null));
+			assertNull("validate null handled ok",
+                                   NetworkInterface.getByInetAddress(null));
 			fail("should not get here if getByInetAddress throws "
 					+ "NullPointerException if null passed in");
 		} catch (NullPointerException e) {
@@ -342,9 +341,8 @@
 		}
 
 		try {
-			assertTrue(
-					"validate handled ok if we ask for address not associated with any interface",
-					null == NetworkInterface.getByInetAddress(InetAddress
+			assertNull("validate handled ok if we ask for address not associated with any interface",
+                                   NetworkInterface.getByInetAddress(InetAddress
 							.getByAddress(addressBytes)));
 		} catch (Exception e) {
 			fail("getByInetAddress, unknown inetAddress threw exception : " + e);

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=463365&r1=463364&r2=463365
==============================================================================
--- 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:28:09 2006
@@ -903,7 +903,7 @@
 
                 URI uri = new URI("http://myhost:-8096/site/index.html");
                 assertEquals("TestA, returned wrong port value,", -1, uri.getPort());
-                assertEquals("TestA, returned wrong host value,", null, uri
+                assertNull("TestA, returned wrong host value,", uri
                              .getHost());
                 try {
                         uri.parseServerAuthority();
@@ -913,7 +913,7 @@
 
                 uri = new URI("http", "//myhost:-8096", null);
                 assertEquals("TestB returned wrong port value,", -1, uri.getPort());
-                assertEquals("TestB returned wrong host value,", null, uri
+                assertNull("TestB returned wrong host value,", uri
                              .getHost());
                 try {
                         uri.parseServerAuthority();



Mime
View raw message