Code example for SQLIntegrityConstraintViolationException

Methods: getCause, getErrorCode, getMessage, getSQLState

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