use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class JobAnalyzerTest method testAnalyzerJobWithEntries.
@Test
public void testAnalyzerJobWithEntries() throws MetaverseAnalyzerException {
// increases line code coverage by adding entries to the job
IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
assertNotNull(node);
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class JobAnalyzerTest method testAnalyzerJobWithEntriesAndHop.
@Test
public void testAnalyzerJobWithEntriesAndHop() throws MetaverseAnalyzerException {
JobEntryCopy mockToEntryMeta = mock(JobEntryCopy.class);
when(mockToEntryMeta.getEntry()).thenReturn(mockJobEntryInterface);
when(mockToEntryMeta.getParentJobMeta()).thenReturn(mockContent);
when(mockContent.nrJobEntries()).thenReturn(2);
when(mockContent.getJobEntry(0)).thenReturn(mockJobEntry);
when(mockContent.getJobEntry(1)).thenReturn(mockToEntryMeta);
when(mockContent.nrJobHops()).thenReturn(1);
final JobHopMeta hop = new JobHopMeta(mockJobEntry, mockToEntryMeta);
when(mockContent.getJobHop(0)).thenReturn(hop);
IMetaverseNode node = analyzer.analyze(descriptor, mockJobDoc);
assertNotNull(node);
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class TransformationAnalyzerTest method testAnalyzerTransformWithFullMetadata.
@Test
public void testAnalyzerTransformWithFullMetadata() throws MetaverseAnalyzerException {
when(mockContent.getDescription()).thenReturn("I am a description");
when(mockContent.getExtendedDescription()).thenReturn("I am an extended description");
when(mockContent.getTransversion()).thenReturn("1.0");
Date now = Calendar.getInstance().getTime();
when(mockContent.getCreatedDate()).thenReturn(now);
when(mockContent.getCreatedUser()).thenReturn("joe");
when(mockContent.getModifiedDate()).thenReturn(now);
when(mockContent.getModifiedUser()).thenReturn("suzy");
// Production
when(mockContent.getTransstatus()).thenReturn(1);
IMetaverseNode node = analyzer.analyze(descriptor, mockTransDoc);
assertNotNull(node);
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class TransformationAnalyzerTest method testAnalyzerTransformWithStep.
@Test
public void testAnalyzerTransformWithStep() throws MetaverseAnalyzerException {
// increases line code coverage by adding step to transformation
IMetaverseNode node = analyzer.analyze(descriptor, mockTransDoc);
assertNotNull(node);
}
use of org.pentaho.metaverse.api.IMetaverseNode in project pentaho-metaverse by pentaho.
the class CsvFileInputStepAnalyzerTest 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());
}
Aggregations