2016-12-14 14:41:43 -05:00
|
|
|
package testutil;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
2016-12-16 11:26:53 -05:00
|
|
|
public final class TestUtilities {
|
2016-12-14 14:41:43 -05:00
|
|
|
|
|
|
|
public static InputStream createInputStreamFromString(String string) {
|
|
|
|
return new ByteArrayInputStream(string.getBytes());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static InputStream createIOExceptionThrowingInputStream() {
|
|
|
|
return new InputStream() {
|
|
|
|
|
|
|
|
public int read() throws IOException {
|
|
|
|
throw new IOException("test IOException");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|