You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2015/07/29 17:12:22 UTC

[1/3] wicket git commit: Reproduced WICKET-5898

Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x ff0e82620 -> 94db8a9ad


Reproduced WICKET-5898

This testcase reproduces WICKET-5898. It contains 3 test methods
of which 2 are @ignored. You should remove the @ignore to trigger
the StackOverflowError when testing.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/8c62ecd9
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/8c62ecd9
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/8c62ecd9

Branch: refs/heads/wicket-6.x
Commit: 8c62ecd9d5f6e16ab46c357057849cd5dab4ef14
Parents: ff0e826
Author: Martijn Dashorst <ma...@gmail.com>
Authored: Fri May 1 18:18:55 2015 +0200
Committer: Andrea Del Bene (Innoteam) <an...@innoteam.it>
Committed: Wed Jul 29 12:19:51 2015 +0200

----------------------------------------------------------------------
 .../transparentresolvers/TestWicket5898.java    | 104 +++++++++++++++++++
 .../transparentresolvers/Wicket5898Page.html    |  10 ++
 .../transparentresolvers/Wicket5898Page.java    |  66 ++++++++++++
 .../transparentresolvers/Wicket5898Page2.html   |  10 ++
 .../transparentresolvers/Wicket5898Page2.java   |  64 ++++++++++++
 5 files changed, 254 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/8c62ecd9/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
new file mode 100644
index 0000000..f154948
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
@@ -0,0 +1,104 @@
+/*
+ * 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.queueing.transparentresolvers;
+
+import org.apache.wicket.util.tester.WicketTester;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This page causes a {@code StackOverflowError} when trying to update the component {@code label}
+ * from an Ajax request. The page renders normally in normal page requests or fallback requests.
+ *
+ * Things of note: the test passes when you add the {@code TransparentWebMarkupContainer} as the
+ * first component to the page, instead of it being the last component to be added.
+ *
+ * It appears that the {@code src} attribute of the {@code <img>} tag inside the {@code group}
+ * {@code WebMarkupContainer} is significant in triggering this bug. Removing the {@code group} or
+ * the {@code src} attribute lets the test pass.
+ */
+public class TestWicket5898
+{
+	private WicketTester tester;
+
+	/**
+	 * Sets up the tester.
+	 */
+	@Before
+	public void setUp()
+	{
+		tester = new WicketTester();
+	}
+
+	/**
+	 * This test should pass, it is just here to validate that the page renders initially, and using
+	 * a normal, non-AJAX request cycle.
+	 */
+	@Test
+	public void normalRequestDoesntCauseStackOverflow()
+	{
+		tester.startPage(Wicket5898Page.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page.class);
+
+		// the page renders normally when clicking on a link without using AJAX
+		tester.clickLink("link", false);
+		tester.assertRenderedPage(Wicket5898Page.class);
+	}
+
+	/**
+	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
+	 * TransparentWebMarkupContainers is updated. This particular test case is caused by Wicket's
+	 * insertion of a TransparentWebMarkupContainer automatically due to a {@code src} attribute
+	 * that might need rewriting.
+	 */
+	@Test
+	@Ignore("This test fails, should be enabled to trigger WICKET-5898")
+	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow()
+	{
+		tester.startPage(Wicket5898Page.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page.class);
+
+		// without WICKET-5898 fixed the statement below causes a StackOverflowError
+		tester.clickLink("link", true);
+		tester.assertComponentOnAjaxResponse("label");
+	}
+
+	/**
+	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
+	 * TransparentWebMarkupContainers is updated. This particular test case is caused by having two
+	 * TransparentWebMarkupContainers nested and trying to update a label that was added to the
+	 * outer TWMC.
+	 */
+	@Test
+	@Ignore("This test fails, should be enabled to trigger WICKET-5898")
+	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow2()
+	{
+		tester.startPage(Wicket5898Page2.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page2.class);
+
+		// without WICKET-5898 fixed the statement below causes a StackOverflowError
+		tester.clickLink("link", true);
+		tester.assertComponentOnAjaxResponse("label");
+	}
+}

