Search in sources :

Example 6 with StubArray

use of util.StubArray in project jdk8u_jdk by JetBrains.

the class SQLInputImplTests method test06.

/*
     * Validate a Array can be read
     */
@Test(enabled = true)
public void test06() throws Exception {
    Object[] coffees = new Object[] { "Espresso", "Colombian", "French Roast", "Cappuccino" };
    Array a = new StubArray("VARCHAR", coffees);
    Object[] values = { a };
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Array a2 = sqli.readArray();
    assertTrue(Arrays.equals((Object[]) a2.getArray(), (Object[]) a.getArray()));
    assertTrue(a.getBaseTypeName().equals(a2.getBaseTypeName()));
}
Also used : StubArray(util.StubArray) Array(java.sql.Array) SQLInputImpl(javax.sql.rowset.serial.SQLInputImpl) StubArray(util.StubArray) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 7 with StubArray

use of util.StubArray 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)

Aggregations

StubArray (util.StubArray)7 Array (java.sql.Array)4 Test (org.testng.annotations.Test)4 StubRef (util.StubRef)4 Ref (java.sql.Ref)2 SerialArray (javax.sql.rowset.serial.SerialArray)2 SerialRef (javax.sql.rowset.serial.SerialRef)2 BaseTest (util.BaseTest)2 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 StringBufferInputStream (java.io.StringBufferInputStream)1 StringReader (java.io.StringReader)1 BigDecimal (java.math.BigDecimal)1 Blob (java.sql.Blob)1 Clob (java.sql.Clob)1 Date (java.sql.Date)1 Time (java.sql.Time)1 Timestamp (java.sql.Timestamp)1 LocalDate (java.time.LocalDate)1 LocalDateTime (java.time.LocalDateTime)1