You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jb...@apache.org on 2007/05/03 18:47:55 UTC
svn commit: r534932 - in
/incubator/wicket/trunk/jdk-1.5/wicket-examples/src: main/testwebapp1/
main/testwebapp1/WEB-INF/ main/testwebapp2/ main/testwebapp2/WEB-INF/
test/java/org/apache/wicket/examples/ test/java/org/apache/wicket/filtertest/
Author: jbq
Date: Thu May 3 09:47:54 2007
New Revision: 534932
URL: http://svn.apache.org/viewvc?view=rev&rev=534932
Log:
* Adding httpunit-based tests for WICKET-40, rename bugTestXXX() to testXXX() to test the failing methods
* Allow to set custom webapp location and context path for JettyTestCaseDecorator
Added:
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java (with props)
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java (with props)
Modified:
incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml Thu May 3 09:47:54 2007
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>Wicket Examples</display-name>
+
+ <!-- only available with servlet spec. 2.4
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping>
+ <locale>de</locale>
+ <encoding>UTF-8</encoding>
+ </locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+ -->
+
+<!--
+ There are three means to configure Wickets configuration mode and they are
+ tested in the order given.
+ 1) A system property: -Dwicket.configuration
+ 2) servlet specific <init-param>
+ 3) context specific <context-param>
+ The value might be either "development" (reloading when templates change)
+ or "deployment". If no configuration is found, "deployment" is the default.
+-->
+ <context-param>
+ <param-name>configuration</param-name>
+ <param-value>deployment</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>FilterTestApplication</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>org.apache.wicket.filtertest.Application</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>FilterTestApplication</filter-name>
+ <url-pattern>/filtertest/*</url-pattern>
+ </filter-mapping>
+</web-app>
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp1/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml Thu May 3 09:47:54 2007
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>Wicket Examples</display-name>
+
+ <!-- only available with servlet spec. 2.4
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping>
+ <locale>de</locale>
+ <encoding>UTF-8</encoding>
+ </locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+ -->
+
+<!--
+ There are three means to configure Wickets configuration mode and they are
+ tested in the order given.
+ 1) A system property: -Dwicket.configuration
+ 2) servlet specific <init-param>
+ 3) context specific <context-param>
+ The value might be either "development" (reloading when templates change)
+ or "deployment". If no configuration is found, "deployment" is the default.
+-->
+ <context-param>
+ <param-name>configuration</param-name>
+ <param-value>deployment</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>FilterTestApplication</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>org.apache.wicket.filtertest.Application</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>FilterTestApplication</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/main/testwebapp2/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Id
Modified: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java?view=diff&rev=534932&r1=534931&r2=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java (original)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java Thu May 3 09:47:54 2007
@@ -34,6 +34,8 @@
{
private Server server;
+ private String contextPath;
+ private String webappLocation;
/**
* @param test
@@ -51,15 +53,25 @@
server.setConnectors(new Connector[] { connector });
WebAppContext web = new WebAppContext();
- web.setContextPath("/wicket-examples");
-
- String basedir = System.getProperty("basedir");
- String path = "";
- if (basedir != null)
- path = basedir + "/";
- path += "src/main/webapp";
-
- web.setWar(path);
+ if (contextPath == null)
+ web.setContextPath("/wicket-examples");
+ else
+ web.setContextPath(contextPath);
+
+ if (webappLocation == null)
+ {
+ String basedir = System.getProperty("basedir");
+ String path = "";
+ if (basedir != null)
+ path = basedir + "/";
+ path += "src/main/webapp";
+
+ web.setWar(path);
+ }
+ else
+ {
+ web.setWar(webappLocation);
+ }
server.addHandler(web);
server.start();
@@ -72,6 +84,26 @@
super.tearDown();
server.stop();
server.join();
+ }
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
+ public void setContextPath(String contextPath)
+ {
+ this.contextPath = contextPath;
+ }
+
+ public String getWebappLocation()
+ {
+ return webappLocation;
+ }
+
+ public void setWebappLocation(String webappLocation)
+ {
+ this.webappLocation = webappLocation;
}
}
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java Thu May 3 09:47:54 2007
@@ -0,0 +1,54 @@
+/*
+ * 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.filtertest;
+
+import org.apache.wicket.examples.WicketExampleApplication;
+
+/**
+ * WicketServlet class for hello world example.
+ *
+ * @author Jonathan Locke
+ */
+public class Application extends WicketExampleApplication
+{
+ /**
+ * Constructor.
+ */
+ public Application()
+ {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.wicket.examples.WicketExampleApplication#init()
+ */
+ @Override
+ protected void init()
+ {
+ mountBookmarkablePage("/hello", HelloWorld.class);
+ }
+
+ /**
+ * @see org.apache.wicket.Application#getHomePage()
+ */
+ public Class getHomePage()
+ {
+ return HelloWorld.class;
+ }
+}
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/Application.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html Thu May 3 09:47:54 2007
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head>
+ <title>Wicket Examples - helloworld</title>
+ <link rel="stylesheet" type="text/css" href="style.css"/>
+</head>
+<body>
+ <span wicket:id="mainNavigation"/>
+ <span wicket:id="message" id="message">Message goes here</span>
+</body>
+</html>
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java Thu May 3 09:47:54 2007
@@ -0,0 +1,39 @@
+/*
+ * 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.filtertest;
+
+import org.apache.wicket.PageParameters;
+import org.apache.wicket.examples.WicketExamplePage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+
+
+/**
+ * Everybody's favorite example!
+ *
+ * @author Jonathan Locke
+ */
+public class HelloWorld extends WicketExamplePage
+{
+ /**
+ * Constructor
+ */
+ public HelloWorld(PageParameters params)
+ {
+ add(new Label("message", "Message is: '" + params.getString("message") + "'"));
+ }
+}
\ No newline at end of file
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/HelloWorld.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java Thu May 3 09:47:54 2007
@@ -0,0 +1,61 @@
+/*
+ * 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.filtertest;
+
+import junit.framework.Test;
+
+import org.apache.wicket.examples.JettyTestCaseDecorator;
+
+
+/**
+ * jWebUnit test for Hello World.
+ */
+public class WithCPWithFPTest extends WithoutCPWithFPTest
+{
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception
+ {
+ getTestContext().setBaseUrl("http://localhost:8098/somecontext");
+ }
+
+ /**
+ * @param name
+ */
+ public WithCPWithFPTest(String name)
+ {
+ super(name);
+ }
+ /**
+ *
+ * @return Test
+ */
+ public static Test suite()
+ {
+ JettyTestCaseDecorator deco = (JettyTestCaseDecorator) suite(WithCPWithFPTest.class);
+ deco.setContextPath("/somecontext");
+ String basedir = System.getProperty("basedir");
+ String path = "";
+ if (basedir != null)
+ path = basedir + "/";
+ path += "src/main/testwebapp1";
+ deco.setWebappLocation(path);
+ return deco;
+ }
+}
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithFPTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java Thu May 3 09:47:54 2007
@@ -0,0 +1,61 @@
+/*
+ * 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.filtertest;
+
+import org.apache.wicket.examples.JettyTestCaseDecorator;
+import org.apache.wicket.examples.WicketWebTestCase;
+
+import junit.framework.Test;
+
+/**
+ * jWebUnit test for Hello World.
+ */
+public class WithCPWithoutFPTest extends WithoutCPWithoutFPTest
+{
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception
+ {
+ getTestContext().setBaseUrl("http://localhost:8098/somecontext");
+ }
+
+ /**
+ * @param name
+ */
+ public WithCPWithoutFPTest(String name)
+ {
+ super(name);
+ }
+ /**
+ *
+ * @return Test
+ */
+ public static Test suite()
+ {
+ JettyTestCaseDecorator deco = (JettyTestCaseDecorator) suite(WithCPWithoutFPTest.class);
+ deco.setContextPath("/somecontext");
+ String basedir = System.getProperty("basedir");
+ String path = "";
+ if (basedir != null)
+ path = basedir + "/";
+ path += "src/main/testwebapp2";
+ deco.setWebappLocation(path);
+ return deco;
+ }
+}
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithCPWithoutFPTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java Thu May 3 09:47:54 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.filtertest;
+
+import org.apache.wicket.examples.JettyTestCaseDecorator;
+import org.apache.wicket.examples.WicketWebTestCase;
+
+import junit.framework.Test;
+
+/**
+ * jWebUnit test for Hello World.
+ */
+public class WithoutCPWithFPTest extends WicketWebTestCase
+{
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception
+ {
+ getTestContext().setBaseUrl("http://localhost:8098/");
+ }
+ /**
+ *
+ * @return Test
+ */
+ public static Test suite()
+ {
+ JettyTestCaseDecorator deco = (JettyTestCaseDecorator) suite(WithoutCPWithFPTest.class);
+ deco.setContextPath("");
+ String basedir = System.getProperty("basedir");
+ String path = "";
+ if (basedir != null)
+ path = basedir + "/";
+ path += "src/main/testwebapp1";
+ deco.setWebappLocation(path);
+ return deco;
+ }
+
+ /**
+ * Construct.
+ *
+ * @param name
+ * name of test
+ */
+ public WithoutCPWithFPTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Test page.
+ *
+ * @throws Exception
+ */
+ public void testHelloWorld() throws Exception
+ {
+ beginAt("/filtertest/hello/message/Test");
+ dumpHtml();
+ assertTitleEquals("Wicket Examples - helloworld");
+ assertTextInElement("message", "Message is: 'Test'");
+ }
+ public void bugTestWithSlash() throws Exception
+ {
+ beginAt("/filtertest/hello/message/Test%2FWith%20a%20Slash");
+ dumpHtml();
+ assertTitleEquals("Wicket Examples - helloworld");
+ assertTextInElement("message", "Message is: 'Test/With a Slash'");
+ }
+}
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java?view=auto&rev=534932
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java (added)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java Thu May 3 09:47:54 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.filtertest;
+
+import org.apache.wicket.examples.JettyTestCaseDecorator;
+import org.apache.wicket.examples.WicketWebTestCase;
+
+import junit.framework.Test;
+
+/**
+ * jWebUnit test for Hello World.
+ */
+public class WithoutCPWithoutFPTest extends WicketWebTestCase
+{
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ public void setUp() throws Exception
+ {
+ getTestContext().setBaseUrl("http://localhost:8098/");
+ }
+ /**
+ *
+ * @return Test
+ */
+ public static Test suite()
+ {
+ JettyTestCaseDecorator deco = (JettyTestCaseDecorator) suite(WithoutCPWithoutFPTest.class);
+ deco.setContextPath("");
+ String basedir = System.getProperty("basedir");
+ String path = "";
+ if (basedir != null)
+ path = basedir + "/";
+ path += "src/main/testwebapp2";
+ deco.setWebappLocation(path);
+ return deco;
+ }
+
+ /**
+ * Construct.
+ *
+ * @param name
+ * name of test
+ */
+ public WithoutCPWithoutFPTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Test page.
+ *
+ * @throws Exception
+ */
+ public void testHelloWorld() throws Exception
+ {
+ beginAt("/hello/message/Test");
+ dumpHtml();
+ assertTitleEquals("Wicket Examples - helloworld");
+ assertTextInElement("message", "Message is: 'Test'");
+ }
+ public void bugTestWithSlash() throws Exception
+ {
+ beginAt("/hello/message/Test%2FWith%20a%20Slash");
+ dumpHtml();
+ assertTitleEquals("Wicket Examples - helloworld");
+ assertTextInElement("message", "Message is: 'Test/With a Slash'");
+ }
+}
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java
------------------------------------------------------------------------------
svn:keywords = Id