use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class TimeColumnTranslatorTest method testString.
@Test
public void testString() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "2013-08-22", Types.TIME);
try {
translator.translate(row, 0);
fail();
} catch (Exception ex) {
// pass, expected
}
try {
translator.translate(row, "testField");
fail();
} catch (Exception ex) {
// pass, expected
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class TimeColumnTranslatorTest method testGregorianNoFormat.
@Test
public void testGregorianNoFormat() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", gDate, Types.TIME);
{
String translated = translator.translate(row, 0);
// starts with, being careful of timezone
assertTrue(translated.startsWith("12:12:12"));
}
{
String translated = translator.translate(row, "testField");
// starts with, being careful of timezone
assertTrue(translated.startsWith("12:12:12"));
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class TimestampColumnTranslatorTest method testDateNoFormat.
@Test
public void testDateNoFormat() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", date, Types.TIMESTAMP);
{
String translated = translator.translate(row, 0);
// starts with, being careful of timezone
assertTrue(translated.startsWith("2013-08-22"));
}
{
String translated = translator.translate(row, "testField");
// starts with, being careful of timezone
assertTrue(translated.startsWith("2013-08-22"));
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class TimestampColumnTranslatorTest method testString.
@Test
public void testString() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", "2013-08-22", Types.TIMESTAMP);
try {
translator.translate(row, 0);
fail();
} catch (Exception ex) {
// pass, expected
}
try {
translator.translate(row, "testField");
fail();
} catch (Exception ex) {
// pass, expected
}
}
Aggregations