use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class CsvInputMeta method getResourceDependencies.
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
if (!Utils.isEmpty(filename)) {
// Add the filename to the references, including a reference to this
// step meta data.
//
reference.getEntries().add(new ResourceEntry(transMeta.environmentSubstitute(filename), ResourceType.FILE));
}
return references;
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class GetFileNamesMeta method getResourceDependencies.
@Override
public List<ResourceReference> getResourceDependencies(TransMeta transMeta, StepMeta stepInfo) {
List<ResourceReference> references = new ArrayList<ResourceReference>(5);
ResourceReference reference = new ResourceReference(stepInfo);
references.add(reference);
String[] files = getFilePaths(transMeta);
if (files != null) {
for (int i = 0; i < files.length; i++) {
reference.getEntries().add(new ResourceEntry(files[i], ResourceType.FILE));
}
}
return references;
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class MetaInjectMetaTest method getResourceDependencies.
@Test
public void getResourceDependencies() {
TransMeta transMeta = mock(TransMeta.class);
StepMeta stepMeta = mock(StepMeta.class);
List<ResourceReference> actualResult = metaInjectMeta.getResourceDependencies(transMeta, stepMeta);
assertEquals(1, actualResult.size());
ResourceReference reference = actualResult.iterator().next();
assertEquals(0, reference.getEntries().size());
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class MetaInjectMetaTest method getResourceDependencies_with_defined_fileName.
@Test
public void getResourceDependencies_with_defined_fileName() {
TransMeta transMeta = mock(TransMeta.class);
StepMeta stepMeta = mock(StepMeta.class);
metaInjectMeta.setFileName("FILE_NAME");
doReturn("FILE_NAME_WITH_SUBSTITUTIONS").when(transMeta).environmentSubstitute("FILE_NAME");
List<ResourceReference> actualResult = metaInjectMeta.getResourceDependencies(transMeta, stepMeta);
assertEquals(1, actualResult.size());
ResourceReference reference = actualResult.iterator().next();
assertEquals(1, reference.getEntries().size());
}
use of org.pentaho.di.resource.ResourceReference in project pentaho-kettle by pentaho.
the class MetaInjectMetaTest method getResourceDependencies_with_defined_transName.
@Test
public void getResourceDependencies_with_defined_transName() {
TransMeta transMeta = mock(TransMeta.class);
StepMeta stepMeta = mock(StepMeta.class);
metaInjectMeta.setTransName("TRANS_NAME");
doReturn("TRANS_NAME_WITH_SUBSTITUTIONS").when(transMeta).environmentSubstitute("TRANS_NAME");
List<ResourceReference> actualResult = metaInjectMeta.getResourceDependencies(transMeta, stepMeta);
assertEquals(1, actualResult.size());
ResourceReference reference = actualResult.iterator().next();
assertEquals(1, reference.getEntries().size());
}
Aggregations