01: // Copyright © 2004-2007 ASERT. Released under the Canoo Webtest license.
02: package com.canoo.webtest.extension.dialogs;
03:
04: import com.canoo.webtest.steps.Step;
05: import com.canoo.webtest.steps.control.BaseWrappedStepTestCase;
06: import com.canoo.webtest.self.ThrowAssert;
07: import com.canoo.webtest.self.TestBlock;
08: import com.canoo.webtest.engine.StepFailedException;
09: import org.apache.tools.ant.taskdefs.Echo;
10:
11: /**
12: * Test class for {@link com.canoo.webtest.extension.dialogs.ExpectDialogs}.<p>
13: *
14: * @author Paul King, ASERT
15: */
16: public class ExpectDialogsTest extends BaseWrappedStepTestCase {
17: protected Step createStep() {
18: return new ExpectDialogs();
19: }
20:
21: public void testNonDialogThrowsException() {
22: ThrowAssert.assertThrows(StepFailedException.class,
23: "Not a dialog step", new TestBlock() {
24: public void call() throws Throwable {
25: ((ExpectDialogs) createStep())
26: .addTask(new Echo());
27: }
28: });
29: }
30: }
|