Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.MatchCriteria


 
 
  // ################################## TEST HELPERS ################################ 
   
  public static MatchCriteria example(String element, String str) {
    MatchCriteria crit = new MatchCriteria();
    crit.setLeftExpression(new ElementSymbol(element));
    crit.setRightExpression(new Constant(str));
    return crit;       
  }   
View Full Code Here


    crit.setRightExpression(new Constant(str));
    return crit;       
  }   

  public static MatchCriteria example(String str) {
    MatchCriteria crit = new MatchCriteria();
    crit.setLeftExpression(new ElementSymbol("m.g1.e1")); //$NON-NLS-1$
    crit.setRightExpression(new Constant(str));
    return crit;       
  }   
View Full Code Here

    crit.setRightExpression(new Constant(str));
    return crit;       
  }   

  public static MatchCriteria example(String str, char escapeChar) {
    MatchCriteria crit = new MatchCriteria();
    crit.setLeftExpression(new ElementSymbol("m.g1.e1")); //$NON-NLS-1$
    crit.setRightExpression(new Constant(str));
    crit.setEscapeChar(escapeChar);
    return crit;                   
  }   
View Full Code Here

  }   
   
  // ################################## ACTUAL TESTS ################################
 
  public void testEquals1() {   
    MatchCriteria c1 = example("abc"); //$NON-NLS-1$
    MatchCriteria c2 = example("abc"); //$NON-NLS-1$
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    MatchCriteria c2 = example("abc"); //$NON-NLS-1$
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }

  public void testEquals2() {   
    MatchCriteria c1 = example("abc", '#'); //$NON-NLS-1$
        c1.setNegated(true);
    MatchCriteria c2 = example("abc", '#'); //$NON-NLS-1$
        c2.setNegated(true);
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

        c2.setNegated(true);
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }

  public void testEquals3() {   
    MatchCriteria c1 = example("abc", '#'); //$NON-NLS-1$
        c1.setNegated(true);
    MatchCriteria c2 = (MatchCriteria) c1.clone();
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    MatchCriteria c2 = (MatchCriteria) c1.clone();
    assertTrue("Equivalent match criteria don't compare as equal: " + c1 + ", " + c2, c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }

  public void testEquals4() {   
    MatchCriteria c1 = example("abc"); //$NON-NLS-1$
    MatchCriteria c2 = example("abc", '#'); //$NON-NLS-1$
    assertTrue("Different match criteria compare as equal: " + c1 + ", " + c2, ! c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    MatchCriteria c2 = example("abc", '#'); //$NON-NLS-1$
    assertTrue("Different match criteria compare as equal: " + c1 + ", " + c2, ! c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }

  public void testEquals5() {   
    MatchCriteria c1 = example("e1", "abc"); //$NON-NLS-1$ //$NON-NLS-2$
    MatchCriteria c2 = example("e2", "abc"); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Different match criteria compare as equal: " + c1 + ", " + c2, ! c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    MatchCriteria c2 = example("e2", "abc"); //$NON-NLS-1$ //$NON-NLS-2$
    assertTrue("Different match criteria compare as equal: " + c1 + ", " + c2, ! c1.equals(c2));         //$NON-NLS-1$ //$NON-NLS-2$
  }

  public void testSelfEquivalence(){
    MatchCriteria c1 = example("abc"); //$NON-NLS-1$
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, c1, c1);
  }
View Full Code Here

    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, c1, c1);
  }

  public void testEquivalence(){
    MatchCriteria c1 = example("abc"); //$NON-NLS-1$
    MatchCriteria c2 = example("abc"); //$NON-NLS-1$
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, c1, c2);
  }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.MatchCriteria

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.