Code example for SQLNonTransientException

Methods: getCause, getErrorCode, getMessage, getSQLState

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