mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-30 00:00:01 -04:00
TMC-IOENC: Encoder implementation clean-up.
This commit is contained in:
@@ -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 = "";
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user