Examples of IfStatement


Examples of org.teiid.query.sql.proc.IfStatement

  public static final IfStatement sample2() {
    Block ifBlock = TestBlock.sample2();
    Block elseBlock = TestBlock.sample1();
    Criteria criteria = TestHasCriteria.sample2();
    return new IfStatement(criteria, ifBlock, elseBlock);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

 
  // ################################## ACTUAL TESTS ################################ 


  public void testGetIfBlock() {
    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getIfBlock().equals(TestBlock.sample1())); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getIfBlock().equals(TestBlock.sample1())); //$NON-NLS-1$
  }
 
  public void testGetElseBlock() {
    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getElseBlock().equals(TestBlock.sample2())); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getElseBlock().equals(TestBlock.sample2())); //$NON-NLS-1$
  }
 
  public void testGetCondition() {
    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getCondition().equals(TestHasCriteria.sample1())); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    IfStatement b1 = sample1();
        assertTrue("Incorrect IfBlock on statement", b1.getCondition().equals(TestHasCriteria.sample1())); //$NON-NLS-1$
  }
 
  public void testSelfEquivalence(){
    IfStatement s1 = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

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

  public void testEquivalence(){
    IfStatement s1 = sample1();
    IfStatement s1a = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
  }
 
  public void testNonEquivalence(){
    IfStatement s1 = sample1();
    IfStatement s2 = sample2();
    int equals = -1;
    UnitTestUtil.helpTestEquivalence(equals, s1, s2);
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    ElementSymbol sy1 = new ElementSymbol("x"); //$NON-NLS-1$
    List elmnts = new ArrayList(1);
    elmnts.add(sy1);
    CriteriaSelector cs = new CriteriaSelector(CriteriaSelector.LIKE, elmnts);     
      Criteria crit = new HasCriteria(cs);     
      IfStatement ifStmt = new IfStatement(crit, ifblock);     
     
      // other statements
      RaiseErrorStatement errStmt =  new RaiseErrorStatement(new Constant("My Error")); //$NON-NLS-1$
      Block b = new Block();
      b.addStatement(cmdStmt);
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    List elmnts = new ArrayList(1);
    elmnts.add(sy1);
    CriteriaSelector cs = new CriteriaSelector(CriteriaSelector.LIKE, elmnts);     
      Criteria crit = new HasCriteria(cs);
     
      IfStatement ifStmt = new IfStatement(crit, ifblock);
    helpTest(ifStmt, "IF(HAS LIKE CRITERIA ON (x))\nBEGIN\nDELETE FROM g;\na = 1;\nERROR 'My Error';\nEND"); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.sql.proc.IfStatement

    List elmnts = new ArrayList(1);
    elmnts.add(sy1);
    CriteriaSelector cs = new CriteriaSelector(CriteriaSelector.LIKE, elmnts);     
      Criteria crit = new HasCriteria(cs);
     
      IfStatement ifStmt = new IfStatement(crit, ifblock);
    helpTest(ifStmt, "IF(HAS LIKE CRITERIA ON (x))\nBEGIN\nDELETE FROM g;\nEND"); //$NON-NLS-1$
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.