public static final CreateProcedureCommand sample2() { return new CreateProcedureCommand(TestBlock.sample2()); }
public static final WhileStatement sample2() { Block block = TestBlock.sample2(); Criteria criteria = TestSetCriteria.sample2(); return new WhileStatement(criteria, block); }
public static final CreateProcedureCommand sample1() { return new CreateProcedureCommand(TestBlock.sample1()); }
public static final LoopStatement sample2() { Block block = TestBlock.sample2(); return new LoopStatement(block, query2(), "cursor"); //$NON-NLS-1$ }
public static final CreateProcedureCommand sample3() { return new CreateProcedureCommand(TestBlock.sample1()); }
public static final WhileStatement sample1() { Block block = TestBlock.sample1(); Criteria criteria = TestSetCriteria.sample1(); return new WhileStatement(criteria, block); }
@Test public void testaddStatement2() { Block b1 = 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$ }
@Test public void testSelfEquivalence(){ Block b1 = sample1(); int equals = 0; UnitTestUtil.helpTestEquivalence(equals, b1, b1); }
public void testGetElseBlock() { IfStatement b1 = sample1(); assertTrue("Incorrect IfBlock on statement", b1.getElseBlock().equals(TestBlock.sample2())); //$NON-NLS-1$ }
public static final LoopStatement sample1() { Block block = TestBlock.sample1(); return new LoopStatement(block, query1(), "cursor"); //$NON-NLS-1$ }
@Test 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$ }
@Test 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$ }
@Test public void testClone() { Block b1 = sample1(); Block b2 = b1.clone(); UnitTestUtil.helpTestEquivalence(0, b1, b2); assertNotSame(b1.getStatements().get(0), b2.getStatements().get(0)); }
public void testGetIfBlock() { IfStatement b1 = sample1(); assertTrue("Incorrect IfBlock on statement", b1.getIfBlock().equals(TestBlock.sample1())); //$NON-NLS-1$ }
public void testCloneNonSimpleQuery(){ Block block = TestBlock.sample1(); LoopStatement ls = new LoopStatement(block, TestSetQuery.sample1(), "cursor"); //$NON-NLS-1$ LoopStatement clone = (LoopStatement) ls.clone(); UnitTestUtil.helpTestEquivalence(0, ls, clone); }