use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class ExcelOutputStepAnalyzerTest method testCreateResourceNode.
@Test
public void testCreateResourceNode() throws Exception {
IExternalResourceInfo res = mock(IExternalResourceInfo.class);
when(res.getName()).thenReturn("file:///Users/home/tmp/xyz.ktr");
IMetaverseNode resourceNode = analyzer.createResourceNode(res);
assertNotNull(resourceNode);
assertEquals(DictionaryConst.NODE_TYPE_FILE, resourceNode.getType());
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class HTTPClientStepAnalyzerTest method testCreateResourceNode.
@Test
public void testCreateResourceNode() throws Exception {
IExternalResourceInfo res = mock(IExternalResourceInfo.class);
when(res.getName()).thenReturn("http://my.rest.url");
IMetaverseNode resourceNode = analyzer.createResourceNode(res);
assertNotNull(resourceNode);
assertEquals(DictionaryConst.NODE_TYPE_WEBSERVICE, resourceNode.getType());
assertEquals("http://my.rest.url", resourceNode.getName());
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class HTTPPostStepAnalyzerTest method testCreateResourceNode.
@Test
public void testCreateResourceNode() throws Exception {
IExternalResourceInfo res = mock(IExternalResourceInfo.class);
when(res.getName()).thenReturn("http://my.rest.url");
IMetaverseNode resourceNode = analyzer.createResourceNode(res);
assertNotNull(resourceNode);
assertEquals(DictionaryConst.NODE_TYPE_WEBSERVICE, resourceNode.getType());
assertEquals("http://my.rest.url", resourceNode.getName());
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class MongoDbInputStepAnalyzerTest method testCreateTableNode.
@Test
public void testCreateTableNode() throws Exception {
IConnectionAnalyzer connectionAnalyzer = mock(IConnectionAnalyzer.class);
doReturn(connectionAnalyzer).when(analyzer).getConnectionAnalyzer();
IMetaverseNode connNode = mock(IMetaverseNode.class);
when(connectionAnalyzer.analyze(any(IComponentDescriptor.class), anyObject())).thenReturn(connNode);
MongoDbResourceInfo resourceInfo = mock(MongoDbResourceInfo.class);
when(resourceInfo.getCollection()).thenReturn("myCollection");
IMetaverseNode connectionNode = mock(IMetaverseNode.class);
doReturn(connectionNode).when(analyzer).getConnectionNode();
when(connectionNode.getLogicalId()).thenReturn("CONNECTION_ID");
IMetaverseNode resourceNode = analyzer.createTableNode(resourceInfo);
assertEquals("myCollection", resourceNode.getProperty(MongoDbInputStepAnalyzer.COLLECTION));
assertEquals("myCollection", resourceNode.getName());
assertEquals("CONNECTION_ID", resourceNode.getProperty(DictionaryConst.PROPERTY_NAMESPACE));
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class MongoDbInputStepAnalyzerTest method testCustomAnalyze_jsonOutput.
@Test
public void testCustomAnalyze_jsonOutput() throws Exception {
when(meta.getOutputJson()).thenReturn(true);
when(meta.getCollection()).thenReturn("myCollection");
IMetaverseNode node = new MetaverseTransientNode("new node");
analyzer.customAnalyze(meta, node);
assertNotNull(node);
assertEquals("myCollection", node.getProperty(MongoDbInputStepAnalyzer.COLLECTION));
assertTrue((Boolean) node.getProperty(MongoDbInputStepAnalyzer.OUTPUT_JSON));
assertNull(node.getProperty(DictionaryConst.PROPERTY_QUERY));
assertNull(node.getProperty(MongoDbInputStepAnalyzer.AGG_PIPELINE));
}
Aggregations