use of org.pentaho.di.trans.steps.mongodb.MongoDbMeta in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testMongoDbInput.
@Test
public void testMongoDbInput() throws Exception {
MongoDbInputStepNode node = root.getMongoDbInputStepNode();
assertNotNull(node);
MongoDbMeta meta = (MongoDbMeta) getStepMeta(node);
assertEquals(meta.getCollection(), node.getCollection().getName());
assertEquals(meta.getDbName(), node.getDatasource(meta.getDbName()).getName());
Iterable<StreamFieldNode> inputs = node.getInputStreamFields();
Iterable<StreamFieldNode> outputs = node.getOutputStreamFields();
assertEquals(getIterableSize(inputs), getIterableSize(outputs));
for (StreamFieldNode output : outputs) {
assertEquals(output.getName(), output.getFieldPopulatesMe().getName());
}
MongoConnectionNode datasource = node.getDatasource(meta.getDbName());
assertEquals(meta.getHostnames(), datasource.getHost());
assertEquals(meta.getPort(), datasource.getPort());
assertEquals(meta.getAuthenticationUser(), datasource.getUserName());
assertEquals(meta.getDbName(), datasource.getDatabaseName());
assertEquals(DictionaryConst.NODE_TYPE_MONGODB_CONNECTION, datasource.getType());
FramedMetaverseNode collection = node.getCollection();
assertEquals(meta.getCollection(), collection.getName());
assertEquals(DictionaryConst.NODE_TYPE_MONGODB_COLLECTION, collection.getType());
}
Aggregations