Code example for SQLNonTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
     * @test java.sql.SQLNonTransientConnectionException(String, String, 
     *       Throwable) 
     */ 
    public void test_Constructor_LStringLStringLThrowable_4() { 
        Throwable cause = new Exception("MYTHROWABLE");
        SQLNonTransientConnectionException sQLNonTransientConnectionException = new SQLNonTransientConnectionException(
                null, "MYTESTSTRING", cause);
        assertNotNull(sQLNonTransientConnectionException);
        assertEquals(
                "The SQLState of SQLNonTransientConnectionException set and get should be equivalent", 
                "MYTESTSTRING", sQLNonTransientConnectionException
                        .getSQLState());
        assertNull(
                "The reason of SQLNonTransientConnectionException should be null", 
                sQLNonTransientConnectionException.getMessage());
        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(String, String, 
     *       Throwable)