You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by pa...@apache.org on 2012/01/13 08:24:19 UTC
[3/4] git commit: WICKET-4290: javadoc for testcases
WICKET-4290: javadoc for testcases
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/c05784ad
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/c05784ad
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/c05784ad
Branch: refs/heads/master
Commit: c05784ad9e48c6a0c28cbaec9bfc4859f8ac0d26
Parents: e195335
Author: Emond Papegaaij <em...@topicus.nl>
Authored: Thu Jan 12 12:52:17 2012 +0100
Committer: Emond Papegaaij <pa...@apache.org>
Committed: Fri Jan 13 08:18:04 2012 +0100
----------------------------------------------------------------------
.../markup/html/link/MountedPageLinkTest.java | 18 +++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/c05784ad/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java
index c2f2b10..53684a1 100644
--- a/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/markup/html/link/MountedPageLinkTest.java
@@ -21,14 +21,27 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.junit.Before;
import org.junit.Test;
+/**
+ * Testcases for links on mounted pages. These links are special, because they refer the page by id
+ * AND by mount path (including parameters). This was done for WICKET-4014. WICKET-4290 broke this,
+ * because the page parameters are no longer rendered.
+ *
+ * @author papegaaij
+ */
public class MountedPageLinkTest extends WicketTestCase
{
+ /**
+ * Mount the page
+ */
@Before
public void mountPage()
{
tester.getApplication().mountPage("mount/${param}/part2", PageWithLink.class);
}
+ /**
+ * Tests if the page parameters are part of the url of the link, and if the link actually works.
+ */
@Test
public void testPageParametersInLink()
{
@@ -41,6 +54,10 @@ public class MountedPageLinkTest extends WicketTestCase
tester.executeUrl(url);
}
+ /**
+ * Tests if it is possible to re-instantiate the page if it is expired. The page should be
+ * instantiated with the same page parameters. The link will not be clicked however.
+ */
@Test
public void testLinkOnExpiredPage()
{
@@ -48,6 +65,7 @@ public class MountedPageLinkTest extends WicketTestCase
new PageParameters().add("param", "value"));
Link<?> link = (Link<?>)page.get("link");
String url = link.getURL().toString();
+ // simulate a page expiry
url = url.replace("part2?0", "part2?3");
tester.executeUrl(url);
}