http://git-wip-us.apache.org/repos/asf/wicket/blob/8c62ecd9/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.html b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.html
new file mode 100644
index 0000000..f3a861c
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html xmlns:wicket="http://wicket.apache.org">
+<body>
+	<div wicket:id="twmc">
+		<span wicket:id="label"></span>
+		<span wicket:id="group"><img src="foo.gif"></span>
+	</div>
+	<a href="#" wicket:id="link"></a>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/8c62ecd9/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.java
new file mode 100644
index 0000000..58dd9f9
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page.java
@@ -0,0 +1,66 @@
+/*
+ * 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.queueing.transparentresolvers;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+
+/**
+ * A test page for triggering a StackOverflowError when updating a component inside a
+ * {@link TransparentWebMarkupContainer} using AJAX.
+ */
+public class Wicket5898Page extends WebPage
+{
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor
+	 */
+	public Wicket5898Page()
+	{
+		final Label label = new Label("label", "Label");
+		label.setOutputMarkupId(true);
+		add(label);
+
+		// The src attribute of the image tag inside this WebMarkupContainer is
+		// essential in triggering this bug. This causes Wicket to insert an
+		// autocomponent (also a TransparentWebMarkupContainer)
+		add(new WebMarkupContainer("group"));
+
+		// if you add this TransparentWebMarkupContainer as first component in
+		// the page (i.e. move line 50 to line 39), the test passes
+		add(new TransparentWebMarkupContainer("twmc"));
+
+		// a non-AJAX click on this link passes the test case, an AJAX request
+		// fails with a StackOverflowError
+		add(new AjaxFallbackLink<Void>("link")
+		{
+			private static final long serialVersionUID = 1L;
+
+			@Override
+			public void onClick(AjaxRequestTarget target)
+			{
+				if (target != null)
+					target.add(label);
+			}
+		});
+	}
+}

http://git-wip-us.apache.org/repos/asf/wicket/blob/8c62ecd9/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.html b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.html
new file mode 100644
index 0000000..9c60648
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html xmlns:wicket="http://wicket.apache.org">
+<body>
+	<div wicket:id="twmc">
+		<span wicket:id="label"></span>
+		<span wicket:id="group"></span>
+	</div>
+	<a href="#" wicket:id="link"></a>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/8c62ecd9/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.java
new file mode 100644
index 0000000..1a85c72
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Page2.java
@@ -0,0 +1,64 @@
+/*
+ * 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.queueing.transparentresolvers;
+
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+
+/**
+ * A test page for triggering a StackOverflowError when updating a component inside a
+ * {@link TransparentWebMarkupContainer} using AJAX.
+ */
+public class Wicket5898Page2 extends WebPage
+{
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor.
+	 */
+	public Wicket5898Page2()
+	{
+		final Label label = new Label("label", "Label");
+		label.setOutputMarkupId(true);
+		add(label);
+
+		// Adding a TransparentWebMarkupContainer to the outer TransparentWebMarkupContainer causes
+		// a StackOverflowException
+		add(new TransparentWebMarkupContainer("group"));
+
+		// if you add this TransparentWebMarkupContainer as first component in
+		// the page (i.e. move line 48 to line 38), the test passes
+		add(new TransparentWebMarkupContainer("twmc"));
+
+		// a non-AJAX click on this link passes the test case, an AJAX request
+		// fails with a StackOverflowError
+		add(new AjaxFallbackLink<Void>("link")
+		{
+			private static final long serialVersionUID = 1L;
+
+			@Override
+			public void onClick(AjaxRequestTarget target)
+			{
+				if (target != null)
+					target.add(label);
+			}
+		});
+	}
+}


[3/3] wicket git commit: WICKET-5898 Rename the test case to ends with Test. This way it is actually picked by m-surefire-p.

Posted by ad...@apache.org.
WICKET-5898 Rename the test case to ends with Test. This way it is actually picked by m-surefire-p.

Extend from WicketTestCase so that WicketTester is closed after test execution.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/94db8a9a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/94db8a9a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/94db8a9a

Branch: refs/heads/wicket-6.x
Commit: 94db8a9adae1e318486fcb6e10ea99dc76bf91b5
Parents: 33879a8
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Sun May 3 09:46:34 2015 +0300
Committer: Andrea Del Bene (Innoteam) <an...@innoteam.it>
Committed: Wed Jul 29 13:03:41 2015 +0200

----------------------------------------------------------------------
 .../transparentresolvers/TestWicket5898.java    | 103 -------------------
 .../transparentresolvers/Wicket5898Test.java    |  89 ++++++++++++++++
 2 files changed, 89 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/94db8a9a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
