01: // Copyright © 2002-2005 Canoo Engineering AG, Switzerland.
02: package com.canoo.webtest.steps.verify;
03:
04: import com.canoo.webtest.engine.StepExecutionException;
05: import com.canoo.webtest.self.TestBlock;
06: import com.canoo.webtest.self.ThrowAssert;
07: import com.canoo.webtest.steps.BaseStepTestCase;
08: import com.canoo.webtest.steps.Step;
09:
10: public class AbstractVerifyTextTest extends BaseStepTestCase {
11:
12: protected Step createStep() {
13: return new AbstractVerifyTextStub();
14: }
15:
16: public void testNoPreviousPage() throws Exception {
17: final AbstractVerifyTextStep step = (AbstractVerifyTextStep) getStep();
18: step.setText("dummy");
19: assertStepRejectsNullResponse(step);
20: }
21:
22: public void testDoExecuteForCoverage() throws Exception {
23: new AbstractVerifyTextStub().doExecute();
24: }
25:
26: public void testAllVerificationsShouldCallVerifyTextParameter() {
27: ThrowAssert.assertThrows(StepExecutionException.class,
28: new TestBlock() {
29: public void call() throws Exception {
30: executeStep(getStep());
31: }
32: });
33: }
34:
35: protected static class AbstractVerifyTextStub extends
36: AbstractVerifyTextStep {
37: public void doExecute() {
38: }
39:
40: // to get it into the list of declared methods
41: public void setText(String newText) {
42: super.setText(newText);
43: }
44:
45: }
46: }
|