harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r396869 - in /incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql: DateTest.java DriverManagerTest.java DriverPropertyInfoTest.java SQLPermissionTest.java TimeTest.java TimestampTest.java
Date Tue, 25 Apr 2006 12:42:25 GMT
Author: smishura
Date: Tue Apr 25 05:42:21 2006
New Revision: 396869

URL: http://svn.apache.org/viewcvs?rev=396869&view=rev
Log:
Apply patch for HARMONY-353 (improvements to junit test method usage) for sql module. All
sql tests passed on Windows.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DateTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimeTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DateTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DateTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DateTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DateTest.java
Tue Apr 25 05:42:21 2006
@@ -118,7 +118,7 @@
 			try {
 				Date theDate = new Date(init1[i], init2[i], init3[i]);
 
-				assertTrue(theDate != null);
+				assertNotNull(theDate);
 				if (theExceptions[i] != null) {
 					fail(i + "Exception expected - none thrown.");
 				} // end if
@@ -151,7 +151,7 @@
 			try {
 				Date theDate = new Date(init1[i]);
 
-				assertTrue(theDate != null);
+				assertNotNull(theDate);
 				if (theExceptions[i] != null) {
 					fail(i + "Exception expected - none thrown.");
 				} // end if
@@ -179,7 +179,7 @@
 			int theHours = theDate.getHours();
 
 			// If it worked, it should get the Hours setting
-			assertTrue(theHours == 23);
+			assertEquals(23, theHours);
 			assertTrue(false);
 		} catch (IllegalArgumentException ie) {
 			/*
@@ -200,7 +200,7 @@
 			int theMinutes = theDate.getMinutes();
 
 			// If it worked, it should get the Hours setting
-			assertTrue(theMinutes == 59);
+			assertEquals(59, theMinutes);
 			assertTrue(false);
 		} catch (IllegalArgumentException ie) {
 			/*
@@ -221,7 +221,7 @@
 			int theSeconds = theDate.getSeconds();
 
 			// If it worked, it should get the Hours setting
-			assertTrue(theSeconds == 23);
+			assertEquals(23, theSeconds);
 			assertTrue(false);
 		} catch (IllegalArgumentException ie) {
 			/*

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java
Tue Apr 25 05:42:21 2006
@@ -194,7 +194,7 @@
 		// validConnection - no user & password required
 		try {
 			theConnection = DriverManager.getConnection(validConnectionURL);
-			assertTrue(theConnection != null);
+			assertNotNull(theConnection);
 		} catch (SQLException e) {
 			assertTrue(false);
 		} // end try
@@ -207,7 +207,7 @@
 						.getConnection(invalidConnectionURLs[i]);
 				assertFalse(theConnection != null);
 			} catch (SQLException e) {
-				assertTrue(theConnection == null);
+				assertNull(theConnection);
 				// System.out.println("testGetConnectionString: exception
 				// message: " +
 				// e.getMessage() );
@@ -249,7 +249,7 @@
 		// validConnection - user & password required
 		try {
 			theConnection = DriverManager.getConnection(validURL1, validProps);
-			assertTrue(theConnection != null);
+			assertNotNull(theConnection);
 		} catch (SQLException e) {
 			assertTrue(false);
 		} // end try
@@ -299,7 +299,7 @@
 		try {
 			theConnection = DriverManager.getConnection(validURL1, validuser1,
 					validpassword1);
-			assertTrue(theConnection != null);
+			assertNotNull(theConnection);
 		} catch (SQLException e) {
 			assertTrue(false);
 		} // end try
@@ -389,7 +389,7 @@
 	} // end method testGetLoginTimeout()
 
 	public void testGetLogStream() {
-		assertTrue(DriverManager.getLogStream() == null);
+		assertNull(DriverManager.getLogStream());
 
 		DriverManager.setLogStream(testPrintStream);
 
@@ -399,7 +399,7 @@
 	} // end method testGetLogStream()
 
 	public void testGetLogWriter() {
-		assertTrue(DriverManager.getLogWriter() == null);
+		assertNull(DriverManager.getLogWriter());
 
 		DriverManager.setLogWriter(testPrintWriter);
 
@@ -499,7 +499,7 @@
 
 		DriverManager.setLogStream(null);
 
-		assertTrue(DriverManager.getLogStream() == null);
+		assertNull(DriverManager.getLogStream());
 
 		// Now let's deal with the case where there is a SecurityManager in
 		// place
@@ -549,8 +549,8 @@
 
 		DriverManager.setLogWriter(null);
 
-		assertTrue("testDriverManager: Log writer not null:", DriverManager
-				.getLogWriter() == null);
+		assertNull("testDriverManager: Log writer not null:", DriverManager
+				.getLogWriter());
 
 		// Now let's deal with the case where there is a SecurityManager in
 		// place

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java
Tue Apr 25 05:42:21 2006
@@ -41,7 +41,7 @@
 		DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo(
 				validName, validValue);
 
-		assertTrue(aDriverPropertyInfo != null);
+		assertNotNull(aDriverPropertyInfo);
 
 		aDriverPropertyInfo = new DriverPropertyInfo(null, null);
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java
Tue Apr 25 05:42:21 2006
@@ -39,7 +39,7 @@
 
 		SQLPermission thePermission = new SQLPermission(validName, validActions);
 
-		assertTrue(thePermission != null);
+		assertNotNull(thePermission);
 		assertTrue(thePermission.getName().equals(validName));
 		// System.out.println("The actions: " + thePermission.getActions() + "."
 		// );
@@ -54,7 +54,7 @@
 
 		SQLPermission thePermission = new SQLPermission(validName);
 
-		assertTrue(thePermission != null);
+		assertNotNull(thePermission);
 		assertTrue(thePermission.getName().equals(validName));
 
 		// Set an invalid name ... 
@@ -62,7 +62,7 @@
 
 		thePermission = new SQLPermission(invalidName);
 
-		assertTrue(thePermission != null);
+		assertNotNull(thePermission);
 		assertTrue(thePermission.getName().equals(invalidName));
 		assertTrue(thePermission.getActions().equals(""));
 	} // end method testSQLPermissionString

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimeTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimeTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimeTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimeTest.java
Tue Apr 25 05:42:21 2006
@@ -74,14 +74,14 @@
 		Time theTime = new Time(10, 45, 20);
 
 		// The date should have been created
-		assertTrue(theTime != null);
+		assertNotNull(theTime);
 	} // end method testTimeintintint()
 
 	public void testTime() {
 		Time theTime = new Time(TIME_TEST1);
 
 		// The date should have been created
-		assertTrue(theTime != null);
+		assertNotNull(theTime);
 	} // end method testTime()
 
 	public void testToString() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java?rev=396869&r1=396868&r2=396869&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java
Tue Apr 25 05:42:21 2006
@@ -109,7 +109,7 @@
 		Timestamp theTimestamp = new Timestamp(TIME_TEST1);
 
 		// The Timestamp should have been created
-		assertTrue(theTimestamp != null);
+		assertNotNull(theTimestamp);
 	} // end method testTimestamplong
 
 	/*
@@ -153,7 +153,7 @@
 				Timestamp theTimestamp = new Timestamp(initParms[i][0],
 						initParms[i][1], initParms[i][2], initParms[i][3],
 						initParms[i][4], initParms[i][5], initParms[i][6]);
-				assertTrue("Timestamp not generated: ", theTimestamp != null);
+				assertNotNull("Timestamp not generated: ", theTimestamp);
 				if (theExceptions[i] != null)
 					fail(i + ": Did not get exception");
 			} catch (Exception e) {
@@ -556,7 +556,7 @@
 
 			assertTrue(theTimestamp.compareTo(theTest) > 0);
 			assertTrue(theTimestamp.compareTo(theTest2) < 0);
-			assertTrue(theTimestamp.compareTo(theTimestamp2) == 0);
+			assertEquals(0, theTimestamp.compareTo(theTimestamp2));
 		} // end for
 
 	} // end method testcompareToTimestamp
@@ -574,7 +574,7 @@
 
 			assertTrue(theTimestamp.compareTo(theTest) > 0);
 			assertTrue(theTimestamp.compareTo(theTest2) < 0);
-			assertTrue(theTimestamp.compareTo(theTimestamp2) == 0);
+			assertEquals(0, theTimestamp.compareTo(theTimestamp2));
 		} // end for
 
 		Object nastyTest = new String("Test ");



Mime
View raw message