Better exception messages.
MODIFY
src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
@@ -45,7 +45,7 @@ public YellOnCloseInputStream(final InputStream proxy) {
/** @see java.io.InputStream#close() */
@Override
public void close() throws IOException {
- throw new IOException("close() was called on OutputStream");
+ throw new IOException(getClass().getSimpleName() + ".close() called.");
}
}

MODIFY
src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java
src/test/java/org/apache/commons/io/testtools/YellOnCloseOutputStream.java
@@ -44,7 +44,7 @@ public YellOnCloseOutputStream(final OutputStream proxy) {
/** @see java.io.OutputStream#close() */
@Override
public void close() throws IOException {
- throw new IOException("close() was called on OutputStream");
+ throw new IOException(getClass().getSimpleName() + ".close() called.");
}
}

MODIFY
src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java
src/test/java/org/apache/commons/io/testtools/YellOnCloseReader.java
@@ -45,7 +45,7 @@ public YellOnCloseReader(final Reader proxy) {
/** @see java.io.Reader#close() */
@Override
public void close() throws IOException {
- throw new IOException("close() was called on OutputStream");
+ throw new IOException(getClass().getSimpleName() + ".close() called.");
}
}

MODIFY
src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java
src/test/java/org/apache/commons/io/testtools/YellOnCloseWriter.java
@@ -44,7 +44,7 @@ public YellOnCloseWriter(final Writer proxy) {
/** @see java.io.Writer#close() */
@Override
public void close() throws IOException {
- throw new IOException("close() was called on OutputStream");
+ throw new IOException(getClass().getSimpleName() + ".close() called.");
}
}

MODIFY
src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
@@ -46,7 +46,7 @@ public YellOnFlushAndCloseOutputStream(final OutputStream proxy, final boolean y
@Override
public void flush() throws IOException {
if (yellOnFlush) {
- throw new AssertionFailedError("flush() was called on OutputStream");
+ throw new AssertionFailedError(getClass().getSimpleName() + ".flush() called.");
}
super.flush();
}
@@ -55,7 +55,7 @@ public void flush() throws IOException {
@Override
public void close() throws IOException {
if (yellOnClose) {
- throw new AssertionFailedError("close() was called on OutputStream");
+ throw new AssertionFailedError(getClass().getSimpleName() + ".close() called.");
}
super.close();
}

Better exception messages.