Code example for SQLNonTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
    /** 
     * @test java.sql.SQLNonTransientConnectionException(Throwable) 
     */ 
    public void test_Constructor_LThrowable() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
                cause);
        assertNotNull(sQLNonTransientConnectionException);
        assertEquals(
                "The reason of SQLNonTransientConnectionException should be equals to cause.toString()", 
                "java.lang.Exception: MYTHROWABLE", 
                sQLNonTransientConnectionException.getMessage());
        assertNull(
                "The SQLState of SQLNonTransientConnectionException should be null", 
                sQLNonTransientConnectionException.getSQLState());
        assertEquals(
                "The error code of SQLNonTransientConnectionException should be 0", 
                sQLNonTransientConnectionException.getErrorCode(), 0);
        assertEquals(
                "The cause of SQLNonTransientConnectionException set and get should be equivalent", 
                cause, sQLNonTransientConnectionException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLNonTransientConnectionException(Throwable) 
     */