TMC-IOENC: Encoder implementation clean-up.

This commit is contained in:
Harald Kuhr
2013-09-13 17:04:10 +02:00
parent d1f00ce817
commit aebfad914f
9 changed files with 70 additions and 757 deletions
@@ -2,7 +2,9 @@ package com.twelvemonkeys.io.enc;
import org.junit.Test;
import java.io.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import static org.junit.Assert.*;
@@ -23,19 +25,6 @@ public class Base64EncoderTestCase extends EncoderAbstractTestCase {
return new Base64Decoder();
}
@Test
public void testNegativeEncode() throws IOException {
Encoder encoder = createEncoder();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
try {
encoder.encode(bytes, new byte[1], 2, 1);
fail("wrong index should throw IndexOutOfBoundsException");
}
catch (IndexOutOfBoundsException expected) {
}
}
@Test
public void testEmptyEncode() throws IOException {
String data = "";
@@ -35,7 +35,7 @@ public abstract class EncoderAbstractTestCase extends ObjectAbstractTestCase {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
try {
encoder.encode(bytes, null, 0, 1);
encoder.encode(bytes, null);
fail("null should throw NullPointerException");
}
catch (NullPointerException expected) {