/** * Test <code>equals()</code> method of <code>JoinPredicate</code> to * verify it properly evaluates the equality of two <code>JoinPredicate</code> * objects. * <p> * This test ensures that two different <code>JoinPredicate</code> objects * that were constructed with the same join type but with different * criteria evaluate as not equal. * <p> * For example: * ... m.g1 INNER JOIN m.g2 ON m.g1.e1 = m.g2.e1 * ... m.g1 INNER JOIN m.g2 ON m.g1.e2 = m.g2.e2 */ public void testEquals4() { JoinPredicate jp1 = example(JoinType.JOIN_INNER, "e1"); //$NON-NLS-1$ JoinPredicate jp2 = example(JoinType.JOIN_INNER, "e2"); //$NON-NLS-1$ assertTrue("Different join predicate compare as equal: " + jp1 + ", " + jp2, !jp1.equals(jp2)); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Test <code>equals()</code> method of <code>JoinPredicate</code> to * verify it properly evaluates the equality of two <code>JoinPredicate</code> * objects. * <p> * This test ensures that two different <code>JoinPredicate</code> objects * that were constructed with the same join type and with the same criteria * evaluate as equal. * <p> * For example: * ... m.g1 LEFT OUTER JOIN m.g2 ON m.g1.e1 = m.g2.e1 */ public void testEquals1() { JoinPredicate jp1 = example(JoinType.JOIN_LEFT_OUTER, "e1"); //$NON-NLS-1$ JoinPredicate jp2 = example(JoinType.JOIN_LEFT_OUTER, "e1"); //$NON-NLS-1$ assertTrue("Equivalent join predicate don't compare as equal: " + jp1 + ", " + jp2, jp1.equals(jp2)); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Test <code>equals()</code> method of <code>JoinPredicate</code> to * verify it properly evaluates the equality of two * <code>JoinPredicate</code> objects. * <p> * This test ensures that two different <code>JoinPredicate</code> objects * that were constructed with the same join type and with the same * compound criteria evaluate as equal. * <p> * For example: * ... m.g1 LEFT OUTER JOIN m.g2 ON ((m.g1.e1 = m.g2.e1) AND (m.g1.e2 = m.g2.e2)) */ public void testEquals2() { JoinPredicate jp1 = example(JoinType.JOIN_LEFT_OUTER, "e1", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ JoinPredicate jp2 = example(JoinType.JOIN_LEFT_OUTER, "e1", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue("Equivalent join predicate don't compare as equal: " + jp1 + ", " + jp2, jp1.equals(jp2)); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Test <code>equals()</code> method of <code>JoinPredicate</code> to * verify it properly evaluates the equality of two <code>JoinPredicate</code> * objects. * <p> * This test ensures that two different <code>JoinPredicate</code> objects * that were constructed with different join types but with the same * compound criteria evaluate as not equal. * <p> * For example: * ... m.g1 LEFT OUTER JOIN m.g2 ON ((m.g1.e1 = m.g2.e1) AND (m.g1.e2 = m.g2.e2)) * ... m.g1 RIGHT OUTER JOIN m.g2 ON ((m.g1.e1 = m.g2.e1) AND (m.g1.e2 = m.g2.e2)) */ public void testEquals3() { JoinPredicate jp1 = example(JoinType.JOIN_LEFT_OUTER, "e1", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ JoinPredicate jp2 = example(JoinType.JOIN_RIGHT_OUTER, "e1", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue("Different join predicate compare as equal: " + jp1 + ", " + jp2, !jp1.equals(jp2)); //$NON-NLS-1$ //$NON-NLS-2$ }
/** * Test <code>equals()</code> method of <code>JoinPredicate</code> to * verify it properly evaluates the equality of two <code>JoinPredicate</code> * objects. * <p> * This test ensures that two different <code>JoinPredicate</code> objects * that were constructed with the same join type but with different * compound criteria evaluate as not equal. * <p> * For example: * ... m.g1 CROSS JOIN m.g2 ON ((m.g1.e1 = m.g2.e1) AND (m.g1.e2 = m.g2.e2)) * ... m.g1 CROSS JOIN m.g2 ON ((m.g1.e2 = m.g2.e2) AND (m.g1.e2 = m.g2.e2)) */ public void testEquals5() { JoinPredicate jp1 = example(JoinType.JOIN_CROSS, "e1", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ JoinPredicate jp2 = example(JoinType.JOIN_CROSS, "e2", "e2"); //$NON-NLS-1$ //$NON-NLS-2$ assertTrue("Different join predicate compare as equal: " + jp1 + ", " + jp2, !jp1.equals(jp2)); //$NON-NLS-1$ //$NON-NLS-2$ }