Search in sources :

Example 1 with IsNullCriteria

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

the class TestIsNullCriteriaImpl method helpExample.

public static IsNullCriteria helpExample(boolean negated) {
    // $NON-NLS-1$ //$NON-NLS-2$
    IsNullCriteria crit = new IsNullCriteria(TestElementImpl.helpExample("vm1.g1", "e1"));
    crit.setNegated(negated);
    return crit;
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria)

Example 2 with IsNullCriteria

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

the class TestIsNullCriteria method testSelfEquivalence.

public void testSelfEquivalence() {
    IsNullCriteria c1 = new IsNullCriteria();
    c1.setNegated(true);
    // $NON-NLS-1$
    c1.setExpression(new Constant("abc"));
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, c1, c1);
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria)

Example 3 with IsNullCriteria

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

the class TestIsNullCriteria method testNonEquivalence2.

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

Example 4 with IsNullCriteria

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

the class TestIsNullCriteria method testEquals1.

// ################################## ACTUAL TESTS ################################
public void testEquals1() {
    // $NON-NLS-1$
    IsNullCriteria c1 = example("abc", true);
    // $NON-NLS-1$
    IsNullCriteria c2 = example("abc", true);
    // $NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Equivalent is null criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));
}
Also used : IsNullCriteria(org.teiid.query.sql.lang.IsNullCriteria)

Example 5 with IsNullCriteria

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

the class TestIsNullCriteria method testEquivalence.

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

Aggregations

IsNullCriteria (org.teiid.query.sql.lang.IsNullCriteria)22 CompareCriteria (org.teiid.query.sql.lang.CompareCriteria)6 Criteria (org.teiid.query.sql.lang.Criteria)5 Constant (org.teiid.query.sql.symbol.Constant)5 Test (org.junit.Test)4 PlanNode (org.teiid.query.optimizer.relational.plantree.PlanNode)4 Expression (org.teiid.query.sql.symbol.Expression)4 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)3 Collection (java.util.Collection)2 Query (org.teiid.query.sql.lang.Query)2 SetCriteria (org.teiid.query.sql.lang.SetCriteria)2 Reference (org.teiid.query.sql.symbol.Reference)2 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 QueryPlannerException (org.teiid.api.exception.query.QueryPlannerException)1 ArrayImpl (org.teiid.core.types.ArrayImpl)1 LanguageObject (org.teiid.query.sql.LanguageObject)1 LanguageVisitor (org.teiid.query.sql.LanguageVisitor)1 CompoundCriteria (org.teiid.query.sql.lang.CompoundCriteria)1 DependentSetCriteria (org.teiid.query.sql.lang.DependentSetCriteria)1