Search in sources :

Example 11 with SerialArray

use of javax.sql.rowset.serial.SerialArray in project jdk8u_jdk by JetBrains.

the class SerialArrayTests method test14.

/*
     * Validate getArray() returns the same Object[] used to create the
     * SerialArray
     */
@Test
public void test14() throws Exception {
    SerialArray sa = new SerialArray(a);
    Object[] o = (Object[]) sa.getArray(map);
    assertTrue(Arrays.equals(o, coffees));
}
Also used : SerialArray(javax.sql.rowset.serial.SerialArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 12 with SerialArray

use of javax.sql.rowset.serial.SerialArray in project jdk8u_jdk by JetBrains.

the class SerialArrayTests method test18.

/*
     * Validate that a SerialArray that is serialized & deserialized is equal to
     * itself
     */
@Test
public void test18() throws Exception {
    SerialArray sa = new SerialArray(a);
    SerialArray sa1 = serializeDeserializeObject(sa);
    ;
    assertTrue(sa.equals(sa1));
}
Also used : SerialArray(javax.sql.rowset.serial.SerialArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 13 with SerialArray

use of javax.sql.rowset.serial.SerialArray in project jdk8u_jdk by JetBrains.

the class SerialArrayTests method test05.

/*
     * Validate a SerialException is thrown when getResultSet() is called
     */
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(1, 1);
}
Also used : SerialArray(javax.sql.rowset.serial.SerialArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 14 with SerialArray

use of javax.sql.rowset.serial.SerialArray in project jdk8u_jdk by JetBrains.

the class SQLOutputImplTests method test04.

/*
     * Validate a Array can be written and returned
     */
@Test(enabled = true)
public void test04() throws Exception {
    Object[] coffees = new Object[] { "Espresso", "Colombian", "French Roast", "Cappuccino" };
    Array a = new StubArray("VARCHAR", coffees);
    outImpl.writeArray(a);
    SerialArray sa = (SerialArray) results.get(0);
    assertTrue(Arrays.equals(coffees, (Object[]) sa.getArray()));
    assertTrue(a.getBaseTypeName().equals(sa.getBaseTypeName()));
}
Also used : StubArray(util.StubArray) Array(java.sql.Array) SerialArray(javax.sql.rowset.serial.SerialArray) SerialArray(javax.sql.rowset.serial.SerialArray) StubArray(util.StubArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 15 with SerialArray

use of javax.sql.rowset.serial.SerialArray in project jdk8u_jdk by JetBrains.

the class SerialArrayTests method test04.

/*
     * Validate a SerialException is thrown when getResultSet() is called
     */
@Test(expectedExceptions = SerialException.class)
public void test04() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(null);
}
Also used : SerialArray(javax.sql.rowset.serial.SerialArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SerialArray (javax.sql.rowset.serial.SerialArray)19 Test (org.testng.annotations.Test)17 BaseTest (util.BaseTest)17 Array (java.sql.Array)2 SerialBlob (javax.sql.rowset.serial.SerialBlob)2 SerialClob (javax.sql.rowset.serial.SerialClob)2 StubArray (util.StubArray)2 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 StringBufferInputStream (java.io.StringBufferInputStream)1 StringReader (java.io.StringReader)1 Blob (java.sql.Blob)1 Clob (java.sql.Clob)1 Ref (java.sql.Ref)1 SQLInputImpl (javax.sql.rowset.serial.SQLInputImpl)1 SerialRef (javax.sql.rowset.serial.SerialRef)1 SerialStruct (javax.sql.rowset.serial.SerialStruct)1 DataProvider (org.testng.annotations.DataProvider)1 StubBaseRowSet (util.StubBaseRowSet)1 StubBlob (util.StubBlob)1