21 lines
471 B
Java
21 lines
471 B
Java
package testutil;
|
|
|
|
import java.io.*;
|
|
|
|
public final class TestUtilities {
|
|
|
|
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");
|
|
}
|
|
};
|
|
}
|
|
|
|
}
|