use of org.pentaho.metaverse.frames.DatasourceNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testTableOutputStepNode.
@Test
public void testTableOutputStepNode() throws Exception {
// this tests a specific step in a specific transform
TableOutputStepNode node = root.getTableOutputStepNode();
// check the table that it writes to
TableOutputMeta meta = (TableOutputMeta) getStepMeta(node);
String tableName = meta.getTableName();
String schema = meta.getSchemaName();
boolean truncateTable = meta.truncateTable();
DatabaseTableNode databaseTableNode = node.getDatabaseTable();
assertEquals(tableName, databaseTableNode.getName());
assertEquals(schema, node.getSchema());
assertEquals(truncateTable, node.isTruncateTable());
Iterable<StreamFieldNode> inputs = node.getInputStreamFields();
Iterable<StreamFieldNode> outputs = node.getOutputStreamFields();
assertEquals(getIterableSize(inputs) + meta.getFieldDatabase().length, getIterableSize(outputs));
for (StreamFieldNode input : inputs) {
assertEquals(input.getName(), input.getFieldPopulatedByMe().getName());
}
DatasourceNode datasource = node.getDatasource(meta.getDatabaseMeta().getName());
assertEquals(meta.getDatabaseMeta().getHostname(), datasource.getHost());
assertEquals(meta.getDatabaseMeta().getDatabasePortNumberString(), datasource.getPort());
assertEquals(meta.getDatabaseMeta().getUsername(), datasource.getUserName());
assertEquals(meta.getDatabaseMeta().getDatabaseName(), datasource.getDatabaseName());
assertEquals(DictionaryConst.NODE_TYPE_DATASOURCE, datasource.getType());
assertEquals(meta.getTableName(), databaseTableNode.getName());
assertEquals(DictionaryConst.NODE_TYPE_DATA_TABLE, databaseTableNode.getType());
}
use of org.pentaho.metaverse.frames.DatasourceNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testDatasources.
@Test
public void testDatasources() throws Exception {
int countDatasources = getIterableSize(root.getDatasourceNodes());
for (DatasourceNode ds : root.getDatasourceNodes()) {
// make sure at least one step uses the connection
int countUsedSteps = getIterableSize(ds.getTransformationStepNodes());
assertTrue(countUsedSteps > 0);
assertEquals(DictionaryConst.NODE_TYPE_DATASOURCE, ds.getEntity().getName());
assertNotNull(ds.getName());
assertNotNull(ds.getDatabaseName());
assertNotNull(ds.getPort());
assertNotNull(ds.getAccessType());
assertNotNull(ds.getAccessTypeDesc());
}
assertTrue(countDatasources > 0);
}
use of org.pentaho.metaverse.frames.DatasourceNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testSampleDataConnection.
@Test
public void testSampleDataConnection() throws Exception {
DatasourceNode sampleData = root.getDatasourceNode("Sampledata");
assertEquals("Sampledata", sampleData.getName());
assertEquals("-1", sampleData.getPort());
assertEquals("Native", sampleData.getAccessTypeDesc());
assertEquals("sampledata", sampleData.getDatabaseName());
assertEquals("sa", sampleData.getUserName());
}
Aggregations