BATCH-1684: Updated the conversion of the output stream to String

This commit is contained in:
Michael Minella
2012-10-09 09:09:50 -05:00
parent 92e4615a9b
commit f7d2e683ca
2 changed files with 2 additions and 4 deletions

View File

@@ -231,7 +231,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
throw new IllegalArgumentException("Could not serialize the execution context", ioe);
}
return out.toString();
return new String(out.toByteArray());
}
@SuppressWarnings("unchecked")

View File

@@ -77,7 +77,6 @@ public class DefaultExecutionContextSerializerTests {
private void compareContexts(Map<String, Object> m1, Map<String, Object> m2) {
for (String key : m1.keySet()) {
System.out.println("m1 = " + m1 + " m2 = " + m2);
assertEquals("Bad key/value for " + key, m1.get(key), m2.get(key));
}
}
@@ -87,8 +86,7 @@ public class DefaultExecutionContextSerializerTests {
ByteArrayOutputStream out = new ByteArrayOutputStream();
serializer.serialize(m1, out);
out.close();
String s = out.toString();
String s = new String(out.toByteArray());
InputStream in = new ByteArrayInputStream(s.getBytes());
Map<String, Object> m2 = (Map<String, Object>) serializer.deserialize(in);