01: /*
02: * $Id: RadioGroupTest.java,v 1.6 2006/01/14 00:54:32 ivaynberg Exp $ $Revision:
03: * 1.1 $ $Date: 2006/01/14 00:54:32 $
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:
19: package wicket.markup.html.internal;
20:
21: import wicket.WicketTestCase;
22:
23: /**
24: * Test for the {@link wicket.markup.html.internal.HtmlHeaderContainer}.
25: *
26: * @author svenmeier
27: */
28: public class HtmlHeaderContainerTest extends WicketTestCase {
29: /**
30: * Construct.
31: * @param name
32: */
33: public HtmlHeaderContainerTest(String name) {
34: super (name);
35: }
36:
37: /**
38: * Test clean-up of auto added components after removal of the
39: * HtmlHeaderContainer.
40: */
41: public void testCleanUpOfAutoAddedComponents() {
42: application.setHomePage(ComponentResolvingPage.class);
43: application.setupRequestAndResponse();
44: application.processRequestCycle();
45:
46: // onEndRequest() of auto added component was not called in
47: // MarkupContainer#internalEndRequest() using an iterator
48: ComponentResolvingPage page = (ComponentResolvingPage) application
49: .getLastRenderedPage();
50: assertTrue("onEndRequest() should be called",
51: page.onEndRequestWasCalledOnAutoAddedComponent);
52: }
53: }
|