Author: jdonnerstag
Date: Sat Mar 19 19:33:23 2011
New Revision: 1083255

URL: http://svn.apache.org/viewvc?rev=1083255&view=rev
Log:
minor changes to support <header-contribution encoding=.. >

Modified:
    
wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestTargetTest.java

Modified: 
wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestTargetTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestTargetTest.java?rev=1083255&r1=1083254&r2=1083255&view=diff
==============================================================================
--- 
wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestTargetTest.java
 (original)
+++ 
wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxRequestTargetTest.java
 Sat Mar 19 19:33:23 2011
@@ -84,7 +84,6 @@ public class AjaxRequestTargetTest exten
 
                page.add(new 
WebComponent(MockPageWithLinkAndComponent.COMPONENT_ID).setOutputMarkupId(true));
 
-
                page.add(new 
AjaxLink<Void>(MockPageWithLinkAndComponent.LINK_ID)
                {
                        private static final long serialVersionUID = 1L;
@@ -120,19 +119,17 @@ public class AjaxRequestTargetTest exten
                        }
                });
 
-// System.out.println(tester.getServletResponse().getDocument());
+               // 
System.out.println(tester.getServletResponse().getDocument());
                tester.debugComponentTrees();
 
                tester.clickLink(MockPageWithLinkAndComponent.LINK_ID);
 
                String document = tester.getLastResponseAsString();
+               String headerContribution = null;
 
-               Pattern pat = 
Pattern.compile(".*<header-contribution>(.*?)</header-contribution>.*",
+               Pattern pat = 
Pattern.compile(".*<header-contribution.*?>(.*?)</header-contribution>.*",
                        Pattern.DOTALL);
                Matcher mat = pat.matcher(document);
-
-               String headerContribution = null;
-
                if (mat.matches())
                {
                        headerContribution = mat.group(1);
@@ -143,8 +140,12 @@ public class AjaxRequestTargetTest exten
                // This means that it doesn't exist at all
                if (expectedFile == null)
                {
-                       assertNull("There was a header contribution on the 
response: <" + headerContribution +
-                               ">", headerContribution);
+                       assertNull("There was a header contribution on the 
response " +
+                               "(though we didn't expect one): <" + 
headerContribution + ">", headerContribution);
+               }
+               else if (headerContribution == null)
+               {
+                       fail("Failed to find header contribution: \n" + 
document);
                }
                else
                {
@@ -249,6 +250,8 @@ public class AjaxRequestTargetTest exten
         */
        public static class TestEventPage extends MockPageWithLinkAndComponent
        {
+               private static final long serialVersionUID = 1L;
+
                boolean defaultEventRaised = false;
 
                /**


Reply via email to