use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class DateColumnTranslatorTest method testGregorianNoFormat.
@Test
public void testGregorianNoFormat() throws Exception {
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", gDate, Types.DATE);
{
String translated = translator.translate(row, 0);
assertEquals("2013-08-22", translated);
}
{
String translated = translator.translate(row, "testField");
assertEquals("2013-08-22", translated);
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class DoubleColumnTranslatorTest method testFormattedString.
@Test
public void testFormattedString() throws Exception {
translator.setFormat("%f");
String floatVal = new String("123");
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", floatVal, Types.DOUBLE);
{
String translated = translator.translate(row, 0);
assertEquals(expected, translated);
}
{
String translated = translator.translate(row, "testField");
assertEquals(expected, translated);
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class DoubleColumnTranslatorTest method testFormattedDouble.
@Test
public void testFormattedDouble() throws Exception {
translator.setFormat("%f");
Double floatVal = Double.valueOf("123");
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", floatVal, Types.DOUBLE);
{
String translated = translator.translate(row, 0);
assertEquals(expected, translated);
}
{
String translated = translator.translate(row, "testField");
assertEquals(expected, translated);
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class FloatColumnTranslatorTest method testFormattedString.
@Test
public void testFormattedString() throws Exception {
translator.setFormat("%f");
String floatVal = new String("123");
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", floatVal, Types.FLOAT);
{
String translated = translator.translate(row, 0);
assertEquals(expected, translated);
}
{
String translated = translator.translate(row, "testField");
assertEquals(expected, translated);
}
}
use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.
the class FloatColumnTranslatorTest method testFormattedDouble.
@Test
public void testFormattedDouble() throws Exception {
translator.setFormat("%f");
Double floatVal = Double.valueOf("123");
JdbcResultRow row = new JdbcResultRow();
row.setFieldValue("testField", floatVal, Types.FLOAT);
{
String translated = translator.translate(row, 0);
assertEquals(expected, translated);
}
{
String translated = translator.translate(row, "testField");
assertEquals(expected, translated);
}
}
Aggregations