You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by py...@apache.org on 2007/07/17 08:31:04 UTC
svn commit: r556825 [9/10] - in
/harmony/enhanced/classlib/branches/java6/modules:
archive/src/main/java/java/util/jar/ archive/src/main/java/java/util/zip/
archive/src/main/java/org/apache/harmony/archive/internal/nls/
archive/src/main/java/org/apache...
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockBlob.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockBlob.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockBlob.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockBlob.java Mon Jul 16 23:30:22 2007
@@ -62,7 +62,8 @@
public void free() throws SQLException {
}
- public InputStream getBinaryStream(long pos, long length) throws SQLException {
+ public InputStream getBinaryStream(long pos, long length)
+ throws SQLException {
return null;
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockClob.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockClob.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockClob.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/MockClob.java Mon Jul 16 23:30:22 2007
@@ -28,7 +28,9 @@
public class MockClob implements Clob {
public Reader characterStreamReader = new StringReader("xys");
- public InputStream asciiInputStream = new ByteArrayInputStream("hello".getBytes());
+
+ public InputStream asciiInputStream = new ByteArrayInputStream("hello"
+ .getBytes());
public InputStream getAsciiStream() throws SQLException {
return asciiInputStream;
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/RowSetMetaDataImplTest.java Mon Jul 16 23:30:22 2007
@@ -1,6 +1,5 @@
package org.apache.harmony.sql.tests.javax.sql.rowset;
-
import java.io.Serializable;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
@@ -14,16 +13,16 @@
import junit.framework.TestCase;
/**
- * Test class for javax.sql.rowset.RowSetMetaDataImpl
- *
+ * Test class for javax.sql.rowset.RowSetMetaDataImpl
+ *
*/
public class RowSetMetaDataImplTest extends TestCase {
-
+
private static RowSetMetaDataImpl metaDataImpl = null;
-
+
/**
- * This comparator is designed for RowSetMetaDataImpl objects whose
- * colCount has already been set. Other objects may fail when using it.
+ * This comparator is designed for RowSetMetaDataImpl objects whose colCount
+ * has already been set. Other objects may fail when using it.
*/
private final static SerializableAssert ROWSET_METADATA_COMPARATOR = new SerializableAssert() {
@@ -32,23 +31,24 @@
try {
RowSetMetaDataImpl initialImpl = (RowSetMetaDataImpl) initial;
RowSetMetaDataImpl deserializedImpl = (RowSetMetaDataImpl) deserialized;
-
- Assert.assertEquals(initialImpl.getColumnCount(), deserializedImpl.getColumnCount());
- Assert.assertEquals(initialImpl.getColumnType(1), deserializedImpl.getColumnType(1));
+
+ Assert.assertEquals(initialImpl.getColumnCount(),
+ deserializedImpl.getColumnCount());
+ Assert.assertEquals(initialImpl.getColumnType(1),
+ deserializedImpl.getColumnType(1));
} catch (SQLException e) {
fail();
}
}
};
-
+
/**
* @tests javax.sql.rowset.RowSetMetaDataImpl#RowSetMetaDataImpl()
*/
public void test_Constructor() {
- assertNotNull(metaDataImpl);
+ assertNotNull(metaDataImpl);
}
-
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnCount()}
*/
@@ -57,17 +57,17 @@
try {
metaDataImpl.isAutoIncrement(1);
fail("should throw SQLException");
- } catch (SQLException e) {
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(4);
assertEquals(4, metaDataImpl.getColumnCount());
assertFalse(metaDataImpl.isAutoIncrement(4));
-
+
metaDataImpl.setColumnCount(Integer.MAX_VALUE);
assertFalse(metaDataImpl.isAutoIncrement(4));
- //assertEquals(Integer.MAX_VALUE, metaDataImpl.getColumnCount());
+ // assertEquals(Integer.MAX_VALUE, metaDataImpl.getColumnCount());
// RI throws ArrayIndexOutOfBoundsException here, which is a RI's bug
try {
metaDataImpl.isAutoIncrement(5);
@@ -76,25 +76,25 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnCount(int)}
*/
public void test_setColumnCountI() throws SQLException {
try {
metaDataImpl.setColumnCount(-1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.setColumnCount(0);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(18);
assertEquals(18, metaDataImpl.getColumnCount());
metaDataImpl.setAutoIncrement(1, true);
@@ -104,47 +104,47 @@
assertEquals(19, metaDataImpl.getColumnCount());
assertFalse(metaDataImpl.isAutoIncrement(1));
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getCatalogName(int)}
*/
public void test_getCatalogNameI() throws SQLException {
try {
metaDataImpl.getCatalogName(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertEquals("", metaDataImpl.getCatalogName(1));
metaDataImpl.setCatalogName(1, "catalog");
assertEquals("catalog", metaDataImpl.getCatalogName(1));
metaDataImpl.setCatalogName(1, null);
assertEquals("", metaDataImpl.getCatalogName(1));
-
+
try {
metaDataImpl.getCatalogName(Integer.MIN_VALUE);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnClassName(int)}
*/
public void test_getColumnClassNameI() throws SQLException {
try {
metaDataImpl.getColumnClassName(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(12);
assertEquals("java.lang.String", metaDataImpl.getColumnClassName(12));
-
+
metaDataImpl.setColumnTypeName(12, null);
assertEquals("java.lang.String", metaDataImpl.getColumnClassName(12));
metaDataImpl.setColumnType(12, Types.BLOB);
@@ -156,234 +156,235 @@
metaDataImpl.setColumnType(12, Types.BIT);
assertEquals("java.lang.Boolean", metaDataImpl.getColumnClassName(12));
metaDataImpl.setColumnType(12, Types.DECIMAL);
- assertEquals("java.math.BigDecimal", metaDataImpl.getColumnClassName(12));
+ assertEquals("java.math.BigDecimal", metaDataImpl
+ .getColumnClassName(12));
metaDataImpl.setColumnType(12, Types.TINYINT);
assertEquals("java.lang.Byte", metaDataImpl.getColumnClassName(12));
-
+
try {
metaDataImpl.getColumnClassName(0);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnDisplaySize(int)}
*/
public void test_getColumnDisplaySizeI() throws SQLException {
try {
metaDataImpl.getColumnDisplaySize(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertEquals(0, metaDataImpl.getColumnDisplaySize(1));
metaDataImpl.setColumnDisplaySize(1, 4);
assertEquals(4, metaDataImpl.getColumnDisplaySize(1));
-
+
try {
metaDataImpl.getColumnDisplaySize(-32);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnLabel(int)}
*/
public void test_getColumnLabelI() throws SQLException {
try {
metaDataImpl.getColumnLabel(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(3);
assertNull(metaDataImpl.getColumnLabel(1));
metaDataImpl.setColumnLabel(1, null);
assertEquals("", metaDataImpl.getColumnLabel(1));
metaDataImpl.setColumnLabel(1, "err");
assertEquals("err", metaDataImpl.getColumnLabel(1));
-
+
try {
metaDataImpl.getColumnLabel(11);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnName(int)}
*/
public void test_getColumnNameI() throws SQLException {
try {
metaDataImpl.getColumnName(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(13);
assertNull(metaDataImpl.getColumnName(12));
metaDataImpl.setColumnName(12, null);
assertEquals("", metaDataImpl.getColumnName(12));
metaDataImpl.setColumnName(12, "ColumnName");
assertEquals("ColumnName", metaDataImpl.getColumnName(12));
-
+
try {
metaDataImpl.getColumnName(0);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnType(int)}
*/
public void test_getColumnTypeI() throws SQLException {
try {
metaDataImpl.getColumnType(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(13);
metaDataImpl.setColumnType(13, Types.ARRAY);
assertEquals(Types.ARRAY, metaDataImpl.getColumnType(13));
-
+
try {
metaDataImpl.getColumnType(14);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getColumnTypeName(int)}
*/
public void test_getColumnTypeNameI() throws SQLException {
try {
metaDataImpl.getColumnTypeName(223);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(21);
metaDataImpl.setColumnType(14, Types.BIGINT);
metaDataImpl.setColumnTypeName(14, null);
assertEquals("", metaDataImpl.getColumnTypeName(14));
metaDataImpl.setColumnTypeName(14, "haha");
assertEquals("haha", metaDataImpl.getColumnTypeName(14));
-
+
try {
metaDataImpl.getColumnTypeName(22);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getPrecision(int)}
*/
public void test_getPrecisionI() throws SQLException {
try {
metaDataImpl.getPrecision(2);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
assertEquals(0, metaDataImpl.getPrecision(1));
metaDataImpl.setPrecision(1, Integer.MAX_VALUE);
assertEquals(Integer.MAX_VALUE, metaDataImpl.getPrecision(1));
-
+
try {
metaDataImpl.getPrecision(3);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getSchemaName(int)}
*/
public void test_getScaleI() throws SQLException {
try {
metaDataImpl.getScale(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertEquals(0, metaDataImpl.getScale(2));
metaDataImpl.setScale(2, Integer.MAX_VALUE);
assertEquals(Integer.MAX_VALUE, metaDataImpl.getScale(2));
-
+
try {
metaDataImpl.getScale(3);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getSchemaName(int)}
*/
public void test_getSchemaNameI() throws SQLException {
try {
metaDataImpl.getSchemaName(352);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(67);
metaDataImpl.setSchemaName(67, null);
assertEquals("", metaDataImpl.getSchemaName(67));
metaDataImpl.setSchemaName(67, "a \u0053");
assertEquals("a S", metaDataImpl.getSchemaName(67));
-
+
try {
metaDataImpl.getSchemaName(Integer.MIN_VALUE);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#getTableName(int)}
*/
public void test_getTableNameI() throws SQLException {
try {
metaDataImpl.getTableName(2);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertEquals("", metaDataImpl.getTableName(1));
assertEquals("", metaDataImpl.getTableName(2));
metaDataImpl.setTableName(1, "tableName");
assertEquals("tableName", metaDataImpl.getTableName(1));
assertEquals("", metaDataImpl.getTableName(2));
-
+
try {
metaDataImpl.getTableName(Integer.MIN_VALUE);
fail("should throw SQLException");
@@ -391,39 +392,39 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isAutoIncrement(int)}
*/
public void test_isAutoIncrementI() throws SQLException {
try {
metaDataImpl.isAutoIncrement(1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
- metaDataImpl.setColumnCount(3);
+
+ metaDataImpl.setColumnCount(3);
assertFalse(metaDataImpl.isAutoIncrement(1));
assertFalse(metaDataImpl.isAutoIncrement(3));
metaDataImpl.setAutoIncrement(3, true);
assertTrue(metaDataImpl.isAutoIncrement(3));
-
+
try {
metaDataImpl.isAutoIncrement(-1);
- fail ("should throw SQLException");
- } catch (SQLException e) {
+ fail("should throw SQLException");
+ } catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.isAutoIncrement(4);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isCaseSensitive(int)}
*/
@@ -431,27 +432,27 @@
metaDataImpl.setColumnCount(5);
assertFalse(metaDataImpl.isCaseSensitive(2));
assertFalse(metaDataImpl.isCaseSensitive(5));
-
+
metaDataImpl.setCaseSensitive(2, true);
assertTrue(metaDataImpl.isCaseSensitive(2));
metaDataImpl.setCaseSensitive(2, false);
assertFalse(metaDataImpl.isCaseSensitive(2));
-
+
try {
metaDataImpl.isCaseSensitive(0);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.isCaseSensitive(6);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isCurrency(int)}
*/
@@ -462,25 +463,25 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(5);
assertFalse(metaDataImpl.isCurrency(1));
metaDataImpl.setCurrency(1, true);
assertTrue(metaDataImpl.isCurrency(1));
metaDataImpl.setCurrency(1, true);
assertTrue(metaDataImpl.isCurrency(1));
-
+
try {
metaDataImpl.isCurrency(0);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(6);
assertFalse(metaDataImpl.isCurrency(1));
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isNullable(int)}
*/
@@ -491,12 +492,14 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
- assertEquals(ResultSetMetaData.columnNoNulls, metaDataImpl.isNullable(1));
+ assertEquals(ResultSetMetaData.columnNoNulls, metaDataImpl
+ .isNullable(1));
metaDataImpl.setNullable(1, ResultSetMetaData.columnNullableUnknown);
- assertEquals(ResultSetMetaData.columnNullableUnknown, metaDataImpl.isNullable(1));
-
+ assertEquals(ResultSetMetaData.columnNullableUnknown, metaDataImpl
+ .isNullable(1));
+
try {
metaDataImpl.isNullable(3);
fail("should throw SQLException");
@@ -504,7 +507,7 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isReadOnly(int)}
*/
@@ -515,12 +518,12 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(11);
assertFalse(metaDataImpl.isReadOnly(1));
assertFalse(metaDataImpl.isReadOnly(11));
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isWritable(int)}
*/
@@ -531,13 +534,13 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(3);
assertTrue(metaDataImpl.isWritable(1));
-
+
assertTrue(metaDataImpl.isWritable(3));
assertFalse(metaDataImpl.isReadOnly(3));
-
+
try {
metaDataImpl.isWritable(4);
fail("should throw SQLException");
@@ -545,7 +548,7 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isDefinitelyWritable(int)}
*/
@@ -553,7 +556,7 @@
metaDataImpl.setColumnCount(2);
assertTrue(metaDataImpl.isDefinitelyWritable(1));
assertTrue(metaDataImpl.isDefinitelyWritable(2));
-
+
// RI fails here, which does not comply to the spec
try {
metaDataImpl.isDefinitelyWritable(-1);
@@ -562,7 +565,7 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isSearchable(int)}
*/
@@ -573,22 +576,22 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
assertFalse(metaDataImpl.isSearchable(1));
metaDataImpl.setSearchable(1, true);
assertTrue(metaDataImpl.isSearchable(1));
metaDataImpl.setSearchable(1, false);
assertFalse(metaDataImpl.isSearchable(1));
-
+
try {
metaDataImpl.isSearchable(2);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#isSigned(int)}
*/
@@ -599,59 +602,59 @@
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(35);
assertFalse(metaDataImpl.isSigned(35));
metaDataImpl.setSigned(35, true);
assertTrue(metaDataImpl.isSigned(35));
metaDataImpl.setSigned(35, false);
assertFalse(metaDataImpl.isSigned(35));
-
+
try {
metaDataImpl.isSigned(36);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setAutoIncrement(int, boolean)}
*/
public void test_setAutoIncrementIZ() throws SQLException {
try {
metaDataImpl.setAutoIncrement(1, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertFalse(metaDataImpl.isAutoIncrement(1));
metaDataImpl.setAutoIncrement(1, false);
assertFalse(metaDataImpl.isAutoIncrement(1));
metaDataImpl.setAutoIncrement(1, true);
assertTrue(metaDataImpl.isAutoIncrement(1));
-
+
try {
metaDataImpl.setAutoIncrement(-1, false);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setCaseSensitive(int, boolean)}
*/
public void test_setCaseSensitiveIZ() throws SQLException {
try {
metaDataImpl.setCaseSensitive(2, false);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(9);
assertFalse(metaDataImpl.isCaseSensitive(9));
metaDataImpl.setCaseSensitive(9, false);
@@ -660,165 +663,165 @@
assertTrue(metaDataImpl.isCaseSensitive(9));
metaDataImpl.setAutoIncrement(9, false);
assertTrue(metaDataImpl.isCaseSensitive(9));
-
+
try {
metaDataImpl.setCaseSensitive(10, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setCatalogName(int, String)}
*/
public void test_setCatalogNameILjava_lang_String() throws SQLException {
try {
metaDataImpl.setCatalogName(1, "test");
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
metaDataImpl.setCatalogName(1, "AbC");
assertEquals("AbC", metaDataImpl.getCatalogName(1));
metaDataImpl.setCatalogName(1, null);
assertEquals("", metaDataImpl.getCatalogName(1));
-
+
try {
metaDataImpl.setCatalogName(10, null);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnDisplaySize(int, int)}
*/
public void test_setColumnDisplaySizeII() throws SQLException {
try {
metaDataImpl.setColumnDisplaySize(1, 2);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
assertEquals(0, metaDataImpl.getColumnDisplaySize(1));
metaDataImpl.setColumnDisplaySize(1, Integer.MAX_VALUE);
assertEquals(Integer.MAX_VALUE, metaDataImpl.getColumnDisplaySize(1));
-
+
try {
metaDataImpl.setColumnDisplaySize(2, 0);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.setColumnDisplaySize(2, Integer.MIN_VALUE);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnName(int, String)}
*/
public void test_setColumnNameILjava_lang_String() throws SQLException {
try {
metaDataImpl.setColumnName(1, null);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(4);
assertNull(metaDataImpl.getColumnName(1));
metaDataImpl.setColumnName(1, "ate dsW");
assertEquals("ate dsW", metaDataImpl.getColumnName(1));
metaDataImpl.setColumnName(1, null);
assertEquals("", metaDataImpl.getColumnName(1));
-
+
try {
metaDataImpl.setColumnName(5, "exception");
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnLabel(int, String)}
*/
public void test_setColumnLabelILjava_lang_String() throws SQLException {
try {
metaDataImpl.setColumnLabel(1, null);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(3);
assertNull(metaDataImpl.getColumnLabel(3));
metaDataImpl.setColumnLabel(3, null);
assertEquals("", metaDataImpl.getColumnLabel(3));
-
+
try {
metaDataImpl.setColumnLabel(4, "exception");
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnType(int, int)}
*/
public void test_setColumnTypeII() throws SQLException {
- try {
- metaDataImpl.setColumnType(1, Types.BIGINT);
- fail ("should throw SQLException");
- } catch (SQLException e) {
- // expected
- }
-
- metaDataImpl.setColumnCount(2);
- assertEquals(0, metaDataImpl.getColumnType(1));
- metaDataImpl.setColumnType(1, Types.CLOB);
- assertEquals(Types.CLOB, metaDataImpl.getColumnType(1));
- metaDataImpl.setColumnType(1, Types.BOOLEAN);
- assertEquals(Types.BOOLEAN, metaDataImpl.getColumnType(1));
-
- try {
- metaDataImpl.setColumnType(1, 66);
- fail ("should throw SQLException");
- } catch (SQLException e) {
- // expected
- }
-
- try {
- metaDataImpl.setColumnType(3, 58);
- fail ("should throw SQLException");
- } catch (SQLException e) {
- // expected
- }
- }
-
+ try {
+ metaDataImpl.setColumnType(1, Types.BIGINT);
+ fail("should throw SQLException");
+ } catch (SQLException e) {
+ // expected
+ }
+
+ metaDataImpl.setColumnCount(2);
+ assertEquals(0, metaDataImpl.getColumnType(1));
+ metaDataImpl.setColumnType(1, Types.CLOB);
+ assertEquals(Types.CLOB, metaDataImpl.getColumnType(1));
+ metaDataImpl.setColumnType(1, Types.BOOLEAN);
+ assertEquals(Types.BOOLEAN, metaDataImpl.getColumnType(1));
+
+ try {
+ metaDataImpl.setColumnType(1, 66);
+ fail("should throw SQLException");
+ } catch (SQLException e) {
+ // expected
+ }
+
+ try {
+ metaDataImpl.setColumnType(3, 58);
+ fail("should throw SQLException");
+ } catch (SQLException e) {
+ // expected
+ }
+ }
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setColumnTypeName(int, String)}
*/
public void test_setColumnTypeNameILjava_lang_String() throws SQLException {
try {
metaDataImpl.setColumnTypeName(1, "aa");
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
assertNull(metaDataImpl.getColumnTypeName(2));
metaDataImpl.setColumnTypeName(2, null);
@@ -828,212 +831,214 @@
metaDataImpl.setColumnTypeName(2, "java.lang.String");
assertEquals(0, metaDataImpl.getColumnType(2));
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setCurrency(int, boolean)}
*/
public void test_setCurrencyIZ() throws SQLException {
try {
metaDataImpl.setCurrency(12, false);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(7);
assertFalse(metaDataImpl.isCurrency(4));
metaDataImpl.setCurrency(4, false);
assertFalse(metaDataImpl.isCurrency(4));
metaDataImpl.setCurrency(4, true);
assertTrue(metaDataImpl.isCurrency(4));
-
+
try {
metaDataImpl.setCurrency(8, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setNullable(int, int)}
*/
public void test_setNullableII() throws SQLException {
try {
metaDataImpl.setNullable(21, 1);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
assertEquals(0, metaDataImpl.isNullable(1));
metaDataImpl.setNullable(1, ResultSetMetaData.columnNullable);
- assertEquals(ResultSetMetaData.columnNullable, metaDataImpl.isNullable(1));
-
+ assertEquals(ResultSetMetaData.columnNullable, metaDataImpl
+ .isNullable(1));
+
try {
- metaDataImpl.setNullable(2, ResultSetMetaData.columnNullableUnknown);
- fail ("should throw SQLException");
+ metaDataImpl
+ .setNullable(2, ResultSetMetaData.columnNullableUnknown);
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.setNullable(2, 3);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setPrecision(int, int)}
*/
public void test_setPrecisionII() throws SQLException {
try {
metaDataImpl.setPrecision(12, 1);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
metaDataImpl.setPrecision(1, 0);
assertEquals(0, metaDataImpl.getPrecision(1));
-
+
try {
metaDataImpl.setPrecision(12, Integer.MIN_VALUE);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setScale(int, int)}
*/
public void test_setScaleII() throws SQLException {
try {
metaDataImpl.setScale(34, 5);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(1);
metaDataImpl.setScale(1, 252);
assertEquals(252, metaDataImpl.getScale(1));
-
+
try {
metaDataImpl.setScale(1, -23);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
metaDataImpl.setScale(2, Integer.MIN_VALUE);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setSchemaName(int, String)}
*/
public void test_setSchemaNameILjava_lang_String() throws SQLException {
try {
metaDataImpl.setSchemaName(-12, "asw");
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(7);
assertEquals("", metaDataImpl.getSchemaName(3));
metaDataImpl.setSchemaName(3, "schema name");
assertEquals("schema name", metaDataImpl.getSchemaName(3));
metaDataImpl.setSchemaName(3, null);
assertEquals("", metaDataImpl.getSchemaName(3));
-
+
try {
metaDataImpl.setSchemaName(Integer.MIN_VALUE, null);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setSearchable(int, boolean)}
*/
public void test_setSearchableIZ() throws SQLException {
try {
metaDataImpl.setSearchable(-22, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(8);
assertFalse(metaDataImpl.isSearchable(2));
metaDataImpl.setSearchable(2, true);
assertTrue(metaDataImpl.isSearchable(2));
metaDataImpl.setSearchable(2, false);
- assertFalse(metaDataImpl.isSearchable(2));
-
+ assertFalse(metaDataImpl.isSearchable(2));
+
try {
metaDataImpl.setSearchable(Integer.MIN_VALUE, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setSigned(int, boolean)}
*/
public void test_setSignedIZ() throws SQLException {
try {
metaDataImpl.setSigned(34, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(12);
assertFalse(metaDataImpl.isSigned(12));
metaDataImpl.setSigned(12, true);
assertTrue(metaDataImpl.isSigned(12));
metaDataImpl.setSigned(12, false);
- assertFalse(metaDataImpl.isSigned(12));
-
+ assertFalse(metaDataImpl.isSigned(12));
+
try {
metaDataImpl.setSigned(0, true);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.RowSetMetaDataImpl#setTableName(int, String)}
*/
public void test_setTableNameILjava_lang_String() throws SQLException {
try {
metaDataImpl.setTableName(34, null);
- fail ("should throw SQLException");
+ fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
metaDataImpl.setColumnCount(2);
metaDataImpl.setTableName(2, "test");
assertEquals("test", metaDataImpl.getTableName(2));
metaDataImpl.setTableName(2, null);
assertEquals("", metaDataImpl.getTableName(2));
-
+
try {
metaDataImpl.setTableName(-3, null);
fail("should throw SQLException");
@@ -1041,17 +1046,17 @@
// expected
}
}
-
+
/**
* @tests serialization/deserialization.
*/
public void test_serialization_self() throws Exception {
- RowSetMetaDataImpl impl = new RowSetMetaDataImpl();
- impl.setColumnCount(1);
- impl.setColumnType(1, Types.CHAR);
- SerializationTest.verifySelf(impl, ROWSET_METADATA_COMPARATOR);
+ RowSetMetaDataImpl impl = new RowSetMetaDataImpl();
+ impl.setColumnCount(1);
+ impl.setColumnType(1, Types.CHAR);
+ SerializationTest.verifySelf(impl, ROWSET_METADATA_COMPARATOR);
}
-
+
/**
* @tests serialization/deserialization compatibility with RI.
*/
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLInputImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLInputImplTest.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLInputImplTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLInputImplTest.java Mon Jul 16 23:30:22 2007
@@ -51,27 +51,26 @@
public class SQLInputImplTest extends TestCase {
-
/**
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#SQLInputImpl(Object[], Map)}
*/
@SuppressWarnings("unchecked")
public void test_Constructor() {
-
+
try {
new SQLInputImpl(null, new HashMap());
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
new SQLInputImpl(null, null);
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
new SQLInputImpl(new Object[0], null);
fail("should throw SQLException");
@@ -79,24 +78,25 @@
// expected
}
}
-
+
/**
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readArray()}
*/
public void testReadArray() throws SQLException {
Array array = new MockArray();
- Object[] attributes = new Object[] {array};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { array };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(array, impl.readArray());
-
+
try {
impl.readArray();
fail("should throw SQLException");
- } catch (SQLException e) {
+ } catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readArray());
}
@@ -106,18 +106,19 @@
*/
public void testReadAsciiStream() throws SQLException {
InputStream stream = new ByteArrayInputStream("abc".getBytes());
- Object[] attributes = new Object[] {stream};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { stream };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(stream, impl.readAsciiStream());
-
+
try {
impl.readAsciiStream();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readAsciiStream());
}
@@ -127,18 +128,19 @@
*/
public void testReadBigDecimal() throws SQLException {
BigDecimal bd = new BigDecimal("12.5");
- Object[] attributes = new Object[] {bd};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { bd };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(bd, impl.readBigDecimal());
-
+
try {
impl.readBigDecimal();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readBigDecimal());
}
@@ -148,11 +150,12 @@
*/
public void testReadBinaryStream() throws SQLException {
InputStream stream = new ByteArrayInputStream("abc".getBytes());
- Object[] attributes = new Object[] {stream};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { stream };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(stream, impl.readBinaryStream());
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readBinaryStream());
}
@@ -162,18 +165,19 @@
*/
public void testReadBlob() throws SQLException {
Blob blob = new MockBlob();
- Object[] attributes = new Object[] {blob};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { blob };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(blob, impl.readBlob());
-
+
try {
impl.readBlob();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readBlob());
}
@@ -182,18 +186,19 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readBoolean()}
*/
public void testReadBoolean() throws SQLException {
- Object[] attributes = new Object[] {Boolean.TRUE};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { Boolean.TRUE };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(true, impl.readBoolean());
-
+
try {
impl.readBoolean();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertFalse(impl.readBoolean());
}
@@ -202,39 +207,41 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readByte()}
*/
public void testReadByte() throws SQLException {
- Object[] attributes = new Object[] {Byte.valueOf("3")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((byte)3, impl.readByte());
-
+ Object[] attributes = new Object[] { Byte.valueOf("3") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
+ assertEquals((byte) 3, impl.readByte());
+
try {
impl.readByte();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((byte)0, impl.readByte());
+ assertEquals((byte) 0, impl.readByte());
}
/**
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readBytes()}
*/
public void testReadBytes() throws SQLException {
- byte[] bytes = new byte[] {1, 2, 3};
- Object[] attributes = new Object[] {bytes};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ byte[] bytes = new byte[] { 1, 2, 3 };
+ Object[] attributes = new Object[] { bytes };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(bytes, impl.readBytes());
-
+
try {
impl.readBytes();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readBytes());
}
@@ -244,18 +251,19 @@
*/
public void testReadCharacterStream() throws SQLException {
Reader stream = new StringReader("abc");
- Object[] attributes = new Object[] {stream};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { stream };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(stream, impl.readCharacterStream());
-
+
try {
impl.readCharacterStream();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readCharacterStream());
}
@@ -265,18 +273,19 @@
*/
public void testReadClob() throws SQLException {
Clob clob = new MockClob();
- Object[] attributes = new Object[] {clob};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { clob };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(clob, impl.readClob());
-
+
try {
impl.readClob();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readClob());
}
@@ -286,18 +295,19 @@
*/
public void testReadDate() throws SQLException {
Date date = new Date(12);
- Object[] attributes = new Object[] {date};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { date };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(date, impl.readDate());
-
+
try {
impl.readDate();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readDate());
}
@@ -306,18 +316,19 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readDouble()}
*/
public void testReadDouble() throws SQLException {
- Object[] attributes = new Object[] {Double.valueOf("3")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((double)3, impl.readDouble());
-
+ Object[] attributes = new Object[] { Double.valueOf("3") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
+ assertEquals((double) 3, impl.readDouble());
+
try {
impl.readDouble();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertEquals(0, impl.readDouble(), 0);
}
@@ -326,18 +337,19 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readFloat()}
*/
public void testReadFloat() throws SQLException {
- Object[] attributes = new Object[] {Float.valueOf("3.5")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((float)3.5, impl.readFloat());
-
+ Object[] attributes = new Object[] { Float.valueOf("3.5") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
+ assertEquals((float) 3.5, impl.readFloat());
+
try {
impl.readFloat();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertEquals(0f, impl.readFloat(), 0);
}
@@ -346,18 +358,19 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readInt()}
*/
public void testReadInt() throws SQLException {
- Object[] attributes = new Object[] {Integer.valueOf("3")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { Integer.valueOf("3") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(3, impl.readInt());
-
+
try {
impl.readInt();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertEquals(0, impl.readInt());
}
@@ -366,18 +379,19 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readLong()}
*/
public void testReadLong() throws SQLException {
- Object[] attributes = new Object[] {Long.valueOf("3")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((long)3, impl.readLong());
-
+ Object[] attributes = new Object[] { Long.valueOf("3") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
+ assertEquals((long) 3, impl.readLong());
+
try {
impl.readLong();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertEquals(0, impl.readLong());
}
@@ -386,26 +400,28 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readObject()}
*/
public void testReadObject() throws SQLException {
- Object[] structAttributes = {"hello", Boolean.TRUE, "abc", Integer.valueOf(99)};
- Struct struct = new MockStruct(structAttributes, "harmonytests.MockSQLData");
+ Object[] structAttributes = { "hello", Boolean.TRUE, "abc",
+ Integer.valueOf(99) };
+ Struct struct = new MockStruct(structAttributes,
+ "harmonytests.MockSQLData");
Struct struct2 = new MockStruct(structAttributes, "not stored name");
HashMap<String, Class<?>> types = new HashMap<String, Class<?>>();
types.put("harmonytests.MockSQLData", MockSQLData.class);
- Object[] attributes = new Object[] {struct, struct2, null, "xyz"};
+ Object[] attributes = new Object[] { struct, struct2, null, "xyz" };
SQLInputImpl impl = new SQLInputImpl(attributes, types);
Object obj = impl.readObject();
assertTrue(obj instanceof MockSQLData);
- MockSQLData sqlData = (MockSQLData)obj;
+ MockSQLData sqlData = (MockSQLData) obj;
assertEquals(structAttributes[0], sqlData.firstAttribute);
assertEquals(structAttributes[1], sqlData.secondAttribute);
assertEquals(structAttributes[2], sqlData.thirdAttribute);
- assertEquals(structAttributes[3], sqlData.fourthAttribute);
+ assertEquals(structAttributes[3], sqlData.fourthAttribute);
Object obj2 = impl.readObject();
assertEquals(struct2, obj2);
Object obj3 = impl.readObject();
assertNull(obj3);
Object obj4 = impl.readObject();
- assertEquals(attributes[3], obj4);
+ assertEquals(attributes[3], obj4);
}
/**
@@ -413,18 +429,19 @@
*/
public void testReadRef() throws SQLException {
Ref ref = new MockRef();
- Object[] attributes = new Object[] {ref};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { ref };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(ref, impl.readRef());
-
+
try {
impl.readRef();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readRef());
}
@@ -433,38 +450,40 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readShort()}
*/
public void testReadShort() throws SQLException {
- Object[] attributes = new Object[] {Short.valueOf("3")};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((short)3, impl.readShort());
-
+ Object[] attributes = new Object[] { Short.valueOf("3") };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
+ assertEquals((short) 3, impl.readShort());
+
try {
impl.readShort();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
- assertEquals((short)0, impl.readShort());
+ assertEquals((short) 0, impl.readShort());
}
/**
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#readString()}
*/
public void testReadString() throws SQLException {
- Object[] attributes = new Object[] {"hello"};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { "hello" };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals("hello", impl.readString());
-
+
try {
impl.readString();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readString());
}
@@ -474,18 +493,19 @@
*/
public void testReadTime() throws SQLException {
Time time = new Time(345);
- Object[] attributes = new Object[] {time};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { time };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(time, impl.readTime());
-
+
try {
impl.readTime();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
- attributes = new Object[] {null};
+
+ attributes = new Object[] { null };
impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
assertNull(impl.readTime());
}
@@ -495,10 +515,11 @@
*/
public void testReadTimestamp() throws SQLException {
Timestamp time = new Timestamp(345);
- Object[] attributes = new Object[] {time};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { time };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertEquals(time, impl.readTimestamp());
-
+
try {
impl.readTimestamp();
fail("should throw SQLException");
@@ -513,15 +534,16 @@
public void testReadURL() throws SQLException, MalformedURLException {
URL url = new URL("http://www.apache.org");
SerialDatalink link = new SerialDatalink(url);
- Object[] attributes = new Object[] {link};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { link };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
try {
impl.readURL();
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
impl.readURL();
fail("should throw SQLException");
@@ -534,8 +556,9 @@
* @tests {@link javax.sql.rowset.serial.SQLInputImpl#wasNull()}
*/
public void testWasNull() throws SQLException {
- Object[] attributes = new Object[] {null, "hello"};
- SQLInputImpl impl = new SQLInputImpl(attributes, new HashMap<String, Class<?>>());
+ Object[] attributes = new Object[] { null, "hello" };
+ SQLInputImpl impl = new SQLInputImpl(attributes,
+ new HashMap<String, Class<?>>());
assertFalse(impl.wasNull());
assertEquals(null, impl.readString());
assertTrue(impl.wasNull());
@@ -551,28 +574,28 @@
assertFalse(impl.wasNull());
}
-
/*
* Mock classes used by both this test and SQLOutputImplTest to test
* readObject and writeObject methods respectively.
*/
-
+
public static class MockStruct implements Struct {
-
+
private String sqlTypeName;
public MockStruct(Object[] attributes, String sqlTypeName) {
this.attributes = attributes;
this.sqlTypeName = sqlTypeName;
}
-
+
Object[] attributes;
public Object[] getAttributes() throws SQLException {
return attributes;
}
- public Object[] getAttributes(Map<String, Class<?>> theMap) throws SQLException {
+ public Object[] getAttributes(Map<String, Class<?>> theMap)
+ throws SQLException {
return attributes;
}
@@ -580,19 +603,23 @@
return sqlTypeName;
}
}
-
+
public static class MockSQLData implements SQLData {
-
+
public String firstAttribute;
+
public Boolean secondAttribute;
+
public String thirdAttribute;
+
public Integer fourthAttribute;
public String getSQLTypeName() throws SQLException {
return "harmonytests.MockSQLData";
}
- public void readSQL(SQLInput stream, String typeName) throws SQLException {
+ public void readSQL(SQLInput stream, String typeName)
+ throws SQLException {
firstAttribute = stream.readString();
secondAttribute = stream.readBoolean();
thirdAttribute = stream.readString();
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLOutputImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLOutputImplTest.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLOutputImplTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SQLOutputImplTest.java Mon Jul 16 23:30:22 2007
@@ -55,31 +55,31 @@
import junit.framework.TestCase;
public class SQLOutputImplTest extends TestCase {
-
+
private static SQLOutputImpl impl;
-
+
private static Vector attr;
-
+
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#SQLOutputImpl(Vector, Map)}
*/
public void test_ConstructorLjava_util_VectorLjava_util_Map() {
assertNotNull(impl);
-
+
try {
new SQLOutputImpl(null, new HashMap());
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
new SQLOutputImpl(null, null);
fail("should throw SQLException");
} catch (SQLException e) {
// expected
}
-
+
try {
new SQLOutputImpl(new Vector(), null);
fail("should throw SQLException");
@@ -96,7 +96,7 @@
impl.writeArray(array);
assertEquals(1, attr.size());
assertTrue(attr.get(0) instanceof SerialArray);
-
+
impl.writeArray(null);
assertNull(attr.get(1));
}
@@ -109,7 +109,7 @@
impl.writeAsciiStream(stream);
assertEquals(1, attr.size());
assertEquals("abc", attr.get(0));
-
+
try {
impl.writeAsciiStream(null);
fail("should throw NullPointerException");
@@ -125,7 +125,7 @@
impl.writeBigDecimal(BigDecimal.ONE);
impl.writeBigDecimal(BigDecimal.ONE);
assertSame(attr.get(0), attr.get(1));
-
+
impl.writeBigDecimal(null);
assertNull(attr.get(2));
}
@@ -133,7 +133,8 @@
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeBinaryStream(InputStream)}
*/
- public void test_writeBinaryStreamLjava_io_InputStream() throws SQLException {
+ public void test_writeBinaryStreamLjava_io_InputStream()
+ throws SQLException {
InputStream stream = new ByteArrayInputStream("abc".getBytes());
impl.writeBinaryStream(stream);
assertEquals(1, attr.size());
@@ -148,7 +149,7 @@
impl.writeBlob(blob);
assertEquals(1, attr.size());
assertTrue(attr.get(0) instanceof SerialBlob);
-
+
impl.writeBlob(null);
assertNull(attr.get(1));
}
@@ -158,13 +159,13 @@
*/
public void test_writeBooleanZ() throws SQLException {
impl.writeBoolean(true);
- assertTrue(((Boolean)attr.get(0)).booleanValue());
-
+ assertTrue(((Boolean) attr.get(0)).booleanValue());
+
impl.writeBoolean(false);
- assertFalse(((Boolean)attr.get(1)).booleanValue());
-
+ assertFalse(((Boolean) attr.get(1)).booleanValue());
+
impl.writeBoolean(true);
- assertTrue(((Boolean)attr.get(2)).booleanValue());
+ assertTrue(((Boolean) attr.get(2)).booleanValue());
}
/**
@@ -172,26 +173,26 @@
*/
public void test_writeByteB() throws SQLException {
assertEquals(0, attr.size());
- impl.writeByte((byte)1);
+ impl.writeByte((byte) 1);
assertEquals(1, attr.size());
- assertEquals(Byte.parseByte("1"), ((Byte)attr.get(0)).byteValue());
-
+ assertEquals(Byte.parseByte("1"), ((Byte) attr.get(0)).byteValue());
+
impl.writeByte((byte) 256);
assertEquals(2, attr.size());
- assertEquals(Byte.parseByte("0"), ((Byte)attr.get(1)).byteValue());
+ assertEquals(Byte.parseByte("0"), ((Byte) attr.get(1)).byteValue());
}
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeBytes(byte[])}
*/
public void test_writeBytes$B() throws SQLException {
- byte[] bytes = new byte[] {4, 5, (byte)256};
+ byte[] bytes = new byte[] { 4, 5, (byte) 256 };
impl.writeBytes(bytes);
assertEquals(1, attr.size());
-
- byte[] attrBytes = (byte[])attr.get(0);
- assertEquals((byte)4, attrBytes[0]);
- assertEquals((byte)0, attrBytes[2]);
+
+ byte[] attrBytes = (byte[]) attr.get(0);
+ assertEquals((byte) 4, attrBytes[0]);
+ assertEquals((byte) 0, attrBytes[2]);
}
/**
@@ -201,7 +202,7 @@
Reader stream = new StringReader("abc");
impl.writeCharacterStream(stream);
assertEquals(1, attr.size());
- assertEquals("abc", attr.get(0));
+ assertEquals("abc", attr.get(0));
}
/**
@@ -232,9 +233,9 @@
attr.add(obj);
impl.writeDouble(3.1415926);
assertEquals(2, attr.size());
-
+
assertEquals(obj, attr.get(0));
- assertEquals(3.1415926, ((Double)attr.get(1)).doubleValue(), 0);
+ assertEquals(3.1415926, ((Double) attr.get(1)).doubleValue(), 0);
}
/**
@@ -254,7 +255,7 @@
*/
public void test_writeIntI() throws SQLException {
impl.writeInt(Integer.MAX_VALUE);
- assertEquals(Integer.MAX_VALUE, ((Integer)attr.get(0)).intValue());
+ assertEquals(Integer.MAX_VALUE, ((Integer) attr.get(0)).intValue());
}
/**
@@ -263,9 +264,9 @@
public void test_writeLongJ() throws SQLException {
impl.writeInt(Integer.MIN_VALUE);
impl.writeLong(Long.MAX_VALUE);
- assertEquals(Long.MAX_VALUE, ((Long)attr.get(1)).longValue());
- }
-
+ assertEquals(Long.MAX_VALUE, ((Long) attr.get(1)).longValue());
+ }
+
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeObject(java.sql.SQLData)}
*/
@@ -285,7 +286,7 @@
assertEquals(sqlData.fourthAttribute, attributes[3]);
assertEquals("harmonytests.MockSQLData", struct.getSQLTypeName());
}
-
+
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeRef(Ref)}
*/
@@ -315,7 +316,7 @@
impl.writeString("def");
assertEquals("def", ((String) attr.get(1)));
}
-
+
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeStruct(java.sql.Struct)}
*/
@@ -336,7 +337,7 @@
Time time = new Time(200);
impl.writeTime(time);
assertEquals(1, attr.size());
- assertEquals(attr.get(0), time);
+ assertEquals(attr.get(0), time);
}
/**
@@ -346,20 +347,21 @@
Timestamp time = new Timestamp(200);
impl.writeTimestamp(time);
assertEquals(1, attr.size());
- assertEquals(attr.get(0), time);
+ assertEquals(attr.get(0), time);
}
/**
* @tests {@link javax.sql.rowset.serial.SQLOutputImpl#writeURL(URL)}
*/
- public void test_writeURLLjava_net_URL() throws MalformedURLException, SQLException {
+ public void test_writeURLLjava_net_URL() throws MalformedURLException,
+ SQLException {
URL url = new URL("http://www.apache.org");
impl.writeURL(url);
assertEquals(1, attr.size());
- assertTrue(attr.get(0) instanceof SerialDatalink);
- assertEquals(url, ((SerialDatalink)attr.get(0)).getDatalink());
-
+ assertTrue(attr.get(0) instanceof SerialDatalink);
+ assertEquals(url, ((SerialDatalink) attr.get(0)).getDatalink());
+
impl.writeURL(null);
assertNull(attr.get(1));
}
Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialArrayTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialArrayTest.java?view=diff&rev=556825&r1=556824&r2=556825
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialArrayTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/sql/rowset/serial/SerialArrayTest.java Mon Jul 16 23:30:22 2007
@@ -42,7 +42,7 @@
Object[] testElements = new Object[4];
Map<String, Class<?>> map = new HashMap<String, Class<?>>();
-
+
Map<String, Class<?>> badmap = new HashMap<String, Class<?>>();
@Override
@@ -52,8 +52,8 @@
testElements[0] = "test1";
testElements[1] = "test2";
testElements[2] = new SQLException();
- testElements[3] = new HashMap();
- sa = new SerialArray(mock);
+ testElements[3] = new HashMap();
+ sa = new SerialArray(mock);
map = new HashMap<String, Class<?>>();
map.put("String", MockStringSQLData.class);
map.put("Object", null);
@@ -72,12 +72,12 @@
fail("should throw SQLException");
} catch (SQLException e) {
// expected
- }
+ }
testElements = new Object[5];
testElements[0] = "test1";
testElements[1] = "test2";
testElements[2] = new SQLException();
- testElements[3] = new HashMap();
+ testElements[3] = new HashMap();
try {
sa = new SerialArray(mock);
fail("should throw NullPointerException");
@@ -93,7 +93,7 @@
// expected
}
}
-
+
public void testConstructor_IntArray() throws SQLException {
mock.basetype = Types.INTEGER;
// OK
@@ -130,10 +130,10 @@
fail("should throw SQLException");
} catch (SQLException e) {
// expected
- }
- //OK
- sa = new SerialArray(mock,map);
- sa = new SerialArray(mock,badmap);
+ }
+ // OK
+ sa = new SerialArray(mock, map);
+ sa = new SerialArray(mock, badmap);
}
public void testGetArray() throws SerialException {
@@ -152,9 +152,9 @@
for (int i = 0; i < testElements.length; i++) {
assertSame(testElements[i], ((Object[]) sa.getArray(badmap))[i]);
}
-
+
}
-
+
public void testGetArrayLongInt() throws SerialException {
for (int i = 0; i < testElements.length; i++) {
assertEquals(testElements[i], ((Object[]) sa.getArray(i, 1))[0]);
@@ -169,7 +169,8 @@
assertSame(testElements[i], ((Object[]) sa.getArray(i, 1, map))[0]);
}
for (int i = 0; i < testElements.length; i++) {
- assertSame(testElements[i], ((Object[]) sa.getArray(i, 1, badmap))[0]);
+ assertSame(testElements[i],
+ ((Object[]) sa.getArray(i, 1, badmap))[0]);
}
mock.returnNull = true;
// elements force deeper copy
@@ -261,9 +262,9 @@
}
class MockArray implements Array {
-
+
public boolean returnNull = false;
-
+
public int basetype = Types.JAVA_OBJECT;
public Object getArray() throws SQLException {
@@ -292,7 +293,7 @@
}
public Object getArray(Map<String, Class<?>> map) throws SQLException {
- if (!returnNull){
+ if (!returnNull) {
return testElements;
} else {
return null;
@@ -420,7 +421,7 @@
return;
}
}
-
+
private static class SQLArray implements java.sql.Array {
Object[] array;
@@ -441,9 +442,10 @@
return java.sql.Types.CLOB;
}
- /** Everything below here is just supplied to satisfy
- the interface and is not part of this testcase.
- **/
+ /**
+ * Everything below here is just supplied to satisfy the interface and
+ * is not part of this testcase.
+ */
public Object getArray(long index, int count) {
return null;