// Test output sent indirectly to the servlet or portlet response stream
public void testIndirectStream() throws Exception {
processor.process(facesContext, "/business/indirectStream");
assertEquals("application/x-binary", response.getContentType());
MockServletOutputStream stream =
(MockServletOutputStream) response.getOutputStream();
assertNotNull(stream);
assertEquals(10, stream.size());
byte content[] = stream.content();
for (int i = 0; i < 10; i++) {
assertEquals("Byte at position " + i, (byte) i, content[i]);
}
assertTrue(facesContext.getResponseComplete());