INT-1459 removed dependency on 1.6 in tests

This commit is contained in:
Mark Fisher
2010-09-16 13:51:54 -07:00
parent 0967c93fc0
commit 11d23c2b91
2 changed files with 14 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import org.junit.Test;
@@ -133,7 +134,12 @@ public class PayloadDeserializingTransformerParserTests {
public static class TestDeserializingConverter implements Converter<byte[], Object> {
public Object convert(byte[] source) {
return new String(source, Charset.forName("UTF-8")).toUpperCase();
try {
return new String(source, "UTF-8").toUpperCase();
}
catch (UnsupportedEncodingException e) {
throw new MessageTransformationException("failed to convert payload", e);
}
}
}

View File

@@ -23,6 +23,7 @@ import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import org.junit.Test;
@@ -130,7 +131,12 @@ public class PayloadSerializingTransformerParserTests {
public static class TestSerializingConverter implements Converter<Object, byte[]> {
public byte[] convert(Object source) {
return source.toString().toUpperCase().getBytes(Charset.forName("UTF-8"));
try {
return source.toString().toUpperCase().getBytes("UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new MessageTransformationException("failed to convert payload", e);
}
}
}