01: /*
02: * $Id: DummyHomePage.java 459068 2006-02-08 18:54:51Z jonl $
03: * $Revision: 459068 $ $Date: 2006-02-08 19:54:51 +0100 (Wed, 08 Feb 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the 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.util.tester;
19:
20: import wicket.markup.html.WebPage;
21: import wicket.markup.html.link.Link;
22:
23: /**
24: * A dummy homepage required by WicketTester only
25: *
26: * @author Ingram Chen
27: */
28: public class DummyHomePage extends WebPage {
29: private static final long serialVersionUID = 1L;
30:
31: private ITestPageSource testPageSource;
32:
33: private Link testPageLink;
34:
35: /**
36: * Construct
37: */
38: public DummyHomePage() {
39: testPageLink = new TestLink("testPage");
40: add(testPageLink);
41: }
42:
43: /**
44: *
45: * @param testPageSource
46: */
47: public void setTestPageSource(ITestPageSource testPageSource) {
48: this .testPageSource = testPageSource;
49: }
50:
51: /**
52: *
53: * @return Link
54: */
55: public Link getTestPageLink() {
56: return testPageLink;
57: }
58:
59: /**
60: *
61: */
62: public class TestLink extends Link {
63: private static final long serialVersionUID = 1L;
64:
65: /**
66: *
67: * @param id
68: */
69: public TestLink(String id) {
70: super (id);
71: }
72:
73: /**
74: *
75: */
76: public void onClick() {
77: setResponsePage(testPageSource.getTestPage());
78: }
79: }
80: }
|