use of org.pentaho.di.core.row.ValueMetaInterface in project pentaho-kettle by pentaho.
the class ValueMetaBaseTest method testMetdataPreviewSqlVarBinaryToPentahoStringUsingOracle.
@Test
public void testMetdataPreviewSqlVarBinaryToPentahoStringUsingOracle() throws SQLException, KettleDatabaseException {
doReturn(Types.VARBINARY).when(resultSet).getInt("DATA_TYPE");
doReturn(16).when(resultSet).getInt("COLUMN_SIZE");
doReturn(mock(OracleDatabaseMeta.class)).when(dbMetaMock).getDatabaseInterface();
ValueMetaInterface valueMeta = valueMetaBase.getMetadataPreview(dbMetaMock, resultSet);
assertTrue(valueMeta.isString());
assertEquals(16, valueMeta.getLength());
}
use of org.pentaho.di.core.row.ValueMetaInterface in project pentaho-kettle by pentaho.
the class ValueMetaBaseTest method testMetdataPreviewSqlLongVarcharToPentahoString.
@Test
public void testMetdataPreviewSqlLongVarcharToPentahoString() throws SQLException, KettleDatabaseException {
doReturn(Types.LONGVARCHAR).when(resultSet).getInt("DATA_TYPE");
ValueMetaInterface valueMeta = valueMetaBase.getMetadataPreview(dbMetaMock, resultSet);
assertTrue(valueMeta.isString());
}
use of org.pentaho.di.core.row.ValueMetaInterface in project pentaho-kettle by pentaho.
the class ValueMetaBaseTest method testMetdataPreviewSqlLongVarBinaryToPentahoStringUsingOracle.
@Test
public void testMetdataPreviewSqlLongVarBinaryToPentahoStringUsingOracle() throws SQLException, KettleDatabaseException {
doReturn(Types.LONGVARBINARY).when(resultSet).getInt("DATA_TYPE");
doReturn(mock(OracleDatabaseMeta.class)).when(dbMetaMock).getDatabaseInterface();
ValueMetaInterface valueMeta = valueMetaBase.getMetadataPreview(dbMetaMock, resultSet);
assertTrue(valueMeta.isString());
}
use of org.pentaho.di.core.row.ValueMetaInterface in project pentaho-kettle by pentaho.
the class ValueMetaBaseTest method testMetdataPreviewSqlBooleanToPentahoBoolean.
@Test
public void testMetdataPreviewSqlBooleanToPentahoBoolean() throws SQLException, KettleDatabaseException {
doReturn(Types.BOOLEAN).when(resultSet).getInt("DATA_TYPE");
ValueMetaInterface valueMeta = valueMetaBase.getMetadataPreview(dbMetaMock, resultSet);
assertTrue(valueMeta.isBoolean());
}
use of org.pentaho.di.core.row.ValueMetaInterface in project pentaho-kettle by pentaho.
the class ValueMetaBaseTest method testMetdataPreviewSqlSmallIntToPentahoInteger.
@Test
public void testMetdataPreviewSqlSmallIntToPentahoInteger() throws SQLException, KettleDatabaseException {
doReturn(Types.SMALLINT).when(resultSet).getInt("DATA_TYPE");
ValueMetaInterface valueMeta = valueMetaBase.getMetadataPreview(dbMetaMock, resultSet);
assertTrue(valueMeta.isInteger());
assertEquals(0, valueMeta.getPrecision());
assertEquals(4, valueMeta.getLength());
}
Aggregations