You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2007/08/01 14:32:37 UTC

svn commit: r561785 - /wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/

Author: jcompagner
Date: Wed Aug  1 05:32:35 2007
New Revision: 561785

URL: http://svn.apache.org/viewvc?view=rev&rev=561785
Log:
some more test

Added:
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html   (with props)
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java   (with props)
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html   (with props)
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java   (with props)
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html   (with props)
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html   (with props)
Modified:
    wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html Wed Aug  1 05:32:35 2007
@@ -0,0 +1,12 @@
+<html>
+<head>
+<wicket:head>
+<link href="test2"/>
+</wicket:head>
+</head>
+<body>
+<wicket:panel>
+test
+</wicket:panel>
+</body>
+</html>
\ No newline at end of file

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java Wed Aug  1 05:32:35 2007
@@ -0,0 +1,44 @@
+/*
+ * 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.ajax;
+
+import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
+import org.apache.wicket.markup.html.panel.Panel;
+
+class AjaxHeaderContribution2 extends Panel
+{
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct.
+	 * 
+	 * @param id
+	 */
+	public AjaxHeaderContribution2(String id)
+	{
+		super(id);
+	}
+
+	public void renderHead(HtmlHeaderContainer container)
+	{
+		super.renderHead(container);
+
+		container.getHeaderResponse().renderJavascriptReference("javascripturlB");
+		container.getHeaderResponse().renderOnDomReadyJavascript("domReadyB();");
+		container.getHeaderResponse().renderOnLoadJavascript("onLoadB();");
+	}
+}
\ No newline at end of file

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContribution2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html Wed Aug  1 05:32:35 2007
@@ -0,0 +1,11 @@
+<html>
+<body>
+<span wicket:id="test1"></span>
+<span wicket:id="test2"></span>
+<span wicket:id="test3"></span>
+<span wicket:id="btest1"></span>
+<span wicket:id="btest2"></span>
+<span wicket:id="btest3"></span>
+<a href="#" wicket:id="link">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java Wed Aug  1 05:32:35 2007
@@ -0,0 +1,65 @@
+/*
+ * 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.ajax;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
+import org.apache.wicket.markup.html.WebPage;
+
+/**
+ * @author jcompagner
+ */
+public class AjaxHeaderContributionPage2 extends WebPage
+{
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct.
+	 */
+	public AjaxHeaderContributionPage2()
+	{
+		final Component test1 = new AjaxHeaderContribution("test1").setOutputMarkupId(true);
+		add(test1);
+		final Component test2 = new AjaxHeaderContribution("test2").setOutputMarkupId(true);
+		add(test2);
+		final Component test3 = new AjaxHeaderContribution("test3").setOutputMarkupId(true);
+		add(test3);
+
+		final Component btest1 = new AjaxHeaderContribution2("btest1").setOutputMarkupId(true);
+		add(btest1);
+		final Component btest2 = new AjaxHeaderContribution2("btest2").setOutputMarkupId(true);
+		add(btest2);
+		final Component btest3 = new AjaxHeaderContribution2("btest3").setOutputMarkupId(true);
+		add(btest3);
+		add(new AjaxFallbackLink("link")
+		{
+			private static final long serialVersionUID = 1L;
+
+			public void onClick(AjaxRequestTarget target)
+			{
+				target.prependJavascript("prepend();");
+				target.addComponent(test1);
+				target.addComponent(test2);
+				target.addComponent(test3);
+				target.addComponent(btest1);
+				target.addComponent(btest2);
+				target.addComponent(btest3);
+				target.appendJavascript("append();");
+			}
+		});
+	}
+}

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html Wed Aug  1 05:32:35 2007
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?><ajax-response><evaluate><![CDATA[prepend();]]></evaluate><header-contribution><![CDATA[<head xmlns:wicket="http://wicket.apache.org">
+<link href="../test"/>
+<script type="text/javascript" src="javascripturl"></script>
+</head>]]></header-contribution><component id="test16" ><![CDATA[<span wicket:id="test1" id="test16"><wicket:panel>
+test
+</wicket:panel></span>]]></component><component id="test27" ><![CDATA[<span wicket:id="test2" id="test27"><wicket:panel>
+test
+</wicket:panel></span>]]></component><component id="test38" ><![CDATA[<span wicket:id="test3" id="test38"><wicket:panel>
+test
+</wicket:panel></span>]]></component><header-contribution><![CDATA[<head xmlns:wicket="http://wicket.apache.org">
+<link href="../test2"/>
+<script type="text/javascript" src="javascripturlB"></script>
+</head>]]></header-contribution><component id="btest19" ><![CDATA[<span wicket:id="btest1" id="btest19"><wicket:panel>
+test
+</wicket:panel></span>]]></component><component id="btest210" ><![CDATA[<span wicket:id="btest2" id="btest210"><wicket:panel>
+test
+</wicket:panel></span>]]></component><component id="btest311" ><![CDATA[<span wicket:id="btest3" id="btest311"><wicket:panel>
+test
+</wicket:panel></span>]]></component><evaluate><![CDATA[domReady();]]></evaluate><evaluate><![CDATA[domReadyB();]]></evaluate><evaluate><![CDATA[append();]]></evaluate><evaluate><![CDATA[onLoad();]]></evaluate><evaluate><![CDATA[onLoadB();]]></evaluate></ajax-response>
\ No newline at end of file

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_ajax_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html?view=auto&rev=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html (added)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html Wed Aug  1 05:32:35 2007
@@ -0,0 +1,52 @@
+<html>
+<head>
+<link href="../test"/>
+<script type="text/javascript" src="javascripturl"></script>
+<script type="text/javascript" src="resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js"></script>
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "domready", function() { domReady();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "load", function() { onLoad();;});
+/*-->]]>*/</script>
+
+
+<link href="../test2"/>
+<script type="text/javascript" src="javascripturlB"></script>
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "domready", function() { domReadyB();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" ><!--/*--><![CDATA[/*><!--*/
+Wicket.Event.add(window, "load", function() { onLoadB();;});
+/*-->]]>*/</script>
+
+<script type="text/javascript" src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax.js"></script>
+<script type="text/javascript" id="wicket-ajax-debug-enable"><!--/*--><![CDATA[/*><!--*/
+wicketAjaxDebugEnable=true;
+/*-->]]>*/</script>
+
+<script type="text/javascript" src="resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js"></script>
+</head><body>
+<span wicket:id="test1" id="test16"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="test2" id="test27"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="test3" id="test38"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="btest1" id="btest19"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="btest2" id="btest210"><wicket:panel>
+test
+</wicket:panel></span>
+<span wicket:id="btest3" id="btest311"><wicket:panel>
+test
+</wicket:panel></span>
+<a href="?wicket:interface=:0:link::ILinkListener::" wicket:id="link" onclick="var wcall=wicketAjaxGet('?wicket:interface=:0:link::IBehaviorListener:0:', function() { }.bind(this), function() { }.bind(this));return !wcall;" id="link12">Test</a>
+</body>
+</html>
\ No newline at end of file

Propchange: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionPage2_expected.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java?view=diff&rev=561785&r1=561784&r2=561785
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxHeaderContributionTest.java Wed Aug  1 05:32:35 2007
@@ -37,4 +37,16 @@
 				"AjaxHeaderContributionPage_ajax_expected.html");
 
 	}
+
+	public void testDoubleAjaxHeaderContribution() throws Exception
+	{
+		tester.processRequestCycle(AjaxHeaderContributionPage2.class);
+		tester.assertResultPage(AjaxHeaderContributionPage2.class,
+				"AjaxHeaderContributionPage2_expected.html");
+
+		tester.executeAjaxEvent("link", "onclick");
+		tester.assertResultPage(AjaxHeaderContributionPage2.class,
+				"AjaxHeaderContributionPage2_ajax_expected.html");
+
+	}
 }