net.sourceforge.stripes.mock
Class MockServletOutputStream
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
net.sourceforge.stripes.mock.MockServletOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class MockServletOutputStream
- extends ServletOutputStream
Mock implementation of a ServletOutputStream that just uses a byte array output stream to
capture any output and make it available after the test is done.
- Since:
- Stripes 1.1
- Author:
- Tim Fennell
Method Summary |
byte[] |
getBytes()
Returns the array of bytes that have been written to the output stream. |
String |
getString()
Returns, as a character string, the output that was written to the output stream. |
void |
write(int b)
Pass through method calls ByteArrayOutputStream.write(int b). |
Methods inherited from class javax.servlet.ServletOutputStream |
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockServletOutputStream
public MockServletOutputStream()
write
public void write(int b)
throws IOException
- Pass through method calls ByteArrayOutputStream.write(int b).
- Specified by:
write
in class OutputStream
- Throws:
IOException
getBytes
public byte[] getBytes()
- Returns the array of bytes that have been written to the output stream.
getString
public String getString()
- Returns, as a character string, the output that was written to the output stream.
? Copyright 2005-2006, Stripes Development Team.