e.g. continue; continue $a;
continue; continue $a;
ContinueStatement : continue [no LineTerminator here] [Identifier] ;
This class represents a continue statement in the storedprocedure language. It extends the Statement that could part of a block.
Statement
215216217218219220221222223
return c; } @Override public AstNode continueStatement(AstNode label) { ContinueStatement c = new ContinueStatement(); c.setLabel(cast(label, Name.class)); return c; }
54845485548654875488548954905491
Statement breakStmt = new BreakStatement(); helpStmtTest("break;", "BREAK;", breakStmt); //$NON-NLS-1$ //$NON-NLS-2$ } @Test public void testContinueStatement() throws Exception { Statement contStmt = new ContinueStatement(); helpStmtTest("continue;", "CONTINUE;", contStmt); //$NON-NLS-1$ //$NON-NLS-2$ }
55135514551555165517551855195520552155225523
Statement assignmentStmt = new AssignmentStatement(x, c1); Block block = new Block(); block.addStatement(assignmentStmt); Block ifBlock = new Block(); Statement continueStmt = new ContinueStatement(); ifBlock.addStatement(continueStmt); Criteria crit = new CompareCriteria(x, CompareCriteria.GT, new Constant(new Integer(5))); IfStatement ifStmt = new IfStatement(crit, ifBlock); block.addStatement(ifStmt);
65666768697071
} public void testNonEquivalence(){ BreakStatement s1 = sample1(); int equals = -1; UnitTestUtil.helpTestEquivalence(equals, s1, new ContinueStatement()); }
47484950515253
} // ################################## TEST HELPERS ################################ public static final ContinueStatement sample1() { return new ContinueStatement(); }
51525354555657
public static final ContinueStatement sample1() { return new ContinueStatement(); } public static final ContinueStatement sample2() { return new ContinueStatement(); }
575859606162636465
} // ################################## ACTUAL TESTS ################################ public void testSelfEquivalence(){ ContinueStatement s1 = sample1(); int equals = 0; UnitTestUtil.helpTestEquivalence(equals, s1, s1); }
63646566676869707172
int equals = 0; UnitTestUtil.helpTestEquivalence(equals, s1, s1); } public void testEquivalence(){ ContinueStatement s1 = sample1(); ContinueStatement s1a = sample2(); int equals = 0; UnitTestUtil.helpTestEquivalence(equals, s1, s1a); }
707172737475767778
int equals = 0; UnitTestUtil.helpTestEquivalence(equals, s1, s1a); } public void testNonEquivalence(){ ContinueStatement s1 = sample1(); int equals = -1; UnitTestUtil.helpTestEquivalence(equals, s1, new BreakStatement()); }