use of org.pentaho.metaverse.frames.JobEntryNode in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testJobEntryNodes.
@Test
public void testJobEntryNodes() throws Exception {
for (JobNode jobNode : root.getJobs()) {
JobMeta jobMeta = new JobMeta(new FileInputStream(jobNode.getPath()), null, null);
int numJobEntries = jobMeta.nrJobEntries();
int matchCount = 0;
for (int i = 0; i < numJobEntries; i++) {
JobEntryCopy jobEntry = jobMeta.getJobEntry(i);
assertNotNull(jobEntry);
JobEntryNode jobEntryNode = jobNode.getJobEntryNode(jobEntry.getName());
assertNotNull("Job Entry " + jobEntry.getName() + " should be in the graph!", jobEntryNode);
assertEquals(jobEntry.getName(), jobEntryNode.getName());
assertEquals(jobEntry.getDescription(), jobEntryNode.getDescription());
assertEquals("Incorrect type", DictionaryConst.NODE_TYPE_JOB_ENTRY, jobEntryNode.getType());
assertEquals("Incorrect entity type", DictionaryConst.NODE_TYPE_JOB_ENTRY, jobEntryNode.getEntity().getName());
matchCount++;
}
assertEquals("Not all job entries are accounted for in the graph for Job [" + jobMeta.getName() + "]", numJobEntries, matchCount);
assertEquals("Incorrect number of job entries for in the graph for Job [" + jobMeta.getName() + "]", numJobEntries, getIterableSize(jobNode.getJobEntryNodes()));
// it should be contained in a "Locator" node
jobNode.getLocator();
}
}
Aggregations