deleted file mode 100644
index 453e297..0000000
--- a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.queueing.transparentresolvers;
-
-import org.apache.wicket.util.tester.WicketTester;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * This page causes a {@code StackOverflowError} when trying to update the component {@code label}
- * from an Ajax request. The page renders normally in normal page requests or fallback requests.
- *
- * Things of note: the test passes when you add the {@code TransparentWebMarkupContainer} as the
- * first component to the page, instead of it being the last component to be added.
- *
- * It appears that the {@code src} attribute of the {@code <img>} tag inside the {@code group}
- * {@code WebMarkupContainer} is significant in triggering this bug. Removing the {@code group} or
- * the {@code src} attribute lets the test pass.
- */
-public class TestWicket5898
-{
-	private WicketTester tester;
-
-	/**
-	 * Sets up the tester.
-	 */
-	@Before
-	public void setUp()
-	{
-		tester = new WicketTester();
-	}
-
-	/**
-	 * This test should pass, it is just here to validate that the page renders initially, and using
-	 * a normal, non-AJAX request cycle.
-	 */
-	@Test
-	public void normalRequestDoesntCauseStackOverflow()
-	{
-		tester.startPage(Wicket5898Page.class);
-
-		// the page renders normally using normal web requests
-		tester.assertRenderedPage(Wicket5898Page.class);
-
-		// the page renders normally when clicking on a link without using AJAX
-		tester.clickLink("link", false);
-		tester.assertRenderedPage(Wicket5898Page.class);
-	}
-
-	/**
-	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
-	 * TransparentWebMarkupContainers is updated. This particular test case is caused by Wicket's
-	 * insertion of a TransparentWebMarkupContainer automatically due to a {@code src} attribute
-	 * that might need rewriting.
-	 */
-	@Test
-	//@Ignore("This test fails, should be enabled to trigger WICKET-5898")
-	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow()
-	{
-		tester.startPage(Wicket5898Page.class);
-
-		// the page renders normally using normal web requests
-		tester.assertRenderedPage(Wicket5898Page.class);
-
-		// without WICKET-5898 fixed the statement below causes a StackOverflowError
-		tester.clickLink("link", true);
-		tester.assertComponentOnAjaxResponse("label");
-	}
-
-	/**
-	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
-	 * TransparentWebMarkupContainers is updated. This particular test case is caused by having two
-	 * TransparentWebMarkupContainers nested and trying to update a label that was added to the
-	 * outer TWMC.
-	 */
-	@Test
-	//@Ignore("This test fails, should be enabled to trigger WICKET-5898")
-	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow2()
-	{
-		tester.startPage(Wicket5898Page2.class);
-
-		// the page renders normally using normal web requests
-		tester.assertRenderedPage(Wicket5898Page2.class);
-
-		// without WICKET-5898 fixed the statement below causes a StackOverflowError
-		tester.clickLink("link", true);
-		tester.assertComponentOnAjaxResponse("label");
-	}
-}

http://git-wip-us.apache.org/repos/asf/wicket/blob/94db8a9a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Test.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Test.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Test.java
new file mode 100644
index 0000000..47f27d5
--- /dev/null
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/Wicket5898Test.java
@@ -0,0 +1,89 @@
+/*
+ * 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.queueing.transparentresolvers;
+
+import org.apache.wicket.WicketTestCase;
+import org.junit.Test;
+
+/**
+ * This page causes a {@code StackOverflowError} when trying to update the component {@code label}
+ * from an Ajax request. The page renders normally in normal page requests or fallback requests.
+ *
+ * Things of note: the test passes when you add the {@code TransparentWebMarkupContainer} as the
+ * first component to the page, instead of it being the last component to be added.
+ *
+ * It appears that the {@code src} attribute of the {@code <img>} tag inside the {@code group}
+ * {@code WebMarkupContainer} is significant in triggering this bug. Removing the {@code group} or
+ * the {@code src} attribute lets the test pass.
+ */
+public class Wicket5898Test extends WicketTestCase
+{
+	/**
+	 * This test should pass, it is just here to validate that the page renders initially, and using
+	 * a normal, non-AJAX request cycle.
+	 */
+	@Test
+	public void normalRequestDoesntCauseStackOverflow()
+	{
+		tester.startPage(Wicket5898Page.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page.class);
+
+		// the page renders normally when clicking on a link without using AJAX
+		tester.clickLink("link", false);
+		tester.assertRenderedPage(Wicket5898Page.class);
+	}
+
+	/**
+	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
+	 * TransparentWebMarkupContainers is updated. This particular test case is caused by Wicket's
+	 * insertion of a TransparentWebMarkupContainer automatically due to a {@code src} attribute
+	 * that might need rewriting.
+	 */
+	@Test
+	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow()
+	{
+		tester.startPage(Wicket5898Page.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page.class);
+
+		// without WICKET-5898 fixed the statement below causes a StackOverflowError
+		tester.clickLink("link", true);
+		tester.assertComponentOnAjaxResponse("label");
+	}
+
+	/**
+	 * Tests the WICKET-5898 issue of triggering a StackOverflowError when a component inside nested
+	 * TransparentWebMarkupContainers is updated. This particular test case is caused by having two
+	 * TransparentWebMarkupContainers nested and trying to update a label that was added to the
+	 * outer TWMC.
+	 */
+	@Test
+	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow2()
+	{
+		tester.startPage(Wicket5898Page2.class);
+
+		// the page renders normally using normal web requests
+		tester.assertRenderedPage(Wicket5898Page2.class);
+
+		// without WICKET-5898 fixed the statement below causes a StackOverflowError
+		tester.clickLink("link", true);
+		tester.assertComponentOnAjaxResponse("label");
+	}
+}


