Code example for SQLNonTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
     * @test java.sql.SQLNonTransientConnectionException(String, String, int, 
     *       Throwable) 
     */ 
    public void test_Constructor_LStringLStringILThrowable_10() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
                "MYTESTSTRING", null, -1, cause);
        assertNotNull(sQLNonTransientConnectionException);
        assertNull(
                "The SQLState of SQLNonTransientConnectionException should be null", 
                sQLNonTransientConnectionException.getSQLState());
        assertEquals(
                "The reason of SQLNonTransientConnectionException set and get should be equivalent", 
                "MYTESTSTRING", sQLNonTransientConnectionException.getMessage());
        assertEquals(
                "The error code of SQLNonTransientConnectionException should be -1", 
                sQLNonTransientConnectionException.getErrorCode(), -1);
        assertEquals(
                "The cause of SQLNonTransientConnectionException set and get should be equivalent", 
                cause, sQLNonTransientConnectionException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLNonTransientConnectionException(String, String, int, 
     *       Throwable)