001: /*
002: * $Id: MarkupInheritanceTest.java 461190 2006-06-28 06:35:51Z ehillenius $
003: * $Revision: 461190 $
004: * $Date: 2006-06-28 08:35:51 +0200 (Wed, 28 Jun 2006) $
005: *
006: * ====================================================================
007: * Licensed under the Apache License, Version 2.0 (the "License");
008: * you may not use this file except in compliance with the License.
009: * You may obtain a copy of the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS,
015: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016: * See the License for the specific language governing permissions and
017: * limitations under the License.
018: */
019: package wicket.markup;
020:
021: import org.apache.commons.logging.Log;
022: import org.apache.commons.logging.LogFactory;
023:
024: import wicket.WicketTestCase;
025: import wicket.markup.html.link.Link;
026: import wicket.util.diff.DiffUtil;
027:
028: /**
029: */
030: public class MarkupInheritanceTest extends WicketTestCase {
031: private static final Log log = LogFactory
032: .getLog(MarkupInheritanceTest.class);
033:
034: /**
035: * Create the test.
036: *
037: * @param name
038: * The test name
039: */
040: public MarkupInheritanceTest(String name) {
041: super (name);
042: }
043:
044: /**
045: * @throws Exception
046: */
047: public void testRenderHomePage_1() throws Exception {
048: executeTest(MarkupInheritanceExtension_1.class,
049: "MarkupInheritanceExpectedResult_1.html");
050: }
051:
052: /**
053: * @throws Exception
054: */
055: public void testRenderHomePage_2() throws Exception {
056: executeTest(MarkupInheritanceExtension_2.class,
057: "MarkupInheritanceExpectedResult_2.html");
058: }
059:
060: /**
061: * @throws Exception
062: */
063: public void testRenderHomePage_3() throws Exception {
064: executeTest(MarkupInheritanceExtension_3.class,
065: "MarkupInheritanceExpectedResult_3.html");
066: }
067:
068: /**
069: * @throws Exception
070: */
071: public void testRenderHomePage_4() throws Exception {
072: System.out
073: .println("=== "
074: + MarkupInheritanceExtension_4.class.getName()
075: + " ===");
076:
077: application.setHomePage(MarkupInheritanceExtension_4.class);
078:
079: // Do the processing
080: application.setupRequestAndResponse();
081: application.processRequestCycle();
082:
083: // Validate the document
084: assertEquals(MarkupInheritanceExtension_4.class, application
085: .getLastRenderedPage().getClass());
086: String document = application.getServletResponse()
087: .getDocument();
088: assertTrue(DiffUtil.validatePage(document, this .getClass(),
089: "MarkupInheritanceExpectedResult_4.html"));
090:
091: MarkupInheritanceExtension_4 page = (MarkupInheritanceExtension_4) application
092: .getLastRenderedPage();
093:
094: Link link = (Link) page.get("link");
095: application.setupRequestAndResponse();
096: application.getServletRequest().setRequestToComponent(link);
097: application.processRequestCycle();
098:
099: assertEquals(MarkupInheritanceExtension_4.class, application
100: .getLastRenderedPage().getClass());
101:
102: document = application.getServletResponse().getDocument();
103: assertTrue(DiffUtil.validatePage(document, this .getClass(),
104: "MarkupInheritanceExpectedResult_4-1.html"));
105: }
106:
107: /**
108: * @throws Exception
109: */
110: public void testRenderHomePage_5() throws Exception {
111: executeTest(MarkupInheritanceExtension_5.class,
112: "MarkupInheritanceExpectedResult_5.html");
113: }
114:
115: /**
116: * @throws Exception
117: */
118: public void testRenderHomePage_6() throws Exception {
119: executeTest(MarkupInheritancePage_6.class,
120: "MarkupInheritanceExpectedResult_6.html");
121: }
122:
123: /**
124: * @throws Exception
125: */
126: public void testRenderHomePage_7() throws Exception {
127: executeTest(MarkupInheritanceExtension_7.class,
128: "MarkupInheritanceExpectedResult_7.html");
129: }
130:
131: /**
132: * @throws Exception
133: */
134: public void testRenderHomePage_8() throws Exception {
135: application.getMarkupSettings().setStripWicketTags(true);
136: executeTest(MarkupInheritanceExtension_8.class,
137: "MarkupInheritanceExpectedResult_8.html");
138: }
139:
140: /**
141: * @throws Exception
142: */
143: public void testRenderHomePage_9() throws Exception {
144: executeTest(MarkupInheritancePage_9.class,
145: "MarkupInheritanceExpectedResult_9.html");
146: }
147:
148: /**
149: * @throws Exception
150: */
151: public void testRenderHomePage_10() throws Exception {
152: executeTest(MarkupInheritanceExtension_10.class,
153: "MarkupInheritanceExpectedResult_10.html");
154: }
155:
156: /**
157: * @throws Exception
158: */
159: public void testRenderHomePage_11() throws Exception {
160: executeTest(MarkupInheritanceExtension_11.class,
161: "MarkupInheritanceExpectedResult_11.html");
162: }
163:
164: /**
165: * @throws Exception
166: */
167: public void testRenderHomePage_12() throws Exception {
168: executeTest(MarkupInheritanceExtension_12.class,
169: "MarkupInheritanceExpectedResult_12.html");
170: }
171: }
|