harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r436644 [1/6] - /incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/
Date Fri, 25 Aug 2006 04:29:36 GMT
Author: smishura
Date: Thu Aug 24 21:29:34 2006
New Revision: 436644

URL: http://svn.apache.org/viewvc?rev=436644&view=rev
Log:
Setting eol-style=native

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DateTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverManagerTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DriverPropertyInfoTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_Array.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_Connection.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_DatabaseMetaData.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_ParameterMetaData.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_ResultSet.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_ResultSetMetaData.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/Impl_Statement.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ParameterMetaDataTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetMetaDataTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ResultSetTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLPermissionTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/StatementTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_ClassLoader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Connection1.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver1.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver2.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver3.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver4.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_Driver5.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TestHelper_DriverManager.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimeTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TimestampTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/TypesTest.java   (contents, props changed)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java?rev=436644&r1=436643&r2=436644&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java Thu Aug 24 21:29:34 2006
@@ -1,68 +1,68 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.sql.tests.java.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for the java.sql package
- * 
- */
-public class AllTests {
-
-	public static Test suite() {
-		TestSuite suite = new TestSuite(
-                "Suite for org.apache.harmony.sql.tests.java.sql");
-		// $JUnit-BEGIN$
-		suite.addTestSuite(BatchUpdateExceptionTest.class);
-		suite.addTestSuite(DataTruncationTest.class);
-		suite.addTestSuite(DateTest.class);
-		suite.addTestSuite(DriverManagerTest.class);
-		suite.addTestSuite(DriverPropertyInfoTest.class);
-		suite.addTestSuite(SQLPermissionTest.class);
-		suite.addTestSuite(DatabaseMetaDataTest.class);
-		suite.addTestSuite(ResultSetMetaDataTest.class);
-		suite.addTestSuite(ConnectionTest.class);
-		suite.addTestSuite(ParameterMetaDataTest.class);
-		suite.addTestSuite(ResultSetTest.class);
-		suite.addTestSuite(SQLExceptionTest.class);
-		suite.addTestSuite(SQLWarningTest.class);
-		suite.addTestSuite(StatementTest.class);
-		suite.addTestSuite(TimeTest.class);
-		suite.addTestSuite(TimestampTest.class);
-		suite.addTestSuite(TypesTest.class);
-		// Tests needed for the following interfaces are not mandatory but some
-		// are supplied to check Public Static values:
-		// Array
-		// Blob
-		// CallableStatement
-		// Clob
-		// Connection
-		// Driver
-		// ParameterMetaData
-		// PreparedStatement
-		// Ref
-		// Savepoint
-		// Struct
-		// SQLData
-		// SQLInput
-		// SQLOutput
-		// $JUnit-END$
-		return suite;
-	}
-}
-
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.sql.tests.java.sql;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite for the java.sql package
+ * 
+ */
+public class AllTests {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+                "Suite for org.apache.harmony.sql.tests.java.sql");
+		// $JUnit-BEGIN$
+		suite.addTestSuite(BatchUpdateExceptionTest.class);
+		suite.addTestSuite(DataTruncationTest.class);
+		suite.addTestSuite(DateTest.class);
+		suite.addTestSuite(DriverManagerTest.class);
+		suite.addTestSuite(DriverPropertyInfoTest.class);
+		suite.addTestSuite(SQLPermissionTest.class);
+		suite.addTestSuite(DatabaseMetaDataTest.class);
+		suite.addTestSuite(ResultSetMetaDataTest.class);
+		suite.addTestSuite(ConnectionTest.class);
+		suite.addTestSuite(ParameterMetaDataTest.class);
+		suite.addTestSuite(ResultSetTest.class);
+		suite.addTestSuite(SQLExceptionTest.class);
+		suite.addTestSuite(SQLWarningTest.class);
+		suite.addTestSuite(StatementTest.class);
+		suite.addTestSuite(TimeTest.class);
+		suite.addTestSuite(TimestampTest.class);
+		suite.addTestSuite(TypesTest.class);
+		// Tests needed for the following interfaces are not mandatory but some
+		// are supplied to check Public Static values:
+		// Array
+		// Blob
+		// CallableStatement
+		// Clob
+		// Connection
+		// Driver
+		// ParameterMetaData
+		// PreparedStatement
+		// Ref
+		// Savepoint
+		// Struct
+		// SQLData
+		// SQLInput
+		// SQLOutput
+		// $JUnit-END$
+		return suite;
+	}
+}
+

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/AllTests.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java?rev=436644&r1=436643&r2=436644&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java Thu Aug 24 21:29:34 2006
@@ -1,22 +1,22 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.sql.tests.java.sql;
-
-import junit.framework.TestCase;
-
-public class ArrayTest extends TestCase {
-
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.sql.tests.java.sql;
+
+import junit.framework.TestCase;
+
+public class ArrayTest extends TestCase {
+
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ArrayTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java?rev=436644&r1=436643&r2=436644&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java Thu Aug 24 21:29:34 2006
@@ -1,326 +1,326 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.sql.tests.java.sql;
-
-import java.sql.BatchUpdateException;
-
-import junit.framework.TestCase;
-
-public class BatchUpdateExceptionTest extends TestCase {
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testBatchUpdateException() {
-
-		int[] theFinalStates1 = { 0 }; // Error Code state
-		int[][] theFinalStates2 = { null }; // Update Counts array state
-		String[] theFinalStates3 = { null }; // SQL State state value
-		String[] theFinalStates4 = { null }; // Message state
-
-		Exception[] theExceptions = { null };
-
-		BatchUpdateException aBatchUpdateException;
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException();
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testBatchUpdateException
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testBatchUpdateExceptionintArray() {
-
-		int[][] init1 = { { 1, 2, 3 }, null };
-
-		int[] theFinalStates1 = { 0, 0 }; // Error Code state
-		int[][] theFinalStates2 = init1; // Update Counts array state
-		String[] theFinalStates3 = { null, null }; // SQL State state value
-		String[] theFinalStates4 = { null, null }; // Message state
-
-		Exception[] theExceptions = { null, null };
-
-		BatchUpdateException aBatchUpdateException;
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException(init1[i]);
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testBatchUpdateExceptionintArray
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testBatchUpdateExceptionStringintArray() {
-
-		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
-				".", "a" };
-		int[][] init2 = { { 1, 2, 3 }, {}, { 3 }, null, { 5, 5 }, { 6 },
-				{ 121, 2, 1 }, { 1 }, { 1, 2 } };
-
-		int[] theFinalStates1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Error Code
-																// state
-		// Update Counts array state
-		int[][] theFinalStates2 = init2;
-		// SQL State state value
-		String[] theFinalStates3 = { null, null, null, null, null, null, null,
-				null, null };
-		String[] theFinalStates4 = init1; // Message state
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null,
-				null, null };
-
-		BatchUpdateException aBatchUpdateException;
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException(init1[i],
-						init2[i]);
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testBatchUpdateExceptionStringintArray
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testBatchUpdateExceptionStringStringintArray() {
-
-		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
-				".", "a", "a" };
-		String[] init2 = { "a", "1", "valid1", "----", "&valid*", "a", null,
-				"", ".", "a" };
-		int[][] init3 = { { 1, 2, 3 }, {}, { 3 }, { 5, 5 }, { 6 },
-				{ 121, 2, 1 }, { 1 }, { 1, 2 }, { 1 }, { 2 }, null };
-
-		int[] theFinalStates1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Error
-																		// Code
-																		// state
-		// Update Counts array state
-		int[][] theFinalStates2 = init3;
-		// SQL State state value
-		String[] theFinalStates3 = init2;
-		String[] theFinalStates4 = init1; // Message state
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null,
-				null, null, null, null };
-
-		BatchUpdateException aBatchUpdateException;
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException(init1[i],
-						init2[i], init3[i]);
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testBatchUpdateExceptionStringStringintArray
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testBatchUpdateExceptionStringStringintintArray() {
-
-		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
-				".", "a", "a" };
-		String[] init2 = { "a", "1", "valid1", "----", "&valid*", "a", null,
-				"", ".", "a" };
-		int[] init3 = { -2147483648, 2147483647, 0, -492417162, -156220255,
-				-173012890, -631026360, -2147483648, -2147483648, -2147483648,
-				-2147483648 };
-		int[][] init4 = { { 1, 2, 3 }, {}, { 3 }, { 5, 5 }, { 6 },
-				{ 121, 2, 1 }, { 1 }, { 1, 2 }, { 1 }, { 2 }, null };
-
-		int[] theFinalStates1 = init3; // Error Code state
-		// Update Counts array state
-		int[][] theFinalStates2 = init4;
-		// SQL State state value
-		String[] theFinalStates3 = init2;
-		String[] theFinalStates4 = init1; // Message state
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null,
-				null, null, null, null };
-
-		BatchUpdateException aBatchUpdateException;
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException(init1[i],
-						init2[i], init3[i], init4[i]);
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testBatchUpdateExceptionStringStringintintArray
-
-	/*
-	 * Method test for getUpdateCounts
-	 */
-	public void testGetUpdateCounts() {
-
-		BatchUpdateException aBatchUpdateException;
-		int[][] init1 = { { 1, 2, 3 }, {}, null };
-
-		int[] theReturn;
-		int[][] theReturns = init1;
-
-		int[] theFinalStates1 = { 0, 0, 0 }; // Error Code state
-		int[][] theFinalStates2 = init1; // Update Counts array state
-		String[] theFinalStates3 = { null, null, null }; // SQL State state
-															// value
-		String[] theFinalStates4 = { null, null, null }; // Message state
-
-		Exception[] theExceptions = { null, null, null };
-
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aBatchUpdateException = new BatchUpdateException(init1[i]);
-				theReturn = aBatchUpdateException.getUpdateCounts();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getErrorCode(),
-						theFinalStates1[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getUpdateCounts(),
-						theFinalStates2[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
-				assertEquals(i + " Final state mismatch: ",
-						aBatchUpdateException.getMessage(), theFinalStates4[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetUpdateCounts
-
-} // end class BatchUpdateExceptionTest
-
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.sql.tests.java.sql;
+
+import java.sql.BatchUpdateException;
+
+import junit.framework.TestCase;
+
+public class BatchUpdateExceptionTest extends TestCase {
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testBatchUpdateException() {
+
+		int[] theFinalStates1 = { 0 }; // Error Code state
+		int[][] theFinalStates2 = { null }; // Update Counts array state
+		String[] theFinalStates3 = { null }; // SQL State state value
+		String[] theFinalStates4 = { null }; // Message state
+
+		Exception[] theExceptions = { null };
+
+		BatchUpdateException aBatchUpdateException;
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException();
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testBatchUpdateException
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testBatchUpdateExceptionintArray() {
+
+		int[][] init1 = { { 1, 2, 3 }, null };
+
+		int[] theFinalStates1 = { 0, 0 }; // Error Code state
+		int[][] theFinalStates2 = init1; // Update Counts array state
+		String[] theFinalStates3 = { null, null }; // SQL State state value
+		String[] theFinalStates4 = { null, null }; // Message state
+
+		Exception[] theExceptions = { null, null };
+
+		BatchUpdateException aBatchUpdateException;
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException(init1[i]);
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testBatchUpdateExceptionintArray
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testBatchUpdateExceptionStringintArray() {
+
+		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
+				".", "a" };
+		int[][] init2 = { { 1, 2, 3 }, {}, { 3 }, null, { 5, 5 }, { 6 },
+				{ 121, 2, 1 }, { 1 }, { 1, 2 } };
+
+		int[] theFinalStates1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Error Code
+																// state
+		// Update Counts array state
+		int[][] theFinalStates2 = init2;
+		// SQL State state value
+		String[] theFinalStates3 = { null, null, null, null, null, null, null,
+				null, null };
+		String[] theFinalStates4 = init1; // Message state
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null,
+				null, null };
+
+		BatchUpdateException aBatchUpdateException;
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException(init1[i],
+						init2[i]);
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testBatchUpdateExceptionStringintArray
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testBatchUpdateExceptionStringStringintArray() {
+
+		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
+				".", "a", "a" };
+		String[] init2 = { "a", "1", "valid1", "----", "&valid*", "a", null,
+				"", ".", "a" };
+		int[][] init3 = { { 1, 2, 3 }, {}, { 3 }, { 5, 5 }, { 6 },
+				{ 121, 2, 1 }, { 1 }, { 1, 2 }, { 1 }, { 2 }, null };
+
+		int[] theFinalStates1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // Error
+																		// Code
+																		// state
+		// Update Counts array state
+		int[][] theFinalStates2 = init3;
+		// SQL State state value
+		String[] theFinalStates3 = init2;
+		String[] theFinalStates4 = init1; // Message state
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null,
+				null, null, null, null };
+
+		BatchUpdateException aBatchUpdateException;
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException(init1[i],
+						init2[i], init3[i]);
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testBatchUpdateExceptionStringStringintArray
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testBatchUpdateExceptionStringStringintintArray() {
+
+		String[] init1 = { "a", "1", "valid1", "----", "&valid*", null, "",
+				".", "a", "a" };
+		String[] init2 = { "a", "1", "valid1", "----", "&valid*", "a", null,
+				"", ".", "a" };
+		int[] init3 = { -2147483648, 2147483647, 0, -492417162, -156220255,
+				-173012890, -631026360, -2147483648, -2147483648, -2147483648,
+				-2147483648 };
+		int[][] init4 = { { 1, 2, 3 }, {}, { 3 }, { 5, 5 }, { 6 },
+				{ 121, 2, 1 }, { 1 }, { 1, 2 }, { 1 }, { 2 }, null };
+
+		int[] theFinalStates1 = init3; // Error Code state
+		// Update Counts array state
+		int[][] theFinalStates2 = init4;
+		// SQL State state value
+		String[] theFinalStates3 = init2;
+		String[] theFinalStates4 = init1; // Message state
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null,
+				null, null, null, null };
+
+		BatchUpdateException aBatchUpdateException;
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException(init1[i],
+						init2[i], init3[i], init4[i]);
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testBatchUpdateExceptionStringStringintintArray
+
+	/*
+	 * Method test for getUpdateCounts
+	 */
+	public void testGetUpdateCounts() {
+
+		BatchUpdateException aBatchUpdateException;
+		int[][] init1 = { { 1, 2, 3 }, {}, null };
+
+		int[] theReturn;
+		int[][] theReturns = init1;
+
+		int[] theFinalStates1 = { 0, 0, 0 }; // Error Code state
+		int[][] theFinalStates2 = init1; // Update Counts array state
+		String[] theFinalStates3 = { null, null, null }; // SQL State state
+															// value
+		String[] theFinalStates4 = { null, null, null }; // Message state
+
+		Exception[] theExceptions = { null, null, null };
+
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aBatchUpdateException = new BatchUpdateException(init1[i]);
+				theReturn = aBatchUpdateException.getUpdateCounts();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getErrorCode(),
+						theFinalStates1[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getUpdateCounts(),
+						theFinalStates2[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getSQLState(), theFinalStates3[i]);
+				assertEquals(i + " Final state mismatch: ",
+						aBatchUpdateException.getMessage(), theFinalStates4[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetUpdateCounts
+
+} // end class BatchUpdateExceptionTest
+

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/BatchUpdateExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java?rev=436644&r1=436643&r2=436644&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java Thu Aug 24 21:29:34 2006
@@ -1,87 +1,87 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.sql.tests.java.sql;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-public class ConnectionTest extends TestCase {
-
-	/*
-	 * Public statics test
-	 */
-	public void testPublicStatics() {
-
-		HashMap thePublicStatics = new HashMap();
-		thePublicStatics.put("TRANSACTION_SERIALIZABLE", new Integer(8));
-		thePublicStatics.put("TRANSACTION_REPEATABLE_READ", new Integer(4));
-		thePublicStatics.put("TRANSACTION_READ_COMMITTED", new Integer(2));
-		thePublicStatics.put("TRANSACTION_READ_UNCOMMITTED", new Integer(1));
-		thePublicStatics.put("TRANSACTION_NONE", new Integer(0));
-
-		/*
-		 * System.out.println( "TRANSACTION_SERIALIZABLE: " +
-		 * Connection.TRANSACTION_SERIALIZABLE ); System.out.println(
-		 * "TRANSACTION_REPEATABLE_READ: " +
-		 * Connection.TRANSACTION_REPEATABLE_READ ); System.out.println(
-		 * "TRANSACTION_READ_COMMITTED: " +
-		 * Connection.TRANSACTION_READ_COMMITTED ); System.out.println(
-		 * "TRANSACTION_READ_UNCOMMITTED: " +
-		 * Connection.TRANSACTION_READ_UNCOMMITTED ); System.out.println(
-		 * "TRANSACTION_NONE: " + Connection.TRANSACTION_NONE );
-		 */
-
-		Class connectionClass;
-		try {
-			connectionClass = Class.forName("java.sql.Connection");
-		} catch (ClassNotFoundException e) {
-			fail("java.sql.Connection class not found!");
-			return;
-		} // end try
-
-		Field[] theFields = connectionClass.getDeclaredFields();
-		int requiredModifier = Modifier.PUBLIC + Modifier.STATIC
-				+ Modifier.FINAL;
-
-		int countPublicStatics = 0;
-		for (int i = 0; i < theFields.length; i++) {
-			String fieldName = theFields[i].getName();
-			int theMods = theFields[i].getModifiers();
-			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
-				try {
-					Object fieldValue = theFields[i].get(null);
-					Object expectedValue = thePublicStatics.get(fieldName);
-					if (expectedValue == null) {
-						fail("Field " + fieldName + " missing!");
-					} // end
-					assertEquals("Field " + fieldName + " value mismatch: ",
-							expectedValue, fieldValue);
-					assertEquals("Field " + fieldName + " modifier mismatch: ",
-							requiredModifier, theMods);
-					countPublicStatics++;
-				} catch (IllegalAccessException e) {
-					fail("Illegal access to Field " + fieldName);
-				} // end try
-			} // end if
-		} // end for
-
-	} // end method testPublicStatics
-
-} // end class ConnectionTest
-
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.sql.tests.java.sql;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+public class ConnectionTest extends TestCase {
+
+	/*
+	 * Public statics test
+	 */
+	public void testPublicStatics() {
+
+		HashMap thePublicStatics = new HashMap();
+		thePublicStatics.put("TRANSACTION_SERIALIZABLE", new Integer(8));
+		thePublicStatics.put("TRANSACTION_REPEATABLE_READ", new Integer(4));
+		thePublicStatics.put("TRANSACTION_READ_COMMITTED", new Integer(2));
+		thePublicStatics.put("TRANSACTION_READ_UNCOMMITTED", new Integer(1));
+		thePublicStatics.put("TRANSACTION_NONE", new Integer(0));
+
+		/*
+		 * System.out.println( "TRANSACTION_SERIALIZABLE: " +
+		 * Connection.TRANSACTION_SERIALIZABLE ); System.out.println(
+		 * "TRANSACTION_REPEATABLE_READ: " +
+		 * Connection.TRANSACTION_REPEATABLE_READ ); System.out.println(
+		 * "TRANSACTION_READ_COMMITTED: " +
+		 * Connection.TRANSACTION_READ_COMMITTED ); System.out.println(
+		 * "TRANSACTION_READ_UNCOMMITTED: " +
+		 * Connection.TRANSACTION_READ_UNCOMMITTED ); System.out.println(
+		 * "TRANSACTION_NONE: " + Connection.TRANSACTION_NONE );
+		 */
+
+		Class connectionClass;
+		try {
+			connectionClass = Class.forName("java.sql.Connection");
+		} catch (ClassNotFoundException e) {
+			fail("java.sql.Connection class not found!");
+			return;
+		} // end try
+
+		Field[] theFields = connectionClass.getDeclaredFields();
+		int requiredModifier = Modifier.PUBLIC + Modifier.STATIC
+				+ Modifier.FINAL;
+
+		int countPublicStatics = 0;
+		for (int i = 0; i < theFields.length; i++) {
+			String fieldName = theFields[i].getName();
+			int theMods = theFields[i].getModifiers();
+			if (Modifier.isPublic(theMods) && Modifier.isStatic(theMods)) {
+				try {
+					Object fieldValue = theFields[i].get(null);
+					Object expectedValue = thePublicStatics.get(fieldName);
+					if (expectedValue == null) {
+						fail("Field " + fieldName + " missing!");
+					} // end
+					assertEquals("Field " + fieldName + " value mismatch: ",
+							expectedValue, fieldValue);
+					assertEquals("Field " + fieldName + " modifier mismatch: ",
+							requiredModifier, theMods);
+					countPublicStatics++;
+				} catch (IllegalAccessException e) {
+					fail("Illegal access to Field " + fieldName);
+				} // end try
+			} // end if
+		} // end for
+
+	} // end method testPublicStatics
+
+} // end class ConnectionTest
+

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/ConnectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java?rev=436644&r1=436643&r2=436644&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java Thu Aug 24 21:29:34 2006
@@ -1,439 +1,439 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.sql.tests.java.sql;
-
-import java.sql.DataTruncation;
-
-import junit.framework.TestCase;
-
-public class DataTruncationTest extends TestCase {
-
-	/*
-	 * ConstructorTest
-	 */
-	public void testDataTruncationintbooleanbooleanintint() {
-
-		int[] init1 = { -2147483648, 2147483647, 0, 329751502, 318587557,
-				-1217247045, 329474146 };
-		boolean[] init2 = { false, true, false, false, false, true, false };
-		boolean[] init3 = { false, true, false, false, false, false, true };
-		int[] init4 = { -2147483648, 2147483647, 0, 1761409290, -1331044048,
-				-576231606, 661635011 };
-		int[] init5 = { -2147483648, 2147483647, 0, 540816689, -1890783845,
-				-105552912, -85923935 };
-
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		DataTruncation aDataTruncation;
-		int loopCount = init1.length;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				if (theExceptions[i] != null)
-					assertTrue(false);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testDataTruncationintbooleanbooleanintint
-
-	/*
-	 * Method test for getIndex
-	 */
-	public void testGetIndex() {
-
-		DataTruncation aDataTruncation;
-		int[] init1 = { -2147483648, 2147483647, 0, -2045829673, 1977156911,
-				478985827, 1687271915 };
-		boolean[] init2 = { false, true, false, false, true, true, true };
-		boolean[] init3 = { false, true, false, false, true, true, true };
-		int[] init4 = { -2147483648, 2147483647, 0, -631377748, 21025030,
-				1215194589, 1064137121 };
-		int[] init5 = { -2147483648, 2147483647, 0, -897998505, 997578180,
-				735015866, 264619424 };
-
-		int theReturn;
-		int[] theReturns = init1;
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				theReturn = aDataTruncation.getIndex();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetIndex
-
-	/*
-	 * Method test for getParameter
-	 */
-	public void testGetParameter() {
-
-		DataTruncation aDataTruncation;
-		int[] init1 = { -2147483648, 2147483647, 0, -492314242, 1637665948,
-				-305785075, 258819883 };
-		boolean[] init2 = { false, true, false, true, true, false, true };
-		boolean[] init3 = { false, true, false, false, false, true, true };
-		int[] init4 = { -2147483648, 2147483647, 0, 1134512579, 533874007,
-				1709608139, 990656593 };
-		int[] init5 = { -2147483648, 2147483647, 0, -1566784226, -744009101,
-				-444614454, 356465980 };
-
-		boolean theReturn;
-		boolean[] theReturns = init2;
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				theReturn = aDataTruncation.getParameter();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetParameter
-
-	/*
-	 * Method test for getRead
-	 */
-	public void testGetRead() {
-
-		DataTruncation aDataTruncation;
-		int[] init1 = { -2147483648, 2147483647, 0, 2092420209, -1695764964,
-				1832837995, -80199594 };
-		boolean[] init2 = { false, true, false, false, false, true, true };
-		boolean[] init3 = { false, true, false, false, true, true, false };
-		int[] init4 = { -2147483648, 2147483647, 0, 1762375167, -604897453,
-				1362491587, 1007466498 };
-		int[] init5 = { -2147483648, 2147483647, 0, 1494407222, -1696982311,
-				-940493360, -1777579868 };
-
-		boolean theReturn;
-		boolean[] theReturns = init3;
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				theReturn = aDataTruncation.getRead();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetRead
-
-	/*
-	 * Method test for getDataSize
-	 */
-	public void testGetDataSize() {
-
-		DataTruncation aDataTruncation;
-		int[] init1 = { -2147483648, 2147483647, 0, 1146707040, -2020665632,
-				1268632617, -1595624039 };
-		boolean[] init2 = { false, true, false, true, false, true, true };
-		boolean[] init3 = { false, true, false, true, true, false, false };
-		int[] init4 = { -2147483648, 2147483647, 0, -367493363, 328996907,
-				-1581326731, 835022052 };
-		int[] init5 = { -2147483648, 2147483647, 0, -886134194, 908213800,
-				1123419516, -429606389 };
-
-		int theReturn;
-		int[] theReturns = init4;
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				theReturn = aDataTruncation.getDataSize();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetDataSize
-
-	/*
-	 * Method test for getTransferSize
-	 */
-	public void testGetTransferSize() {
-
-		DataTruncation aDataTruncation;
-		int[] init1 = { -2147483648, 2147483647, 0, 78096124, 1719192600,
-				-1661234694, -1205825753 };
-		boolean[] init2 = { false, true, false, false, true, false, true };
-		boolean[] init3 = { false, true, false, false, false, false, false };
-		int[] init4 = { -2147483648, 2147483647, 0, -493779295, -2042560243,
-				-217347438, 1357818664 };
-		int[] init5 = { -2147483648, 2147483647, 0, -1647009002, -717544563,
-				-1368171905, -918209633 };
-
-		int theReturn;
-		int[] theReturns = init5;
-		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
-				"01004", "01004", "01004" };
-		String state2 = "Data truncation";
-		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
-				state2, state2 };
-		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
-		int[] theFinalStates4 = init1;
-		int[] theFinalStates5 = init4;
-		int[] theFinalStates6 = init5;
-		boolean[] theFinalStates7 = init2;
-		boolean[] theFinalStates8 = init3;
-
-		Exception[] theExceptions = { null, null, null, null, null, null, null };
-
-		int loopCount = 1;
-		for (int i = 0; i < loopCount; i++) {
-			try {
-				aDataTruncation = new DataTruncation(init1[i], init2[i],
-						init3[i], init4[i], init5[i]);
-				theReturn = aDataTruncation.getTransferSize();
-				if (theExceptions[i] != null)
-					fail(i + "Exception missed");
-				assertEquals(i + "Return value mismatch", theReturn,
-						theReturns[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getSQLState(), theFinalStates1[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getMessage(), theFinalStates2[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getErrorCode(), theFinalStates3[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getIndex(), theFinalStates4[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getDataSize(), theFinalStates5[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getTransferSize(), theFinalStates6[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getParameter(), theFinalStates7[i]);
-				assertEquals(i + "  Final state mismatch", aDataTruncation
-						.getRead(), theFinalStates8[i]);
-
-			} catch (Exception e) {
-				if (theExceptions[i] == null)
-					fail(i + "Unexpected exception");
-				assertEquals(i + "Exception mismatch", e.getClass(),
-						theExceptions[i].getClass());
-				assertEquals(i + "Exception mismatch", e.getMessage(),
-						theExceptions[i].getMessage());
-			} // end try
-		} // end for
-
-	} // end method testGetTransferSize
-
-} // end class DataTruncationTest
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.sql.tests.java.sql;
+
+import java.sql.DataTruncation;
+
+import junit.framework.TestCase;
+
+public class DataTruncationTest extends TestCase {
+
+	/*
+	 * ConstructorTest
+	 */
+	public void testDataTruncationintbooleanbooleanintint() {
+
+		int[] init1 = { -2147483648, 2147483647, 0, 329751502, 318587557,
+				-1217247045, 329474146 };
+		boolean[] init2 = { false, true, false, false, false, true, false };
+		boolean[] init3 = { false, true, false, false, false, false, true };
+		int[] init4 = { -2147483648, 2147483647, 0, 1761409290, -1331044048,
+				-576231606, 661635011 };
+		int[] init5 = { -2147483648, 2147483647, 0, 540816689, -1890783845,
+				-105552912, -85923935 };
+
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		DataTruncation aDataTruncation;
+		int loopCount = init1.length;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				if (theExceptions[i] != null)
+					assertTrue(false);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testDataTruncationintbooleanbooleanintint
+
+	/*
+	 * Method test for getIndex
+	 */
+	public void testGetIndex() {
+
+		DataTruncation aDataTruncation;
+		int[] init1 = { -2147483648, 2147483647, 0, -2045829673, 1977156911,
+				478985827, 1687271915 };
+		boolean[] init2 = { false, true, false, false, true, true, true };
+		boolean[] init3 = { false, true, false, false, true, true, true };
+		int[] init4 = { -2147483648, 2147483647, 0, -631377748, 21025030,
+				1215194589, 1064137121 };
+		int[] init5 = { -2147483648, 2147483647, 0, -897998505, 997578180,
+				735015866, 264619424 };
+
+		int theReturn;
+		int[] theReturns = init1;
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				theReturn = aDataTruncation.getIndex();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetIndex
+
+	/*
+	 * Method test for getParameter
+	 */
+	public void testGetParameter() {
+
+		DataTruncation aDataTruncation;
+		int[] init1 = { -2147483648, 2147483647, 0, -492314242, 1637665948,
+				-305785075, 258819883 };
+		boolean[] init2 = { false, true, false, true, true, false, true };
+		boolean[] init3 = { false, true, false, false, false, true, true };
+		int[] init4 = { -2147483648, 2147483647, 0, 1134512579, 533874007,
+				1709608139, 990656593 };
+		int[] init5 = { -2147483648, 2147483647, 0, -1566784226, -744009101,
+				-444614454, 356465980 };
+
+		boolean theReturn;
+		boolean[] theReturns = init2;
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				theReturn = aDataTruncation.getParameter();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetParameter
+
+	/*
+	 * Method test for getRead
+	 */
+	public void testGetRead() {
+
+		DataTruncation aDataTruncation;
+		int[] init1 = { -2147483648, 2147483647, 0, 2092420209, -1695764964,
+				1832837995, -80199594 };
+		boolean[] init2 = { false, true, false, false, false, true, true };
+		boolean[] init3 = { false, true, false, false, true, true, false };
+		int[] init4 = { -2147483648, 2147483647, 0, 1762375167, -604897453,
+				1362491587, 1007466498 };
+		int[] init5 = { -2147483648, 2147483647, 0, 1494407222, -1696982311,
+				-940493360, -1777579868 };
+
+		boolean theReturn;
+		boolean[] theReturns = init3;
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				theReturn = aDataTruncation.getRead();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetRead
+
+	/*
+	 * Method test for getDataSize
+	 */
+	public void testGetDataSize() {
+
+		DataTruncation aDataTruncation;
+		int[] init1 = { -2147483648, 2147483647, 0, 1146707040, -2020665632,
+				1268632617, -1595624039 };
+		boolean[] init2 = { false, true, false, true, false, true, true };
+		boolean[] init3 = { false, true, false, true, true, false, false };
+		int[] init4 = { -2147483648, 2147483647, 0, -367493363, 328996907,
+				-1581326731, 835022052 };
+		int[] init5 = { -2147483648, 2147483647, 0, -886134194, 908213800,
+				1123419516, -429606389 };
+
+		int theReturn;
+		int[] theReturns = init4;
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				theReturn = aDataTruncation.getDataSize();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetDataSize
+
+	/*
+	 * Method test for getTransferSize
+	 */
+	public void testGetTransferSize() {
+
+		DataTruncation aDataTruncation;
+		int[] init1 = { -2147483648, 2147483647, 0, 78096124, 1719192600,
+				-1661234694, -1205825753 };
+		boolean[] init2 = { false, true, false, false, true, false, true };
+		boolean[] init3 = { false, true, false, false, false, false, false };
+		int[] init4 = { -2147483648, 2147483647, 0, -493779295, -2042560243,
+				-217347438, 1357818664 };
+		int[] init5 = { -2147483648, 2147483647, 0, -1647009002, -717544563,
+				-1368171905, -918209633 };
+
+		int theReturn;
+		int[] theReturns = init5;
+		String[] theFinalStates1 = { "01004", "01004", "01004", "01004",
+				"01004", "01004", "01004" };
+		String state2 = "Data truncation";
+		String[] theFinalStates2 = { state2, state2, state2, state2, state2,
+				state2, state2 };
+		int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
+		int[] theFinalStates4 = init1;
+		int[] theFinalStates5 = init4;
+		int[] theFinalStates6 = init5;
+		boolean[] theFinalStates7 = init2;
+		boolean[] theFinalStates8 = init3;
+
+		Exception[] theExceptions = { null, null, null, null, null, null, null };
+
+		int loopCount = 1;
+		for (int i = 0; i < loopCount; i++) {
+			try {
+				aDataTruncation = new DataTruncation(init1[i], init2[i],
+						init3[i], init4[i], init5[i]);
+				theReturn = aDataTruncation.getTransferSize();
+				if (theExceptions[i] != null)
+					fail(i + "Exception missed");
+				assertEquals(i + "Return value mismatch", theReturn,
+						theReturns[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getSQLState(), theFinalStates1[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getMessage(), theFinalStates2[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getErrorCode(), theFinalStates3[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getIndex(), theFinalStates4[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getDataSize(), theFinalStates5[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getTransferSize(), theFinalStates6[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getParameter(), theFinalStates7[i]);
+				assertEquals(i + "  Final state mismatch", aDataTruncation
+						.getRead(), theFinalStates8[i]);
+
+			} catch (Exception e) {
+				if (theExceptions[i] == null)
+					fail(i + "Unexpected exception");
+				assertEquals(i + "Exception mismatch", e.getClass(),
+						theExceptions[i].getClass());
+				assertEquals(i + "Exception mismatch", e.getMessage(),
+						theExceptions[i].getMessage());
+			} // end try
+		} // end for
+
+	} // end method testGetTransferSize
+
+} // end class DataTruncationTest

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/DataTruncationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message