use of org.pentaho.metaverse.api.model.LineageHolder in project pentaho-metaverse by pentaho.
the class JobLineageHolderMapTest method testGetPutLineageHolder.
@Test
public void testGetPutLineageHolder() throws Exception {
Job job = mock(Job.class);
LineageHolder holder = jobLineageHolderMap.getLineageHolder(job);
// We always get a (perhaps empty) holder
assertNotNull(holder);
assertFalse(holder == mockHolder);
assertNull(holder.getExecutionProfile());
assertNull(holder.getMetaverseBuilder());
mockHolder.setMetaverseBuilder(mockBuilder);
mockHolder.setExecutionProfile(mockExecutionProfile);
jobLineageHolderMap.putLineageHolder(job, mockHolder);
holder = jobLineageHolderMap.getLineageHolder(job);
// We always get a (perhaps empty) holder
assertNotNull(holder);
assertTrue(holder == mockHolder);
assertTrue(holder.getExecutionProfile() == mockExecutionProfile);
assertTrue(holder.getMetaverseBuilder() == mockBuilder);
}
use of org.pentaho.metaverse.api.model.LineageHolder in project pentaho-metaverse by pentaho.
the class TransLineageHolderMapTest method testGetPutLineageHolder.
@Test
public void testGetPutLineageHolder() throws Exception {
Trans trans = mock(Trans.class);
LineageHolder holder = jobLineageHolderMap.getLineageHolder(trans);
// We always get a (perhaps empty) holder
assertNotNull(holder);
assertFalse(holder == mockHolder);
assertNull(holder.getExecutionProfile());
assertNull(holder.getMetaverseBuilder());
mockHolder.setMetaverseBuilder(mockBuilder);
mockHolder.setExecutionProfile(mockExecutionProfile);
jobLineageHolderMap.putLineageHolder(trans, mockHolder);
holder = jobLineageHolderMap.getLineageHolder(trans);
// We always get a (perhaps empty) holder
assertNotNull(holder);
assertTrue(holder == mockHolder);
assertTrue(holder.getExecutionProfile() == mockExecutionProfile);
assertTrue(holder.getMetaverseBuilder() == mockBuilder);
}
use of org.pentaho.metaverse.api.model.LineageHolder in project pentaho-metaverse by pentaho.
the class StepExternalConsumerRowListenerTest method testStepExternalConsumerRowListener.
@Test
public void testStepExternalConsumerRowListener() throws Exception {
IStepExternalResourceConsumer consumer = mock(IStepExternalResourceConsumer.class);
BaseStep mockStep = mock(BaseStep.class, withSettings().extraInterfaces(StepInterface.class));
StepMeta mockStepMeta = mock(StepMeta.class);
BaseStepMeta bsm = mock(BaseStepMeta.class, withSettings().extraInterfaces(StepMetaInterface.class));
StepMetaInterface stepMetaInterface = (StepMetaInterface) bsm;
when(mockStep.getStepMeta()).thenReturn(mockStepMeta);
when(mockStepMeta.getStepMetaInterface()).thenReturn(stepMetaInterface);
Trans mockTrans = mock(Trans.class);
when(mockStep.getTrans()).thenReturn(mockTrans);
IExecutionProfile executionProfile = mock(IExecutionProfile.class);
IExecutionData executionData = mock(IExecutionData.class);
when(executionProfile.getExecutionData()).thenReturn(executionData);
LineageHolder holder = new LineageHolder();
holder.setExecutionProfile(executionProfile);
TransLineageHolderMap.getInstance().putLineageHolder(mockTrans, holder);
StepExternalConsumerRowListener listener = new StepExternalConsumerRowListener(consumer, mockStep);
RowMetaInterface rmi = mock(RowMetaInterface.class);
Object[] row = new Object[0];
listener.rowReadEvent(rmi, row);
}
use of org.pentaho.metaverse.api.model.LineageHolder in project pentaho-metaverse by pentaho.
the class LineageWriterTest method setUp.
@Before
public void setUp() throws Exception {
LineageWriter fslw = new LineageWriter();
writer = spy(fslw);
holder = new LineageHolder();
IExecutionProfile profile = new ExecutionProfile();
profile.setName("test");
IExecutionData data = new ExecutionData();
data.setStartTime(now);
profile.setExecutionData(data);
holder.setExecutionProfile(profile);
}
use of org.pentaho.metaverse.api.model.LineageHolder in project pentaho-metaverse by pentaho.
the class VfsLineageWriterTest method setUp.
@Before
public void setUp() throws Exception {
String basePath = new File(".").getCanonicalPath();
writer = new VfsLineageWriter();
writer = spy(writer);
holder = new LineageHolder();
IExecutionProfile profile = new ExecutionProfile();
profile.setName("test");
IExecutionData data = new ExecutionData();
data.setStartTime(now);
profile.setExecutionData(data);
holder.setExecutionProfile(profile);
BAD_OUTPUT_FOLDER = FilenameUtils.separatorsToSystem("file://" + basePath + BAD_OUTPUT_FOLDER_DEFAULT + random.nextInt());
GOOD_OUTPUT_FOLDER = FilenameUtils.separatorsToSystem("file://" + basePath + GOOD_OUTPUT_FOLDER_DEFAULT + random.nextInt());
writer.setOutputFolder(GOOD_OUTPUT_FOLDER);
}
Aggregations