Search in sources :

Example 36 with JdbcResultRow

use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.

the class BooleanColumnTranslatorTest method testTrueStringColumnName.

@Test
public void testTrueStringColumnName() throws Exception {
    JdbcResultRow row = new JdbcResultRow();
    row.setFieldValue("testField", "true", Types.BOOLEAN);
    String translated = translator.translate(row, "testField");
    assertEquals("true", translated);
}
Also used : JdbcResultRow(com.adaptris.jdbc.JdbcResultRow) Test(org.junit.Test)

Example 37 with JdbcResultRow

use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.

the class BooleanColumnTranslatorTest method testFalseString.

@Test
public void testFalseString() throws Exception {
    JdbcResultRow row = new JdbcResultRow();
    row.setFieldValue("testField", "false", Types.BOOLEAN);
    String translated = translator.translate(row, 0);
    assertEquals("false", translated);
}
Also used : JdbcResultRow(com.adaptris.jdbc.JdbcResultRow) Test(org.junit.Test)

Example 38 with JdbcResultRow

use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.

the class BooleanColumnTranslatorTest method testFalseBool.

@Test
public void testFalseBool() throws Exception {
    JdbcResultRow row = new JdbcResultRow();
    boolean val = false;
    row.setFieldValue("testField", val, Types.BOOLEAN);
    String translated = translator.translate(row, 0);
    assertEquals("false", translated);
}
Also used : JdbcResultRow(com.adaptris.jdbc.JdbcResultRow) Test(org.junit.Test)

Example 39 with JdbcResultRow

use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.

the class BooleanColumnTranslatorTest method testTrueBoolean.

@Test
public void testTrueBoolean() throws Exception {
    JdbcResultRow row = new JdbcResultRow();
    row.setFieldValue("testField", Boolean.valueOf("true"), Types.BOOLEAN);
    String translated = translator.translate(row, 0);
    assertEquals("true", translated);
}
Also used : JdbcResultRow(com.adaptris.jdbc.JdbcResultRow) Test(org.junit.Test)

Example 40 with JdbcResultRow

use of com.adaptris.jdbc.JdbcResultRow in project interlok by adaptris.

the class BooleanColumnTranslatorTest method testFalseBoolean.

@Test
public void testFalseBoolean() throws Exception {
    JdbcResultRow row = new JdbcResultRow();
    row.setFieldValue("testField", Boolean.valueOf("false"), Types.BOOLEAN);
    String translated = translator.translate(row, 0);
    assertEquals("false", translated);
}
Also used : JdbcResultRow(com.adaptris.jdbc.JdbcResultRow) Test(org.junit.Test)

Aggregations

JdbcResultRow (com.adaptris.jdbc.JdbcResultRow)69 Test (org.junit.Test)65 OutputStream (java.io.OutputStream)9 StringWriter (java.io.StringWriter)9 WriterOutputStream (org.apache.commons.io.output.WriterOutputStream)9 SQLException (java.sql.SQLException)5 Clob (java.sql.Clob)4 SerialClob (javax.sql.rowset.serial.SerialClob)4 JdbcResultSet (com.adaptris.jdbc.JdbcResultSet)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ArrayList (java.util.ArrayList)3 CoreException (com.adaptris.core.CoreException)2 MetadataElement (com.adaptris.core.MetadataElement)2 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 ServiceException (com.adaptris.core.ServiceException)1 NoSuchElementException (java.util.NoSuchElementException)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1