本文整理汇总了Java中javax.sql.rowset.serial.SerialException类的典型用法代码示例。如果您正苦于以下问题:Java SerialException类的具体用法?Java SerialException怎么用?Java SerialException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SerialException类属于javax.sql.rowset.serial包,在下文中一共展示了SerialException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test04
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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();
}
}
示例2: test01
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test01() {
SerialException ex = new SerialException();
assertTrue(ex.getMessage() == null
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0);
}
示例3: test03
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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()));
}
}
示例4: test05
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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);;
}
示例5: test02
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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()));
}
示例6: test19
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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);
}
示例7: main
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
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");
}
}
示例8: main
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
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");
}
}
示例9: main
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
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");
}
}
示例10: test02
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test
public void test02() {
SerialException ex = new SerialException(reason);
assertTrue(ex.getMessage().equals(reason)
&& ex.getSQLState() == null
&& ex.getCause() == null
&& ex.getErrorCode() == 0);
}
示例11: test03
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test03() throws Exception {
SerialArray sa = new SerialArray(a);
sa.getResultSet();
}
示例12: test21
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test21() throws Exception {
SerialBlob sb = new SerialBlob(bytes);
sb.setBinaryStream(3);
}
示例13: test05
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test05() throws Exception {
SerialArray sa = new SerialArray(a);
sa.getResultSet(1, 1);
}
示例14: test09
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@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);
}
示例15: test07
import javax.sql.rowset.serial.SerialException; //导入依赖的package包/类
@Test(expectedExceptions = SerialException.class)
public void test07() throws Exception {
SerialArray sa = new SerialArray(a);
sa.free();
sa.getArray();
}