Java Code Examples for javax.sql.rowset.serial.SQLInputImpl

The following examples show how to use javax.sql.rowset.serial.SQLInputImpl. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    impl.writeSQL(outImpl);
    assertTrue(Arrays.equals(results.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(results.toArray(), typeValues));
}
 
Example 2
Source Project: jdk8u-jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test11() throws Exception {
    Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
        "Batman"};
    map.put(sqlType, Class.forName("util.SuperHero"));
    Struct struct = new StubStruct(sqlType, attributes);
    Object[] values = {struct};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();

    assertTrue(hero.equals(o));

}
 
Example 3
Source Project: hottub   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test10() throws Exception {
    URL u = new URL("http://www.oracle.com/");;
    Object[] values = {u};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    URL u2 = sqli.readURL();
    assertTrue(u2.equals(u));
    assertTrue(u2.sameFile(u));
}
 
Example 4
@Test()
public void test05() throws Exception {
    Object[] values = {hero};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();
    assertTrue(hero.equals(o));

}
 
Example 5
@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()));
}
 
Example 6
@Test(enabled = true)
public void test07() throws Exception {
    Blob b = new StubBlob();
    Object[] values = {b};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Blob b2 = sqli.readBlob();
    assertTrue(Arrays.equals(
            b.getBytes(1, (int) b.length()),
            b2.getBytes(1, (int) b2.length())));
}
 
Example 7
Source Project: jdk8u_jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test11() throws Exception {
    Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
        "Batman"};
    map.put(sqlType, Class.forName("util.SuperHero"));
    Struct struct = new StubStruct(sqlType, attributes);
    Object[] values = {struct};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();

    assertTrue(hero.equals(o));

}
 
Example 8
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
Example 9
@Test(enabled = true)
public void test10() throws Exception {
    URL u = new URL("http://www.oracle.com/");;
    Object[] values = {u};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    URL u2 = sqli.readURL();
    assertTrue(u2.equals(u));
    assertTrue(u2.sameFile(u));
}
 
Example 10
@Test()
public void test11() throws Exception {
    Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
        "Batman"};
    map.put(sqlType, Class.forName("util.SuperHero"));
    Struct struct = new StubStruct(sqlType, attributes);
    Object[] values = {struct};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();

    assertTrue(hero.equals(o));

}
 
Example 11
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    impl.writeSQL(outImpl);
    assertTrue(Arrays.equals(results.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(results.toArray(), typeValues));
}
 
Example 12
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    assertTrue(Arrays.equals(impl.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(impl.toArray(), typeValues));
}
 
Example 13
@Test()
public void test05() throws Exception {
    Object[] values = {hero};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();
    assertTrue(hero.equals(o));

}
 
Example 14
Source Project: hottub   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    assertTrue(Arrays.equals(impl.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(impl.toArray(), typeValues));
}
 
Example 15
@Test(enabled = true)
public void test07() throws Exception {
    Blob b = new StubBlob();
    Object[] values = {b};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Blob b2 = sqli.readBlob();
    assertTrue(Arrays.equals(
            b.getBytes(1, (int) b.length()),
            b2.getBytes(1, (int) b2.length())));
}
 
Example 16
@Test(enabled = true)
public void test08() throws Exception {
    Clob c = new StubClob();
    Object[] values = {c};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Clob c2 = sqli.readClob();
    assertTrue(c.getSubString(1,
            (int) c.length()).equals(c2.getSubString(1, (int) c2.length())));
}
 
Example 17
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
Example 18
Source Project: hottub   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test07() throws Exception {
    Blob b = new StubBlob();
    Object[] values = {b};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Blob b2 = sqli.readBlob();
    assertTrue(Arrays.equals(
            b.getBytes(1, (int) b.length()),
            b2.getBytes(1, (int) b2.length())));
}
 
Example 19
@Test()
public void test11() throws Exception {
    Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
        "Batman"};
    map.put(sqlType, Class.forName("util.SuperHero"));
    Struct struct = new StubStruct(sqlType, attributes);
    Object[] values = {struct};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();

    assertTrue(hero.equals(o));

}
 
Example 20
Source Project: jdk8u60   Source File: SQLOutputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    impl.writeSQL(outImpl);
    assertTrue(Arrays.equals(results.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(results.toArray(), typeValues));
}
 
Example 21
Source Project: jdk8u_jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test08() throws Exception {
    Clob c = new StubClob();
    Object[] values = {c};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Clob c2 = sqli.readClob();
    assertTrue(c.getSubString(1,
            (int) c.length()).equals(c2.getSubString(1, (int) c2.length())));
}
 
Example 22
Source Project: jdk8u_jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
Example 23
Source Project: jdk8u60   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    assertTrue(Arrays.equals(impl.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(impl.toArray(), typeValues));
}
 
Example 24
Source Project: jdk8u_jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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()));
}
 
Example 25
Source Project: jdk8u60   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test05() throws Exception {
    Object[] values = {hero};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();
    assertTrue(hero.equals(o));

}
 
Example 26
Source Project: hottub   Source File: SQLOutputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test03() throws Exception {
    impl.readSQL(new SQLInputImpl(typeValues, map), "misc");
    impl.writeSQL(outImpl);
    assertTrue(Arrays.equals(results.toArray(), typeValues));
    // Null out a field and make sure the arrays do not match
    typeValues[2] = null;
    assertFalse(Arrays.equals(results.toArray(), typeValues));
}
 
Example 27
Source Project: jdk8u-jdk   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
Example 28
Source Project: jdk8u60   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test09() throws Exception {
    Ref ref = new StubRef(sqlType, hero);
    Object[] values = {ref};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Ref ref2 = sqli.readRef();
    assertTrue(ref.getObject().equals(ref2.getObject()));
    assertTrue(ref.getBaseTypeName().equals(ref2.getBaseTypeName()));
}
 
Example 29
Source Project: jdk8u60   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test(enabled = true)
public void test10() throws Exception {
    URL u = new URL("http://www.oracle.com/");;
    Object[] values = {u};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    URL u2 = sqli.readURL();
    assertTrue(u2.equals(u));
    assertTrue(u2.sameFile(u));
}
 
Example 30
Source Project: jdk8u60   Source File: SQLInputImplTests.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Test()
public void test11() throws Exception {
    Object[] attributes = new Object[]{"Bruce", "Wayne", 1939,
        "Batman"};
    map.put(sqlType, Class.forName("util.SuperHero"));
    Struct struct = new StubStruct(sqlType, attributes);
    Object[] values = {struct};
    SQLInputImpl sqli = new SQLInputImpl(values, map);
    Object o = sqli.readObject();

    assertTrue(hero.equals(o));

}