Author: rgardler
Date: Mon Dec 11 14:15:27 2006
New Revision: 485914
URL: http://svn.apache.org/viewvc?view=rev&rev=485914
Log:
Add test for aggregated source documents
Modified:
forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/TestController.java
Modified:
forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/TestController.java
URL:
http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/TestController.java?view=diff&rev=485914&r1=485913&r2=485914
==============================================================================
---
forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/TestController.java
(original)
+++
forrest/trunk/whiteboard/forrest2/core/src/test/org/apache/forrest/test/core/TestController.java
Mon Dec 11 14:15:27 2006
@@ -69,6 +69,9 @@
public static final String REQUIRED_RESOURCES_REQUEST_URI =
BASE_REQUEST_URI
+ "required/sample_simple.forrestSource";
+ public static final String AGGREGATED_RESOURCES_REQUEST_URI =
BASE_REQUEST_URI
+ + "aggregate/sample_simple.html";
+
private IController controller;
@Override
@@ -151,16 +154,16 @@
final AbstractOutputDocument output = this.controller
.getOutputDocument(new
URI(PIPELINE_REQUEST_URI));
assertNotNull(output);
- assertTrue("Content does not appear to be a pipeline
description", output.getContentAsString()
- .contains("forrestPipeline"));
- assertTrue("Pipeline does not define source location",
output.getContentAsString()
- .contains("<source"));
- assertTrue("Pipeline does not define a reader",
output.getContentAsString()
- .contains("<reader"));
- assertTrue("Pipeline does not define an input plugin",
output.getContentAsString()
- .contains("<inputPlugin"));
- assertTrue("Pipeline does not define an output plugin",
output.getContentAsString()
- .contains("<outputPlugin"));
+ assertTrue("Content does not appear to be a pipeline
description",
+
output.getContentAsString().contains("forrestPipeline"));
+ assertTrue("Pipeline does not define source location", output
+ .getContentAsString().contains("<source"));
+ assertTrue("Pipeline does not define a reader", output
+ .getContentAsString().contains("<reader"));
+ assertTrue("Pipeline does not define an input plugin", output
+ .getContentAsString().contains("<inputPlugin"));
+ assertTrue("Pipeline does not define an output plugin", output
+
.getContentAsString().contains("<outputPlugin"));
}
public void testVariableSubstitution() throws ProcessingException,
@@ -194,4 +197,18 @@
fail("We should throw a processing exception when a required
document is missing");
}
+ public void testAggregatedResources() throws ProcessingException,
+ URISyntaxException, IOException {
+ final AbstractOutputDocument output = this.controller
+ .getOutputDocument(new
URI(AGGREGATED_RESOURCES_REQUEST_URI));
+ assertNotNull("No document returned", output);
+ assertTrue("Content is not as expected",
output.getContentAsString()
+ .contains("http://www.w3.org/2002/06/xhtml2"));
+ String content = output.getContentAsString();
+ assertTrue("Content is not as expected", content
+ .contains("Second Sample"));
+ }
+
}
+
+