Code example for SQLSyntaxErrorException

Methods: getCause, getErrorCode, getMessage, getSQLState

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