public void test_returnFile_cantOpenOutputStream() throws ServletException { TestUtil.writeFile("_test_", "Sample file to return."); response.getOutputStreamException = true; StaticServlet.returnFile("_test_", context, response); assertEquals( "log4j log output", "I/O error retrieving response output stream in " + "StaticServlet.returnFile: getOutputStream failed", log4jLog.log.toString()); TestUtil.deleteTree("_test_"); }