use of org.pentaho.metaverse.api.MetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class BaseKettleMetaverseComponentTest method testCreateFileNode.
@Test
public void testCreateFileNode() throws Exception {
component.createFileNode(null, null);
assertNull(component.createFileNode("/path/to/my/file", null));
IMetaverseBuilder metaverseBuilder = mock(IMetaverseBuilder.class);
when(metaverseBuilder.getMetaverseObjectFactory()).thenReturn(new MetaverseObjectFactory());
component.setMetaverseBuilder(metaverseBuilder);
IComponentDescriptor descriptor = mock(IComponentDescriptor.class);
INamespace ns = mock(INamespace.class);
when(descriptor.getNamespace()).thenReturn(ns);
assertNotNull(component.createFileNode("/path/to/my/file", descriptor));
}
use of org.pentaho.metaverse.api.MetaverseObjectFactory in project pentaho-metaverse by pentaho.
the class ExternalResourceStepAnalyzerTest method setUp.
@Before
public void setUp() throws Exception {
analyzer = spy(new ExternalResourceStepAnalyzer<BaseStepMeta>() {
@Override
public Set<Class<? extends BaseStepMeta>> getSupportedSteps() {
return null;
}
@Override
protected Set<StepField> getUsedFields(BaseStepMeta meta) {
Set<StepField> stepFields = new HashSet<>();
stepFields.add(new StepField("prevStep", "filename"));
return stepFields;
}
@Override
public IMetaverseNode createResourceNode(IExternalResourceInfo resource) throws MetaverseException {
return resourceNode;
}
@Override
public String getResourceInputNodeType() {
return "INPUT_TYPE";
}
@Override
public String getResourceOutputNodeType() {
return "OUTPUT_TYPE";
}
@Override
public boolean isOutput() {
return false;
}
@Override
public boolean isInput() {
return true;
}
});
when(analyzer.getMetaverseBuilder()).thenReturn(builder);
analyzer.descriptor = descriptor;
analyzer.parentTransMeta = parentTransMeta;
analyzer.parentStepMeta = parentStepMeta;
analyzer.setMetaverseObjectFactory(new MetaverseObjectFactory());
}
Aggregations