本文整理汇总了Java中javax.sql.rowset.RowSetWarning.initCause方法的典型用法代码示例。如果您正苦于以下问题:Java RowSetWarning.initCause方法的具体用法?Java RowSetWarning.initCause怎么用?Java RowSetWarning.initCause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sql.rowset.RowSetWarning
的用法示例。
在下文中一共展示了RowSetWarning.initCause方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test07
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
@Test
public void test07() {
RowSetWarning ex = new RowSetWarning("Exception 1");
ex.initCause(t1);
RowSetWarning ex1 = new RowSetWarning("Exception 2");
RowSetWarning ex2 = new RowSetWarning("Exception 3");
ex2.initCause(t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
SQLException sqe = ex;
while (sqe != null) {
assertTrue(msgs[num++].equals(sqe.getMessage()));
Throwable c = sqe.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
sqe = sqe.getNextException();
}
}
示例2: test09
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
/**
* Validate that the ordering of the returned RowSetWarning is correct using
* traditional while loop
*/
@Test
public void test09() {
RowSetWarning ex = new RowSetWarning("Warning 1");
ex.initCause(t1);
RowSetWarning ex1 = new RowSetWarning("Warning 2");
RowSetWarning ex2 = new RowSetWarning("Warning 3");
ex2.initCause(t2);
ex.setNextWarning(ex1);
ex.setNextWarning(ex2);
int num = 0;
RowSetWarning sqe = ex;
while (sqe != null) {
assertTrue(warnings[num++].equals(sqe.getMessage()));
Throwable c = sqe.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
sqe = sqe.getNextWarning();
}
}
示例3: test11
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
@Test
public void test11() throws Exception {
RowSetWarning ex = new RowSetWarning("Warning 1");
ex.initCause(t1);
RowSetWarning ex1 = new RowSetWarning("Warning 2");
RowSetWarning ex2 = new RowSetWarning("Warning 3");
ex2.initCause(t2);
ex.setNextWarning(ex1);
ex.setNextWarning(ex2);
int num = 0;
RowSetWarning sqe = createSerializedException(ex);
while (sqe != null) {
assertTrue(warnings[num++].equals(sqe.getMessage()));
Throwable c = sqe.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
sqe = sqe.getNextWarning();
}
}
示例4: test05
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
@Test
public void test05() throws Exception {
RowSetWarning e = new RowSetWarning(reason, state, errorCode);
e.initCause(t);
RowSetWarning ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage())
&& ex1.getSQLState().equals(state)
&& cause.equals(ex1.getCause().toString())
&& ex1.getErrorCode() == errorCode);
}
示例5: test06
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
@Test
public void test06() {
RowSetWarning ex = new RowSetWarning("Exception 1");
ex.initCause(t1);
RowSetWarning ex1 = new RowSetWarning("Exception 2");
RowSetWarning ex2 = new RowSetWarning("Exception 3");
ex2.initCause(t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
示例6: test08
import javax.sql.rowset.RowSetWarning; //导入方法依赖的package包/类
@Test
public void test08() {
RowSetWarning ex = new RowSetWarning("Warning 1");
ex.initCause(t1);
RowSetWarning ex1 = new RowSetWarning("Warning 2");
RowSetWarning ex2 = new RowSetWarning("Warning 3");
ex2.initCause(t2);
ex.setNextWarning(ex1);
ex.setNextWarning(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(warnings[num++].equals(e.getMessage()));
}
}