Search in sources :

Example 1 with SQLDbLinkExpr

use of com.alibaba.druid.sql.ast.expr.SQLDbLinkExpr in project druid by alibaba.

the class EqualTest_dbLink method test_eq.

public void test_eq() throws Exception {
    String sql = "a@b";
    String sql_c = "a@c";
    SQLDbLinkExpr exprA, exprB, exprC;
    {
        OracleExprParser parser = new OracleExprParser(sql);
        exprA = (SQLDbLinkExpr) parser.expr();
    }
    {
        OracleExprParser parser = new OracleExprParser(sql);
        exprB = (SQLDbLinkExpr) parser.expr();
    }
    {
        OracleExprParser parser = new OracleExprParser(sql_c);
        exprC = (SQLDbLinkExpr) parser.expr();
    }
    Assert.assertEquals(exprA, exprB);
    Assert.assertNotEquals(exprA, exprC);
    Assert.assertTrue(exprA.equals(exprA));
    Assert.assertFalse(exprA.equals(new Object()));
    Assert.assertEquals(exprA.hashCode(), exprB.hashCode());
    Assert.assertEquals(new SQLDbLinkExpr(), new SQLDbLinkExpr());
    Assert.assertEquals(new SQLDbLinkExpr().hashCode(), new SQLDbLinkExpr().hashCode());
}
Also used : SQLDbLinkExpr(com.alibaba.druid.sql.ast.expr.SQLDbLinkExpr) OracleExprParser(com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser)

Aggregations

SQLDbLinkExpr (com.alibaba.druid.sql.ast.expr.SQLDbLinkExpr)1 OracleExprParser (com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser)1