Major test overhaul, now uses JUnit 4 annotation style tests.

This commit is contained in:
Harald Kuhr
2011-10-18 20:16:32 +02:00
parent 4b77d1c22a
commit 9cafe4d9a9
26 changed files with 350 additions and 104 deletions
@@ -1,10 +1,13 @@
package com.twelvemonkeys.io;
import com.twelvemonkeys.lang.ObjectAbstractTestCase;
import org.junit.Test;
import java.io.Reader;
import java.io.IOException;
import static org.junit.Assert.*;
/**
* ReaderAbstractTestCase
* <p/>
@@ -36,6 +39,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
protected abstract Reader makeReader(String pInput);
@Test
public void testRead() throws IOException {
Reader reader = makeReader();
@@ -51,6 +55,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
assertEquals(mInput, buffer.toString());
}
@Test
public void testReadBuffer() throws IOException {
Reader reader = makeReader();
@@ -70,6 +75,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
assertEquals(mInput, new String(chars));
}
@Test
public void testSkipToEnd() throws IOException {
Reader reader = makeReader();
@@ -83,6 +89,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
assertEquals(0, toSkip);
}
@Test
public void testSkipToEndAndRead() throws IOException {
Reader reader = makeReader();
@@ -95,6 +102,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
}
// TODO: It's possible to support reset and not mark (resets to beginning of stream, for example)
@Test
public void testResetMarkSupported() throws IOException {
Reader reader = makeReader();
@@ -154,6 +162,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
}
}
@Test
public void testResetMarkNotSupported() throws IOException {
Reader reader = makeReader();
@@ -198,7 +207,7 @@ public abstract class ReaderAbstractTestCase extends ObjectAbstractTestCase {
}
}
@Test
public void testReadAfterClose() throws IOException {
Reader reader = makeReader("foo bar");