forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r477245 - in /forrest/trunk/whiteboard/forrest2/src/test: locationmap.xml org/apache/forrest/test/core/TestController.java
Date Mon, 20 Nov 2006 16:35:02 GMT
Author: rgardler
Date: Mon Nov 20 08:35:02 2006
New Revision: 477245

URL: http://svn.apache.org/viewvc?view=rev&rev=477245
Log:
Add a test for variable substitution in location URIs

Modified:
    forrest/trunk/whiteboard/forrest2/src/test/locationmap.xml
    forrest/trunk/whiteboard/forrest2/src/test/org/apache/forrest/test/core/TestController.java

Modified: forrest/trunk/whiteboard/forrest2/src/test/locationmap.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/src/test/locationmap.xml?view=diff&rev=477245&r1=477244&r2=477245
==============================================================================
--- forrest/trunk/whiteboard/forrest2/src/test/locationmap.xml (original)
+++ forrest/trunk/whiteboard/forrest2/src/test/locationmap.xml Mon Nov 20 08:35:02 2006
@@ -23,4 +23,8 @@
   <location pattern="xhtml/helloWorld.html">
     <source href="hello:classpath:/xdocs/samples/xml/helloWorld.xml"/>
   </location>
+  
+  <location pattern="(.*)/variable/(.*)\..*">
+    <source href="classpath:/xdocs/samples/xhtml2/$(2).html"/>
+  </location>
 </locationmap>

Modified: forrest/trunk/whiteboard/forrest2/src/test/org/apache/forrest/test/core/TestController.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/src/test/org/apache/forrest/test/core/TestController.java?view=diff&rev=477245&r1=477244&r2=477245
==============================================================================
--- forrest/trunk/whiteboard/forrest2/src/test/org/apache/forrest/test/core/TestController.java
(original)
+++ forrest/trunk/whiteboard/forrest2/src/test/org/apache/forrest/test/core/TestController.java
Mon Nov 20 08:35:02 2006
@@ -146,4 +146,13 @@
 				.contains("http://www.w3.org/2002/06/xhtml2"));
 	}
 
+	public void testVariableSubstitution() throws ProcessingException,
+			URISyntaxException, IOException {
+		final AbstractOutputDocument output = this.controller
+				.getOutputDocument(new URI(VARIABLE_SUBSTITUTION_REQUEST_URI));
+				assertNotNull(output);
+				assertTrue("Content is not as expected", output.getContentAsString()
+						.contains("http://www.w3.org/2002/06/xhtml2"));
+	}
+
 }



Mime
View raw message