Author: jdonnerstag
Date: Sat Oct 10 06:24:58 2009
New Revision: 823803

URL: http://svn.apache.org/viewvc?rev=823803&view=rev
Log:
testcase for template example

Added:
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/TemplateTest.java
Removed:
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/com/meterware/httpunit/ParsedHTML.java
Modified:
    
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.html
    
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.java
    
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/pageinheritance/Page1.java
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/AllTests.java
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
    
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.html
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.html?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.html
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.html
 Sat Oct 10 06:24:58 2009
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <html xmlns="http://www.w3.org/1999/xhtml"; >
 <head>
-    <title>Template example, page 1</title>
+    <title wicket:id="title">title comes here</title>
     <link rel="stylesheet" type="text/css" href="style.css"/>
     <link rel="stylesheet" type="text/css" href="template/style.css"/>
 </head>

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.java?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/border/Page1.java
 Sat Oct 10 06:24:58 2009
@@ -17,6 +17,8 @@
 package org.apache.wicket.examples.template.border;
 
 import org.apache.wicket.examples.WicketExamplePage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.model.Model;
 
 
 /**
@@ -31,7 +33,7 @@
         */
        public Page1()
        {
-               super();
+               add(new Label("title", new Model<String>("Template example, 
page 1 - border")));
                add(new TemplateBorder("border"));
        }
 }
\ No newline at end of file

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/pageinheritance/Page1.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/pageinheritance/Page1.java?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/pageinheritance/Page1.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/main/java/org/apache/wicket/examples/template/pageinheritance/Page1.java
 Sat Oct 10 06:24:58 2009
@@ -30,7 +30,7 @@
         */
        public Page1()
        {
-               setPageTitle("Template example, page 1");
+               setPageTitle("Template example, page 1 - page inheritance");
                add(new Panel1("panel1"));
        }
 }
\ No newline at end of file

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/AllTests.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/AllTests.java?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/AllTests.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/AllTests.java
 Sat Oct 10 06:24:58 2009
@@ -16,9 +16,9 @@
  */
 package org.apache.wicket.examples;
 
-import com.meterware.httpunit.HttpUnitOptions;
 import junit.framework.Test;
 import junit.framework.TestSuite;
+
 import org.apache.wicket.examples.ajax.prototype.AjaxTest;
 import org.apache.wicket.examples.compref.ComprefTest;
 import org.apache.wicket.examples.encodings.EncodingTest;
@@ -34,8 +34,11 @@
 import org.apache.wicket.examples.panels.signin.CookieTest;
 import org.apache.wicket.examples.repeater.RepeaterTest;
 import org.apache.wicket.examples.signin2.Signin2Test;
+import org.apache.wicket.examples.template.TemplateTest;
 import org.apache.wicket.util.license.ApacheLicenceHeaderTest;
 
+import com.meterware.httpunit.HttpUnitOptions;
+
 /**
  * All tests in the project; used by Maven.
  */
@@ -69,6 +72,7 @@
                suite.addTestSuite(RepeaterTest.class);
                suite.addTestSuite(ImagesTest.class);
                suite.addTestSuite(LibraryTest.class);
+               suite.addTestSuite(TemplateTest.class);
                suite.addTestSuite(ApacheLicenceHeaderTest.class);
                return new JettyTestCaseDecorator(suite);
        }

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
 Sat Oct 10 06:24:58 2009
@@ -28,16 +28,16 @@
  * Test decorator that starts a jetty instance
  * 
  * @author ivaynberg
- * 
  */
 public class JettyTestCaseDecorator extends TestSetup
 {
-
        private Server server;
        private String contextPath;
        private String webappLocation;
 
        /**
+        * Construct.
+        * 
         * @param test
         */
        public JettyTestCaseDecorator(Test test)
@@ -107,5 +107,4 @@
        {
                this.webappLocation = webappLocation;
        }
-
 }

Added: 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/TemplateTest.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/TemplateTest.java?rev=823803&view=auto
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/TemplateTest.java
 (added)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/examples/template/TemplateTest.java
 Sat Oct 10 06:24:58 2009
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.wicket.examples.template;
+
+import junit.framework.TestCase;
+
+import org.apache.wicket.util.tester.WicketTester;
+
+/**
+ * jWebUnit test for Hello World.
+ */
+public class TemplateTest extends TestCase
+{
+       /**
+        * Test page.
+        * 
+        * @throws Exception
+        */
+       public void test_1() throws Exception
+       {
+               WicketTester tester = new WicketTester(new 
TemplateApplication());
+               tester.startPage(tester.getApplication().getHomePage());
+               String doc = tester.getServletResponse().getDocument();
+               tester.assertContains("Wicket Examples - template");
+               tester.assertContains("This example shows two different ways of 
building your page up from shared parts.");
+
+               
tester.startPage(org.apache.wicket.examples.template.pageinheritance.Page1.class);
+               doc = tester.getServletResponse().getDocument();
+               tester.assertContains("Template example, page 1 - page 
inheritance");
+               tester.assertContains("This is some concrete content from a 
panel.");
+
+               
tester.startPage(org.apache.wicket.examples.template.border.Page1.class);
+               
tester.assertRenderedPage(org.apache.wicket.examples.template.border.Page1.class);
+               doc = tester.getServletResponse().getDocument();
+               tester.assertContains("Template example, page 1 - border");
+               tester.assertContains("contents here");
+       }
+}

Modified: 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java?rev=823803&r1=823802&r2=823803&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java
 (original)
+++ 
wicket/branches/wicket-1.4.x/wicket-examples/src/test/java/org/apache/wicket/util/license/ApacheLicenceHeaderTest.java
 Sat Oct 10 06:24:58 2009
@@ -73,11 +73,5 @@
                 * Configuration files with no "intelligent" content
                 */
                "src/main/java/commons-logging.properties", 
"src/main/java/log4j.properties" };
-
-               javaIgnore = new String[] {
-               /*
-                * MIT style license. See NOTICE
-                */
-               "src/test/java/com/meterware/httpunit/ParsedHTML.java" };
        }
 }


Reply via email to