Search in sources :

Example 6 with SerialStruct

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

the class SerialStructTests method test01.

/*
     * Validate that getSQLTypeName() returns the same SQLType specified by
     * the Struct used to create the object
     */
@Test
public void test01() throws Exception {
    SerialStruct ss = new SerialStruct(struct, map);
    assertEquals(ss.getSQLTypeName(), sqlType);
}
Also used : SerialStruct(javax.sql.rowset.serial.SerialStruct) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 7 with SerialStruct

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

the class SerialStructTests method test08.

/**
     * Validate that a SerialStruct that is serialized & deserialized is equal
     * to itself
     */
@Test
public void test08() throws Exception {
    SerialStruct ss = new SerialStruct(struct, map);
    SerialStruct ss1 = serializeDeserializeObject(ss);
    ;
    assertTrue(ss.equals(ss1));
}
Also used : SerialStruct(javax.sql.rowset.serial.SerialStruct) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 8 with SerialStruct

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

the class SerialStructTests method test03.

/*
     * Validate that getAttributes() returns the same attributes specified by
     * the Struct used to create the object
     */
@Test
public void test03() throws Exception {
    SerialStruct ss = new SerialStruct(struct, map);
    assertTrue(Arrays.equals(attributes, ss.getAttributes()));
}
Also used : SerialStruct(javax.sql.rowset.serial.SerialStruct) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 9 with SerialStruct

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

the class SerialStructTests method test04.

/*
     * Validate that getAttributes() returns the same attributes specified by
     * the Struct used to create the object
     */
@Test
public void test04() throws Exception {
    SerialStruct ss = new SerialStruct(hero, map);
    assertTrue(Arrays.equals(attributes, ss.getAttributes()));
}
Also used : SerialStruct(javax.sql.rowset.serial.SerialStruct) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 10 with SerialStruct

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

the class SQLOutputImplTests method test10.

/*
     * Validate an Object implementing SQLData can be written and returned
     */
@Test(enabled = true)
public void test10() throws Exception {
    Object[] attributes = new Object[] { "Bruce", "Wayne", 1939, "Batman" };
    outImpl.writeObject(hero);
    SerialStruct ss = (SerialStruct) results.get(0);
    assertTrue(Arrays.equals(attributes, (Object[]) ss.getAttributes()));
    assertTrue(sqlType.equals(ss.getSQLTypeName()));
}
Also used : SerialStruct(javax.sql.rowset.serial.SerialStruct) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SerialStruct (javax.sql.rowset.serial.SerialStruct)11 Test (org.testng.annotations.Test)10 BaseTest (util.BaseTest)10 Struct (java.sql.Struct)1 SQLInputImpl (javax.sql.rowset.serial.SQLInputImpl)1 SerialArray (javax.sql.rowset.serial.SerialArray)1 SerialBlob (javax.sql.rowset.serial.SerialBlob)1 SerialClob (javax.sql.rowset.serial.SerialClob)1 StubStruct (util.StubStruct)1