use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class ByteArrayColumnTranslatorTest method testByteToStringEncoded.
@Test
public void testByteToStringEncoded() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "SomeData".getBytes("UTF-8"), Types.ARRAY);
String translated = translator.translate(row, 0);
assertEquals("SomeData", translated);
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class ByteArrayColumnTranslatorTest method testBytesWrite.
@Test
public void testBytesWrite() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "SomeData".getBytes(), Types.ARRAY);
StringWriter writer = new StringWriter();
try (OutputStream out = new WriterOutputStream(writer)) {
translator.write(row, 0, out);
}
String translated = writer.toString();
assertEquals("SomeData", translated);
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class ByteArrayColumnTranslatorTest method testByteToStringColName.
@Test
public void testByteToStringColName() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "SomeData".getBytes(), Types.ARRAY);
String translated = translator.translate(row, "testField");
assertEquals("SomeData", translated);
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class ByteArrayColumnTranslatorTest method testBytesWrite_ByName.
@Test
public void testBytesWrite_ByName() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "SomeData".getBytes(), Types.ARRAY);
StringWriter writer = new StringWriter();
try (OutputStream out = new WriterOutputStream(writer)) {
translator.write(row, "testField", out);
}
String translated = writer.toString();
assertEquals("SomeData", translated);
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class ByteArrayColumnTranslatorTest method testByteToString.
@Test
public void testByteToString() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "SomeData".getBytes(), Types.ARRAY);
String translated = translator.translate(row, 0);
assertEquals("SomeData", translated);
}
Aggregations