Code example for SQLTransientConnectionException

Methods: getCause, getErrorCode, getMessage, getSQLState

0
    /** 
     * @test java.sql.SQLTransientConnectionException(String, String, int, 
     *       Throwable) 
     */ 
    public void test_Constructor_LStringLStringILThrowable_1() { 
        SQLTransientConnectionException sQLTransientConnectionException = new SQLTransientConnectionException(
                "MYTESTSTRING1", "MYTESTSTRING2", 1, null); 
        assertNotNull(sQLTransientConnectionException);
        assertEquals(
                "The SQLState of SQLTransientConnectionException set and get should be equivalent", 
                "MYTESTSTRING2", sQLTransientConnectionException.getSQLState());
        assertEquals(
                "The reason of SQLTransientConnectionException set and get should be equivalent", 
                "MYTESTSTRING1", sQLTransientConnectionException.getMessage());
        assertEquals(
                "The error code of SQLTransientConnectionException should be 1", 
                sQLTransientConnectionException.getErrorCode(), 1);
        assertNull(
                "The cause of SQLTransientConnectionException should be null", 
                sQLTransientConnectionException.getCause());
    } 
 
    /** 
     * @test java.sql.SQLTransientConnectionException(String, String, int, 
     *       Throwable)