harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r470341 - in /incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql: DriverPropertyInfoTest.java SQLPermissionTest.java
Date Thu, 02 Nov 2006 12:07:21 GMT
Author: pyang
Date: Thu Nov  2 04:07:21 2006
New Revision: 470341

URL: http://svn.apache.org/viewvc?view=rev&rev=470341
Log:
Apply patch for HARMONY-2013 ([classlib][sql]Some testcases in java.sql.SQLPermissionTest.java
and java.sql.DriverPropertyInfoTest.java violate the JUnit Best Practice)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java?view=diff&rev=470341&r1=470340&r2=470341
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java
Thu Nov  2 04:07:21 2006
@@ -18,6 +18,7 @@
 package org.apache.harmony.sql.tests.java.sql;
 
 import java.sql.DriverPropertyInfo;
+import java.util.Arrays;
 
 import junit.framework.TestCase;
 
@@ -72,11 +73,11 @@
 		DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo(
 				validName, validValue);
 
-		assertTrue(aDriverPropertyInfo.choices == testChoices);
-		assertTrue(aDriverPropertyInfo.value == testValue);
-		assertTrue(aDriverPropertyInfo.required == testRequired);
-		assertTrue(aDriverPropertyInfo.description == testDescription);
-		assertTrue(aDriverPropertyInfo.name == testName);
+		assertTrue(Arrays.equals(testChoices, aDriverPropertyInfo.choices));
+		assertEquals(testValue, aDriverPropertyInfo.value);
+		assertEquals(testRequired, aDriverPropertyInfo.required);
+		assertEquals(testDescription, aDriverPropertyInfo.description);
+		assertEquals(testName, aDriverPropertyInfo.name);
 
 		aDriverPropertyInfo.choices = updateChoices;
 		aDriverPropertyInfo.value = updateValue;
@@ -84,11 +85,11 @@
 		aDriverPropertyInfo.description = updateDescription;
 		aDriverPropertyInfo.name = updateName;
 
-		assertTrue(aDriverPropertyInfo.choices == updateChoices);
-		assertTrue(aDriverPropertyInfo.value == updateValue);
-		assertTrue(aDriverPropertyInfo.required == updateRequired);
-		assertTrue(aDriverPropertyInfo.description == updateDescription);
-		assertTrue(aDriverPropertyInfo.name == updateName);
+		assertTrue(Arrays.equals(updateChoices, aDriverPropertyInfo.choices));
+		assertEquals(updateValue, aDriverPropertyInfo.value);
+		assertEquals(updateRequired, aDriverPropertyInfo.required);
+		assertEquals(updateDescription, aDriverPropertyInfo.description);
+		assertEquals(updateName, aDriverPropertyInfo.name);
 
 	} // end method testPublicFields
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java?view=diff&rev=470341&r1=470340&r2=470341
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java
Thu Nov  2 04:07:21 2006
@@ -42,10 +42,10 @@
 		SQLPermission thePermission = new SQLPermission(validName, validActions);
 
 		assertNotNull(thePermission);
-		assertTrue(thePermission.getName().equals(validName));
+		assertEquals(validName, thePermission.getName());
 		// System.out.println("The actions: " + thePermission.getActions() + "."
 		// );
-		assertTrue(thePermission.getActions().equals(""));
+		assertEquals("", thePermission.getActions());
 	} // end method testSQLPermissionStringString
 
 	/*
@@ -57,7 +57,7 @@
 		SQLPermission thePermission = new SQLPermission(validName);
 
 		assertNotNull(thePermission);
-		assertTrue(thePermission.getName().equals(validName));
+		assertEquals(validName, thePermission.getName());
 
 		// Set an invalid name ... 
 		String invalidName = "foo";
@@ -65,8 +65,8 @@
 		thePermission = new SQLPermission(invalidName);
 
 		assertNotNull(thePermission);
-		assertTrue(thePermission.getName().equals(invalidName));
-		assertTrue(thePermission.getActions().equals(""));
+		assertEquals(invalidName, thePermission.getName());
+		assertEquals("", thePermission.getActions());
 	} // end method testSQLPermissionString
 
 } // end class SQLPermissionTest



Mime
View raw message