Package org.teiid.query.sql.proc

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


 
 
  // ################################## TEST HELPERS ################################ 

  public static final Block sample1() {
    Block block = new Block();
    block.addStatement(TestAssignmentStatement.sample1());
    block.addStatement(TestCommandStatement.sample1());
    block.addStatement(TestRaiseErrorStatement.sample1());
    block.addStatement(TestAssignmentStatement.sample1());
      return block;
  }
View Full Code Here


        q1.setFrom(from);
        return q1;
    }
   
    public static final LoopStatement sample1() {
        Block block = TestBlock.sample1();
        return new LoopStatement(block, query1(), "cursor"); //$NON-NLS-1$
    }
View Full Code Here

        Block block = TestBlock.sample1();
        return new LoopStatement(block, query1(), "cursor"); //$NON-NLS-1$
    }

    public static final LoopStatement sample2() {
        Block block = TestBlock.sample2();
        return new LoopStatement(block, query2(), "cursor"); //$NON-NLS-1$
    }
View Full Code Here

    block.addStatement(TestAssignmentStatement.sample1());
      return block;
  }

  public static final Block sample2() {
    Block block = new Block();
    block.addStatement(TestAssignmentStatement.sample2());
    block.addStatement(TestCommandStatement.sample2());
    block.addStatement(TestRaiseErrorStatement.sample2());
    block.addStatement(TestAssignmentStatement.sample2());
      return block;
  }
View Full Code Here

  }
     
  // ################################## ACTUAL TESTS ################################
 
  public void testGetStatements1() {
    Block b1 = sample1();
    List<Statement> stmts = b1.getStatements();
        assertTrue("Incorrect number of statements in the Block", (stmts.size() == 4)); //$NON-NLS-1$
  }
View Full Code Here

    List<Statement> stmts = b1.getStatements();
        assertTrue("Incorrect number of statements in the Block", (stmts.size() == 4)); //$NON-NLS-1$
  }
 
  public void testGetStatements2() {
    Block b1 = sample1();
    Statement stmt = b1.getStatements().get(1);
        assertTrue("Incorrect statement in the Block", stmt.equals(TestCommandStatement.sample1())); //$NON-NLS-1$
  }
View Full Code Here

    Statement stmt = b1.getStatements().get(1);
        assertTrue("Incorrect statement in the Block", stmt.equals(TestCommandStatement.sample1())); //$NON-NLS-1$
  }
 
  public void testaddStatement1() {
    Block b1 = (Block) sample1().clone();
    b1.addStatement(TestCommandStatement.sample2());
        assertTrue("Incorrect number of statements in the Block", (b1.getStatements().size() == 5)); //$NON-NLS-1$
  }
View Full Code Here

    b1.addStatement(TestCommandStatement.sample2());
        assertTrue("Incorrect number of statements in the Block", (b1.getStatements().size() == 5)); //$NON-NLS-1$
  }
 
  public void testaddStatement2() {
    Block b1 = (Block) sample2().clone();
    b1.addStatement(TestCommandStatement.sample2());
    Statement stmt = b1.getStatements().get(4);
        assertTrue("Incorrect statement in the Block", stmt.equals(TestCommandStatement.sample2())); //$NON-NLS-1$
  }
View Full Code Here

    Statement stmt = b1.getStatements().get(4);
        assertTrue("Incorrect statement in the Block", stmt.equals(TestCommandStatement.sample2())); //$NON-NLS-1$
  }

  public void testSelfEquivalence(){
    Block b1 = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, b1, b1);
  }
View Full Code Here

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

  public void testEquivalence(){
    Block b1 = sample1();
    Block b1a = sample1();
    int equals = 0;
    UnitTestUtil.helpTestEquivalence(equals, b1, b1a);
  }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.proc.Block

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.