wicket-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thran...@apache.org
Subject svn commit: r722709 - /wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
Date Wed, 03 Dec 2008 01:24:18 GMT
Author: thrantal
Date: Tue Dec  2 17:24:17 2008
New Revision: 722709

URL: http://svn.apache.org/viewvc?rev=722709&view=rev
Log:
WICKET-1781: Making the test more robust. A better fix would a better testing framework where
you can handle XML better (or at least an XML testing library for JUnit).

Modified:
    wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java

Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java?rev=722709&r1=722708&r2=722709&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
(original)
+++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
Tue Dec  2 17:24:17 2008
@@ -37,12 +37,16 @@
 		tester.assertRenderedPage(ParentResourceEscapePathTestPage.class);
 		tester.assertNoErrorMessage();
 
-		final StringBuffer expectedHtml = new StringBuffer();
-		expectedHtml.append("<html><head><wicket:link><script type=\"text/javascript\"
src=\"");
-		expectedHtml.append(expectedResourceUrl());
-		expectedHtml.append("\"></script></wicket:link></head></html>");
+		String html = tester.getServletResponse().getDocument();
+		assertContains(html, "<html><head><wicket:link><script ");
+		assertContains(html, " type=\"text/javascript\"");
+		assertContains(html, "src=\"" + expectedResourceUrl() + "\"");
+		assertContains(html, "\"></script></wicket:link></head></html>");
+	}
 
-		assertEquals(expectedHtml.toString(), tester.getServletResponse().getDocument());
+	private void assertContains(String html, String expected)
+	{
+		assertTrue(html, html.indexOf(expected) != -1);
 	}
 
 	public void testResourceUrlGeneratedByResourceReference()



Mime
View raw message