use of org.teiid.query.sql.lang.JoinPredicate in project teiid by teiid.
the class TestJoinPredicate method testNonEquivalence3.
/**
* Test a <code>JoinPredicate</code> object using <code>UnitTestUtil.helpTestEquivalence</code>.
* <p>
* This test ensures that two different <code>JoinPredicate</code> objects
* constructed with different join types but with the same criteria evaluate
* as not equal.
* <p>
* For example:
* ... m.g1 LEFT OUTER JOIN m.g2 ON m.g1.e1 = m.g2.e1
* ... m.g1 RIGHT OUTER JOIN m.g2 ON m.g1.e2 = m.g2.e2
*/
public void testNonEquivalence3() {
// $NON-NLS-1$
JoinPredicate jp1 = example(JoinType.JOIN_LEFT_OUTER, "e1");
// $NON-NLS-1$
JoinPredicate jp2 = example(JoinType.JOIN_RIGHT_OUTER, "e1");
int equals = -1;
UnitTestUtil.helpTestEquivalence(equals, jp1, jp2);
}
use of org.teiid.query.sql.lang.JoinPredicate in project teiid by teiid.
the class TestJoinImpl method helpExample.
public static JoinPredicate helpExample(JoinType type) {
// $NON-NLS-1$ //$NON-NLS-2$
ElementSymbol e1 = TestElementImpl.helpExample("vm1.g1", "e1");
// $NON-NLS-1$ //$NON-NLS-2$
ElementSymbol e2 = TestElementImpl.helpExample("vm1.g2", "e1");
ArrayList criteria = new ArrayList();
criteria.add(new CompareCriteria(e1, CompareCriteria.EQ, e2));
return new JoinPredicate(new UnaryFromClause(e1.getGroupSymbol()), new UnaryFromClause(e2.getGroupSymbol()), type, criteria);
}
use of org.teiid.query.sql.lang.JoinPredicate in project teiid by teiid.
the class TestGroupCollectorVisitor method testJoinPredicate1.
public void testJoinPredicate1() {
GroupSymbol gs1 = exampleGroupSymbol(1);
GroupSymbol gs2 = exampleGroupSymbol(2);
JoinPredicate jp = new JoinPredicate(new UnaryFromClause(gs1), new UnaryFromClause(gs2), JoinType.JOIN_CROSS);
Set groups = new HashSet();
groups.add(gs1);
groups.add(gs2);
helpTestGroups(jp, true, groups);
}
use of org.teiid.query.sql.lang.JoinPredicate in project teiid by teiid.
the class TestGroupCollectorVisitor method testJoinPredicate2.
public void testJoinPredicate2() {
GroupSymbol gs1 = exampleGroupSymbol(1);
GroupSymbol gs2 = exampleGroupSymbol(2);
GroupSymbol gs3 = exampleGroupSymbol(3);
JoinPredicate jp1 = new JoinPredicate(new UnaryFromClause(gs1), new UnaryFromClause(gs2), JoinType.JOIN_CROSS);
JoinPredicate jp2 = new JoinPredicate(new UnaryFromClause(gs3), jp1, JoinType.JOIN_CROSS);
Set groups = new HashSet();
groups.add(gs1);
groups.add(gs2);
groups.add(gs3);
helpTestGroups(jp2, true, groups);
}
use of org.teiid.query.sql.lang.JoinPredicate in project teiid by teiid.
the class TestJoinPredicate method testEquivalence.
/**
* Test a <code>JoinPredicate</code> object using <code>UnitTestUtil.helpTestEquivalence</code>.
* <p>
* This test ensures that two different <code>JoinPredicate</code> objects
* constructed with the same join type and the same criteria evaluates as
* equal.
* <p>
* For example:
* ... m.g1 FULL OUTER JOIN m.g2 ON m.g1.e1 = m.g2.e1
* ... m.g1 FULL OUTER JOIN m.g2 ON m.g1.e1 = m.g2.e1
*/
public void testEquivalence() {
// $NON-NLS-1$
JoinPredicate jp1 = example(JoinType.JOIN_FULL_OUTER, "e1");
// $NON-NLS-1$
JoinPredicate jp2 = example(JoinType.JOIN_FULL_OUTER, "e1");
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, jp1, jp2);
}
Aggregations