01: /*
02: * $Id: NiceUrlTest.java 460266 2006-04-16 13:42:28Z jdonnerstag $ $Revision: 460266 $
03: * $Date: 2006-04-16 15:42:28 +0200 (Sun, 16 Apr 2006) $
04: *
05: * ==================================================================== Licensed
06: * under the Apache License, Version 2.0 (the "License"); you may not use this
07: * file except in compliance with the License. You may obtain a copy of the
08: * License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.examples.niceurl;
19:
20: import junit.framework.Test;
21: import wicket.examples.WicketWebTestCase;
22:
23: /**
24: * jWebUnit test for Hello World.
25: */
26: public class NiceUrlTest extends WicketWebTestCase {
27: /**
28: *
29: * @return Test
30: */
31: public static Test suite() {
32: return suite(NiceUrlTest.class);
33: }
34:
35: /**
36: * Construct.
37: *
38: * @param name
39: * name of test
40: */
41: public NiceUrlTest(String name) {
42: super (name);
43: }
44:
45: /**
46: * Test page.
47: *
48: * @throws Exception
49: */
50: public void testHelloWorld() throws Exception {
51: beginAt("/niceurl");
52: this .dumpResponse(System.out);
53: assertTitleEquals("Wicket Examples - niceurl");
54: assertTextPresent("This example displays how you can work with 'nice' urls for bookmarkable pages.");
55:
56: this
57: .clickLinkWithText("Click this BookmarkablePageLink to go to Page 1");
58: assertTitleEquals("Wicket Examples - niceurl");
59:
60: this .clickLinkWithText("[go back]");
61: assertTitleEquals("Wicket Examples - niceurl");
62: this
63: .clickLinkWithText("Click this BookmarkablePageLink to go to Page 2");
64: assertTitleEquals("Wicket Examples - niceurl");
65:
66: this .clickLinkWithText("[go back]");
67: assertTitleEquals("Wicket Examples - niceurl");
68: this
69: .clickLinkWithText("Click this BookmarkablePageLink to go to Page 3");
70: assertTitleEquals("Wicket Examples - niceurl");
71:
72: this .clickLinkWithText("[go back]");
73: assertTitleEquals("Wicket Examples - niceurl");
74: this
75: .clickLinkWithText("Click this BookmarkablePageLink to go to Page 4");
76: assertTitleEquals("Wicket Examples - niceurl");
77:
78: this .clickLinkWithText("[go back]");
79: assertTitleEquals("Wicket Examples - niceurl");
80: this
81: .clickLinkWithText("Click this BookmarkablePageLink to go to Page 5");
82: assertTitleEquals("Wicket Examples - niceurl");
83: }
84: }
|