[2/3] wicket git commit: WICKET-5898 StackOverflowError after form submit with a validation error

Posted by ad...@apache.org.
WICKET-5898 StackOverflowError after form submit with a validation error


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/33879a8b
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/33879a8b
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/33879a8b

Branch: refs/heads/wicket-6.x
Commit: 33879a8b4842828098bc98665bf1c63ddeb24f2f
Parents: 8c62ecd
Author: Andrea Del Bene <ad...@apache.org>
Authored: Sat May 2 16:50:22 2015 +0200
Committer: Andrea Del Bene (Innoteam) <an...@innoteam.it>
Committed: Wed Jul 29 13:02:16 2015 +0200

----------------------------------------------------------------------
 .../markup/html/panel/AbstractMarkupSourcingStrategy.java   | 9 ++++++++-
 .../queueing/transparentresolvers/TestWicket5898.java       | 5 ++---
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/33879a8b/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AbstractMarkupSourcingStrategy.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AbstractMarkupSourcingStrategy.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AbstractMarkupSourcingStrategy.java
index e60eaa3..27407cf 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AbstractMarkupSourcingStrategy.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/panel/AbstractMarkupSourcingStrategy.java
@@ -67,6 +67,13 @@ public abstract class AbstractMarkupSourcingStrategy implements IMarkupSourcingS
 			@Override
 			public void component(MarkupContainer resolvingContainer, IVisit<IMarkupFragment> visit)
 			{
+				//prevents possible searching loops
+				if (child == resolvingContainer) 
+				{
+					visit.dontGoDeeper();
+					return;
+				}
+				
 				if (resolvingContainer instanceof IComponentResolver)
 				{
 					visit.dontGoDeeper();
@@ -92,7 +99,7 @@ public abstract class AbstractMarkupSourcingStrategy implements IMarkupSourcingS
 							visit.stop(childMarkup);
 						}
 					}
-				}
+				}				
 			}
 		});
 	}

http://git-wip-us.apache.org/repos/asf/wicket/blob/33879a8b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
index f154948..453e297 100644
--- a/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
+++ b/wicket-core/src/test/java/org/apache/wicket/queueing/transparentresolvers/TestWicket5898.java
@@ -18,7 +18,6 @@ package org.apache.wicket.queueing.transparentresolvers;
 
 import org.apache.wicket.util.tester.WicketTester;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -69,7 +68,7 @@ public class TestWicket5898
 	 * that might need rewriting.
 	 */
 	@Test
-	@Ignore("This test fails, should be enabled to trigger WICKET-5898")
+	//@Ignore("This test fails, should be enabled to trigger WICKET-5898")
 	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow()
 	{
 		tester.startPage(Wicket5898Page.class);
@@ -89,7 +88,7 @@ public class TestWicket5898
 	 * outer TWMC.
 	 */
 	@Test
-	@Ignore("This test fails, should be enabled to trigger WICKET-5898")
+	//@Ignore("This test fails, should be enabled to trigger WICKET-5898")
 	public void ajaxRequestForComponentInTransparentWebMarkupContainerShouldntCauseStackOverflow2()
 	{
 		tester.startPage(Wicket5898Page2.class);