Search in sources :

Example 1 with BetweenCriteria

use of org.teiid.query.sql.lang.BetweenCriteria in project teiid by teiid.

the class TestBetweenCriteria method testNonEquivalence1.

public void testNonEquivalence1() {
    // test transitivity with two nonequal Objects
    // $NON-NLS-1$
    BetweenCriteria c1 = example("xyz", 1, 20, false);
    // $NON-NLS-1$
    BetweenCriteria c2 = example("abc", 1, 20, false);
    int equals = -1;
    UnitTestUtil.helpTestEquivalence(equals, c1, c2);
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria)

Example 2 with BetweenCriteria

use of org.teiid.query.sql.lang.BetweenCriteria in project teiid by teiid.

the class TestBetweenCriteria method example.

// ################################## TEST HELPERS ################################
public static BetweenCriteria example(String element, int lower, int upper, boolean negated) {
    BetweenCriteria criteria = new BetweenCriteria(new ElementSymbol(element), new Constant(new Integer(lower)), new Constant(new Integer(upper)));
    criteria.setNegated(negated);
    return criteria;
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria)

Example 3 with BetweenCriteria

use of org.teiid.query.sql.lang.BetweenCriteria in project teiid by teiid.

the class TestBetweenCriteria method testEquals2.

public void testEquals2() {
    // $NON-NLS-1$
    BetweenCriteria c1 = example("x", 1, 20, true);
    BetweenCriteria c2 = (BetweenCriteria) c1.clone();
    // $NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Equivalent between criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria)

Example 4 with BetweenCriteria

use of org.teiid.query.sql.lang.BetweenCriteria in project teiid by teiid.

the class TestBetweenCriteria method testEquivalence.

public void testEquivalence() {
    // $NON-NLS-1$
    BetweenCriteria c1 = example("x", 1, 20, false);
    // $NON-NLS-1$
    BetweenCriteria c2 = example("x", 1, 20, false);
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, c1, c2);
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria)

Example 5 with BetweenCriteria

use of org.teiid.query.sql.lang.BetweenCriteria in project teiid by teiid.

the class TestBetweenCriteria method testNonEquivalence2.

public void testNonEquivalence2() {
    // $NON-NLS-1$
    BetweenCriteria c1 = example("x", 1, 20, true);
    // $NON-NLS-1$
    BetweenCriteria c2 = example("x", 1, 20, false);
    int equals = -1;
    UnitTestUtil.helpTestEquivalence(equals, c1, c2);
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria)

Aggregations

BetweenCriteria (org.teiid.query.sql.lang.BetweenCriteria)10 Constant (org.teiid.query.sql.symbol.Constant)1