use of org.pentaho.metaverse.api.IMetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class DocumentControllerTest method testGetMetaverseObjectFactory_nullBuilder.
@Test
public void testGetMetaverseObjectFactory_nullBuilder() throws Exception {
DocumentController dc = new DocumentController(null);
IMetaverseObjectFactory factory = mock(IMetaverseObjectFactory.class);
assertNull(dc.getMetaverseObjectFactory());
verify(mockBuilder, never()).getMetaverseObjectFactory();
}
use of org.pentaho.metaverse.api.IMetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class DocumentControllerTest method setup.
@Before
public void setup() {
docController = new DocumentController();
IMetaverseBuilder builder = mock(IMetaverseBuilder.class);
docController.setMetaverseBuilder(builder);
IMetaverseObjectFactory objectFactory = mock(IMetaverseObjectFactory.class);
docController.setMetaverseObjectFactory(objectFactory);
initAnalyzers();
}
use of org.pentaho.metaverse.api.IMetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class JobEntryAnalyzerTest method setUp.
/**
* @throws Exception
*/
@Before
public void setUp() throws Exception {
IMetaverseObjectFactory factory = MetaverseTestUtils.getMetaverseObjectFactory();
when(mockBuilder.getMetaverseObjectFactory()).thenReturn(factory);
JobEntryAnalyzer baseAnalyzer = new JobEntryAnalyzer() {
@Override
public Set<Class<? super JobEntryCopy>> getSupportedEntries() {
return null;
}
@Override
protected void customAnalyze(JobEntryInterface entry, IMetaverseNode rootNode) throws MetaverseAnalyzerException {
// TODO Auto-generated method stub
}
};
analyzer = spy(baseAnalyzer);
analyzer.setMetaverseBuilder(mockBuilder);
when(mockEntry.getEntry()).thenReturn(mockJobEntryInterface);
when(mockJobEntryInterface.getPluginId()).thenReturn("Base job entry");
when(mockJobEntryInterface.getParentJob()).thenReturn(mockJob);
when(mockJob.getJobMeta()).thenReturn(mockJobMeta);
}
use of org.pentaho.metaverse.api.IMetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class JobAnalyzerTest method setUp.
/**
* @throws Exception
*/
@Before
public void setUp() throws Exception {
IMetaverseObjectFactory factory = MetaverseTestUtils.getMetaverseObjectFactory();
when(mockBuilder.getMetaverseObjectFactory()).thenReturn(factory);
analyzer = new JobAnalyzer();
analyzer.setMetaverseBuilder(mockBuilder);
when(namespace.getParentNamespace()).thenReturn(namespace);
when(mockJobDoc.getType()).thenReturn(DictionaryConst.NODE_TYPE_JOB);
when(mockJobDoc.getContent()).thenReturn(mockContent);
when(mockJobDoc.getNamespace()).thenReturn(namespace);
when(mockContent.nrJobEntries()).thenReturn(1);
when(mockContent.getJobEntry(0)).thenReturn(mockJobEntry);
when(mockJobEntry.getEntry()).thenReturn(mockJobEntryInterface);
when(mockJobEntryInterface.getParentJob()).thenReturn(mockJob);
when(mockJob.getJobMeta()).thenReturn(mockContent);
when(mockContent.listVariables()).thenReturn(new String[] {});
final String PARAM = "param1";
when(mockContent.listParameters()).thenReturn(new String[] { PARAM });
when(mockContent.getParameterDefault(PARAM)).thenReturn("default");
descriptor = new MetaverseComponentDescriptor("name", DictionaryConst.NODE_TYPE_JOB, namespace);
}
use of org.pentaho.metaverse.api.IMetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class MongoDbConnectionAnalyzerTest method setUp.
@Before
public void setUp() throws Exception {
IMetaverseObjectFactory factory = MetaverseTestUtils.getMetaverseObjectFactory();
when(mockBuilder.getMetaverseObjectFactory()).thenReturn(factory);
analyzer = new MongoDbConnectionAnalyzer();
analyzer.setMetaverseBuilder(mockBuilder);
when(mockDescriptor.getNamespace()).thenReturn(mock(INamespace.class));
when(mockDescriptor.getContext()).thenReturn(mock(IAnalysisContext.class));
when(mongoDbMeta.getHostnames()).thenReturn("localhost");
when(mongoDbMeta.getDbName()).thenReturn("db");
when(mongoDbMeta.getAuthenticationUser()).thenReturn("user");
when(mongoDbMeta.getPort()).thenReturn("12345");
}
Aggregations