Search in sources :

Example 1 with DatabaseConnectionAnalyzer

use of org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer in project pentaho-metaverse by pentaho.

the class TableInputStepAnalyzerTest method testSetBaseStepMeta.

@Test
public void testSetBaseStepMeta() throws Exception {
    analyzer.setBaseStepMeta(meta);
    DatabaseConnectionAnalyzer dbAnalyzer = mock(DatabaseConnectionAnalyzer.class);
    doReturn(dbAnalyzer).when(analyzer).getConnectionAnalyzer();
    analyzer.getConnectionNode();
    verify(meta, times(1)).getDatabaseMeta();
}
Also used : DatabaseConnectionAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer) Test(org.junit.Test)

Example 2 with DatabaseConnectionAnalyzer

use of org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer in project pentaho-metaverse by pentaho.

the class JobEntryAnalyzerTest method addConnectionNodes.

@Test
public void addConnectionNodes() throws MetaverseAnalyzerException {
    DatabaseMeta[] dbs = new DatabaseMeta[] { mockDatabaseMeta };
    analyzer.jobEntryInterface = mockJobEntryInterface;
    // analyzer.addConnectionNodes( mockDescriptor );
    DatabaseConnectionAnalyzer dbAnalyzer = new JobEntryDatabaseConnectionAnalyzer();
    dbAnalyzer.setMetaverseBuilder(mockBuilder);
    analyzer.setConnectionAnalyzer(dbAnalyzer);
    when(analyzer.getConnectionAnalyzer()).thenReturn(dbAnalyzer);
    when(mockJobEntryInterface.getUsedDatabaseConnections()).thenReturn(dbs);
    analyzer.addConnectionNodes(mockDescriptor);
}
Also used : DatabaseConnectionAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) Test(org.junit.Test)

Example 3 with DatabaseConnectionAnalyzer

use of org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer in project pentaho-metaverse by pentaho.

the class TableInputStepAnalyzerTest method testGetConnectionNode.

@Test
public void testGetConnectionNode() throws Exception {
    DatabaseConnectionAnalyzer dbAnalyzer = mock(DatabaseConnectionAnalyzer.class);
    when(meta.getDatabaseMeta()).thenReturn(dbMeta);
    when(dbAnalyzer.analyze(descriptor, dbMeta)).thenReturn(connectionNode);
    doReturn(dbAnalyzer).when(analyzer).getConnectionAnalyzer();
    IMetaverseNode node = analyzer.getConnectionNode();
    verify(analyzer).getConnectionAnalyzer();
    verify(dbAnalyzer).analyze(descriptor, dbMeta);
    assertEquals(node, connectionNode);
}
Also used : IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) DatabaseConnectionAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 DatabaseConnectionAnalyzer (org.pentaho.metaverse.api.analyzer.kettle.DatabaseConnectionAnalyzer)3 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)1 IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)1