Updated Branches: refs/heads/master d56125aad -> 6be1e79db refs/heads/wicket-1.5.x 70101b03e -> 9d4fa80eb
WICKET-4681 tests only for 6.x Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/6be1e79d Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/6be1e79d Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/6be1e79d Branch: refs/heads/master Commit: 6be1e79dbbbd807e1e41036ec11a414a92c43301 Parents: d56125a Author: Carl-Eric Menzel <cmen...@wicketbuch.de> Authored: Fri Jul 27 17:53:20 2012 +0200 Committer: Carl-Eric Menzel <cmen...@wicketbuch.de> Committed: Fri Jul 27 18:09:04 2012 +0200 ---------------------------------------------------------------------- .../autolink/AutoLinkInPanelsTest$TestPage.html | 6 + .../markup/html/autolink/AutoLinkInPanelsTest.java | 78 +++++++++++++++ .../wicket/markup/html/autolink/sub/LogoPanel.html | 10 ++ .../wicket/markup/html/autolink/sub/LogoPanel.java | 31 ++++++ .../wicket/markup/html/autolink/sub/logo.png | 1 + .../wicket/markup/html/autolink/sub/logo2.png | 1 + 6 files changed, 127 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest$TestPage.html ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest$TestPage.html b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest$TestPage.html new file mode 100644 index 0000000..a38c3de --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest$TestPage.html @@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html xmlns:wicket="http://wicket.apache.org"> + <body> + <div wicket:id="logo"></div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest.java new file mode 100644 index 0000000..ec62e47 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/AutoLinkInPanelsTest.java @@ -0,0 +1,78 @@ +/* + * 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.markup.html.autolink; + +import org.apache.wicket.Page; +import org.apache.wicket.WicketTestCase; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.autolink.sub.LogoPanel; +import org.apache.wicket.protocol.http.WebApplication; +import org.apache.wicket.util.tester.WicketTester; +import org.junit.Before; +import org.junit.Test; + +/** + * Test for WICKET-4681 + * + * @author Carl-Eric Menzel + */ +public class AutoLinkInPanelsTest extends WicketTestCase +{ + public static class TestPage extends WebPage + { + public TestPage() + { + add(new LogoPanel("logo")); + } + } + + @Before + public void setUp() + { + tester = new WicketTester(new WebApplication() + { + + @Override + public Class<? extends Page> getHomePage() + { + return TestPage.class; + } + + @Override + protected void init() + { + super.init(); + getMarkupSettings().setAutomaticLinking(true); + } + }); + } + + @Test + public void imgTagWorksInPanelWithExtraContainer() throws Exception + { + tester.startPage(TestPage.class); + tester.dumpPage(); + tester.assertContains("<img src=\"\\./wicket/resource/org.apache.wicket.markup.html.autolink.sub.LogoPanel/logo-ver-\\d+.png\"/>"); + } + + @Test + public void imgTagWorksInPanelWithoutExtraContainer() throws Exception + { + tester.startPage(TestPage.class); + tester.assertContains("<img src=\"\\./wicket/resource/org.apache.wicket.markup.html.autolink.sub.LogoPanel/logo2-ver-\\d+.png\"/>"); + } +} http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.html ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.html b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.html new file mode 100644 index 0000000..66c030a --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.html @@ -0,0 +1,10 @@ +<wicket:panel> +<div> +<span wicket:id="label"></span> +<span wicket:id="container"> +<img src="logo.png"/> +<a href="HomePage.html"/> +</span> +<img src="logo2.png"/> +</div> +</wicket:panel> http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.java ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.java new file mode 100644 index 0000000..a416bfd --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/LogoPanel.java @@ -0,0 +1,31 @@ +/* + * 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.markup.html.autolink.sub; + +import org.apache.wicket.markup.html.WebMarkupContainer; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.panel.Panel; + +public class LogoPanel extends Panel +{ + public LogoPanel(String id) + { + super(id); + add(new Label("label", "label")); + add(new WebMarkupContainer("container")); + } +} http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo.png ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo.png b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo.png new file mode 100644 index 0000000..6e01540 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo.png @@ -0,0 +1 @@ +...just a dummy resource... http://git-wip-us.apache.org/repos/asf/wicket/blob/6be1e79d/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo2.png ---------------------------------------------------------------------- diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo2.png b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo2.png new file mode 100644 index 0000000..6e01540 --- /dev/null +++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/autolink/sub/logo2.png @@ -0,0 +1 @@ +...just a dummy resource...