java.sql.SQLTransactionRollbackException#setNextException ( )源码实例Demo

下面列出了java.sql.SQLTransactionRollbackException#setNextException ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using for-each loop
 */
@Test
public void test11() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
 
/**
 * Validate that the ordering of the returned Exceptions is correct
 * using traditional while loop
 */
@Test
public void test12() {
    SQLTransactionRollbackException ex =
            new SQLTransactionRollbackException("Exception 1", t1);
    SQLTransactionRollbackException ex1 =
            new SQLTransactionRollbackException("Exception 2");
    SQLTransactionRollbackException ex2 =
            new SQLTransactionRollbackException("Exception 3", 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();
    }
}