Java 类javax.sql.rowset.serial.SerialException 实例源码

项目:jdk8u-jdk    文件:SerialExceptionTests.java   
@Test
public void test04() {
    SQLException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    while (ex != null) {
        assertTrue(msgs[num++].equals(ex.getMessage()));
        Throwable c = ex.getCause();
        while (c != null) {
            assertTrue(msgs[num++].equals(c.getMessage()));
            c = c.getCause();
        }
        ex = ex.getNextException();
    }
}
项目:openjdk-jdk10    文件:SerialExceptionTests.java   
@Test
public void test04() {
    SQLException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    while (ex != null) {
        assertTrue(msgs[num++].equals(ex.getMessage()));
        Throwable c = ex.getCause();
        while (c != null) {
            assertTrue(msgs[num++].equals(c.getMessage()));
            c = c.getCause();
        }
        ex = ex.getNextException();
    }
}
项目:jdk8u-jdk    文件:SerialExceptionTests.java   
@Test
public void test01() {
    SerialException ex = new SerialException();
    assertTrue(ex.getMessage() == null
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0);
}
项目:jdk8u-jdk    文件:SerialExceptionTests.java   
@Test
public void test03() {
    SerialException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:jdk8u-jdk    文件:SerialExceptionTests.java   
@Test
public void test05() throws Exception {
    SerialException e = new SerialException(reason);
    SerialException ex1 = createSerializedException(e);
    assertTrue(ex1.getMessage().equals(reason)
            && ex1.getSQLState() == null
            && ex1.getCause() == null
            && ex1.getErrorCode() == 0);;
}
项目:jdk8u-jdk    文件:SerialJavaObjectTests.java   
@Test
public void test02() throws Exception {
    SerialException e = new SerialException();
    SerialJavaObject sjo = new SerialJavaObject(e);
    Field[] f = e.getClass().getFields();
    assertTrue(Arrays.equals(f, sjo.getFields()));
    assertFalse(Arrays.equals("hello".getClass().getFields(),
            sjo.getFields()));
}
项目:jdk8u-jdk    文件:SerialBlobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test19() throws Exception {
    SerialBlob sb = new SerialBlob(bytes);
    sb.free();
    SerialBlob sb2 = (SerialBlob) sb.clone();
    InputStream is = sb2.getBinaryStream(1, 3);
}
项目:jdk8u-jdk    文件:SetCharacterStream.java   
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setCharacterStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
项目:jdk8u-jdk    文件:SetAsciiStream.java   
public static void main(String[] args) throws Exception {
    SerialClob clob = new SerialClob(new char[0]);
    try {
        clob.setAsciiStream(0);
    } catch (SerialException e) {
         System.out.println("Test PASSED");
    }
}
项目:jdk8u-jdk    文件:SetBinaryStream.java   
public static void main(String[] args) throws Exception {
    SerialBlob blob = new SerialBlob(new byte[0]);
    try {
        blob.setBinaryStream(0);
    } catch (SerialException e) {
        System.out.println("Test PASSED");
    }
}
项目:openjdk-jdk10    文件:SerialExceptionTests.java   
@Test
public void test01() {
    SerialException ex = new SerialException();
    assertTrue(ex.getMessage() == null
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0);
}
项目:openjdk-jdk10    文件:SerialExceptionTests.java   
@Test
public void test02() {
    SerialException ex = new SerialException(reason);
    assertTrue(ex.getMessage().equals(reason)
            && ex.getSQLState() == null
            && ex.getCause() == null
            && ex.getErrorCode() == 0);
}
项目:openjdk-jdk10    文件:SerialExceptionTests.java   
@Test
public void test03() {
    SerialException ex = new SerialException("Exception 1");
    ex.initCause(t1);
    SerialException ex1 = new SerialException("Exception 2");
    SerialException ex2 = new SerialException("Exception 3");
    ex2.initCause(t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
项目:openjdk-jdk10    文件:SerialExceptionTests.java   
@Test
public void test05() throws Exception {
    SerialException e = new SerialException(reason);
    SerialException ex1 = createSerializedException(e);
    assertTrue(ex1.getMessage().equals(reason)
            && ex1.getSQLState() == null
            && ex1.getCause() == null
            && ex1.getErrorCode() == 0);;
}
项目:openjdk-jdk10    文件:SerialJavaObjectTests.java   
@Test
public void test02() throws Exception {
    SerialException e = new SerialException();
    SerialJavaObject sjo = new SerialJavaObject(e);
    Field[] f = e.getClass().getFields();
    assertTrue(Arrays.equals(f, sjo.getFields()));
    assertFalse(Arrays.equals("hello".getClass().getFields(),
            sjo.getFields()));
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test03() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet();
}
项目:openjdk-jdk10    文件:SerialBlobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test21() throws Exception {
    SerialBlob sb = new SerialBlob(bytes);
    sb.setBinaryStream(3);
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.getResultSet(1, 1);
}
项目:openjdk-jdk10    文件:SerialBlobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[10], 0, 5);
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray();
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray(map);
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray(1, 1, map);
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test10() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getArray(1, 1);
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test11() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getBaseType();
}
项目:jdk8u-jdk    文件:SerialArrayTests.java   
@Test(expectedExceptions = SerialException.class)
public void test12() throws Exception {
    SerialArray sa = new SerialArray(a);
    sa.free();
    sa.getBaseTypeName();
}
项目:jdk8u-jdk    文件:SerialDataLinkTests.java   
@Test(expectedExceptions = SerialException.class)
public void test() throws Exception {
    SerialDatalink dl1 = new SerialDatalink(null);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test01() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.getCharacterStream();
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test02() throws Exception {
    SerialClob sc = new SerialClob(chars);
    sc.free();
    sc.getCharacterStream();
}
项目:openjdk-jdk10    文件:SerialBlobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test15() throws Exception {
    SerialBlob sb = new SerialBlob(bytes);
    InputStream is = sb.getBinaryStream(1, 0);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test04() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.getSubString(1, 1);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.truncate(1);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test06() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.getAsciiStream();
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.length();
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.position("hello", 1);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.position(new StubClob(), 1);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test10() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.setAsciiStream(5);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test11() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.setCharacterStream(5);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test12() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.setString(1, "hello");
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test13() throws Exception {
    SerialClob sc = new SerialClob(new StubClob());
    sc.free();
    sc.setString(1, "hello", 0, 5);
}
项目:jdk8u-jdk    文件:SerialClobTests.java   
@Test(expectedExceptions = SerialException.class)
public void test14() throws Exception {
    SerialClob sc = new SerialClob(chars);
    sc.getCharacterStream(-1, 5);
}