@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() ); }
@Override public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) { List<ResourceReference> references = new ArrayList<ResourceReference>( 5 ); String realFilename = transMeta.environmentSubstitute( fileName ); String realTransname = transMeta.environmentSubstitute( transName ); ResourceReference reference = new ResourceReference( stepInfo ); references.add( reference ); if ( !Utils.isEmpty( realFilename ) ) { reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) ); } else if ( !Utils.isEmpty( realTransname ) ) { reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) ); } return references; }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { @Override public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) { List<ResourceReference> references = new ArrayList<ResourceReference>( 5 ); String realFilename = transMeta.environmentSubstitute( fileName ); String realTransname = transMeta.environmentSubstitute( transName ); ResourceReference reference = new ResourceReference( stepInfo ); references.add( reference ); if ( !Utils.isEmpty( realFilename ) ) { reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) ); } else if ( !Utils.isEmpty( realTransname ) ) { reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) ); } return references; } }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { @Override public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) { List<ResourceReference> references = new ArrayList<ResourceReference>( 5 ); String realFilename = transMeta.environmentSubstitute( fileName ); String realTransname = transMeta.environmentSubstitute( transName ); ResourceReference reference = new ResourceReference( stepInfo ); references.add( reference ); if ( !Utils.isEmpty( realFilename ) ) { reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) ); } else if ( !Utils.isEmpty( realTransname ) ) { reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) ); } return references; } MetaInjectMeta(); }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { @Override public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) { List<ResourceReference> references = new ArrayList<ResourceReference>( 5 ); String realFilename = transMeta.environmentSubstitute( fileName ); String realTransname = transMeta.environmentSubstitute( transName ); ResourceReference reference = new ResourceReference( stepInfo ); references.add( reference ); if ( !Utils.isEmpty( realFilename ) ) { reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) ); } else if ( !Utils.isEmpty( realTransname ) ) { reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) ); } return references; } MetaInjectMeta(); @Override Object clone(); @Override void setDefault(); @Override String getXML(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); Map<TargetStepAttribute, SourceStepField> getTargetSourceMapping(); void setTargetSourceMapping( Map<TargetStepAttribute, SourceStepField> targetSourceMapping ); String getTransName(); void setTransName( String transName ); String getFileName(); void setFileName( String fileName ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId ); @Injection( name = "TRANS_OBJECT_ID" ) void setTransStringObjectId( String transStringObjectId ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); @Deprecated static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta mappingMeta, Repository rep,
                                                                     VariableSpace space ); static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta injectMeta, Repository rep,
                                                                     IMetaStore metaStore, VariableSpace space ); @Override List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); @Override boolean excludeFromCopyDistributeVerification(); @Override boolean excludeFromRowLayoutVerification(); String getSourceStepName(); void setSourceStepName( String sourceStepName ); String getTargetFile(); void setTargetFile( String targetFile ); boolean isNoExecution(); void setNoExecution( boolean noExecution ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override String getActiveReferencedObjectDescription(); @Override @Deprecated Object loadReferencedObject( int index, Repository rep, VariableSpace space ); @Override Object loadReferencedObject( int index, Repository rep, IMetaStore metaStore, VariableSpace space ); String getStreamSourceStepname(); void setStreamSourceStepname( String streamSourceStepname ); StepMeta getStreamSourceStep(); void setStreamSourceStep( StepMeta streamSourceStep ); String getStreamTargetStepname(); void setStreamTargetStepname( String streamTargetStepname ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); List<MetaInjectOutputField> getSourceOutputFields(); void setSourceOutputFields( List<MetaInjectOutputField> sourceOutputFields ); List<MetaInjectMapping> getMetaInjectMapping(); void setMetaInjectMapping( List<MetaInjectMapping> metaInjectMapping ); void actualizeMetaInjectMapping(); @Override void onStepChange( TransMeta transMeta, StepMeta oldMeta, StepMeta newMeta ); }
MetaInjectMeta extends BaseStepMeta implements StepMetaInterface, StepMetaChangeListenerInterface { @Override public List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ) { List<ResourceReference> references = new ArrayList<ResourceReference>( 5 ); String realFilename = transMeta.environmentSubstitute( fileName ); String realTransname = transMeta.environmentSubstitute( transName ); ResourceReference reference = new ResourceReference( stepInfo ); references.add( reference ); if ( !Utils.isEmpty( realFilename ) ) { reference.getEntries().add( new ResourceEntry( realFilename, ResourceType.ACTIONFILE ) ); } else if ( !Utils.isEmpty( realTransname ) ) { reference.getEntries().add( new ResourceEntry( realTransname, ResourceType.ACTIONFILE ) ); } return references; } MetaInjectMeta(); @Override Object clone(); @Override void setDefault(); @Override String getXML(); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,
                                Trans trans ); @Override StepDataInterface getStepData(); Map<TargetStepAttribute, SourceStepField> getTargetSourceMapping(); void setTargetSourceMapping( Map<TargetStepAttribute, SourceStepField> targetSourceMapping ); String getTransName(); void setTransName( String transName ); String getFileName(); void setFileName( String fileName ); String getDirectoryPath(); void setDirectoryPath( String directoryPath ); ObjectId getTransObjectId(); void setTransObjectId( ObjectId transObjectId ); @Injection( name = "TRANS_OBJECT_ID" ) void setTransStringObjectId( String transStringObjectId ); ObjectLocationSpecificationMethod getSpecificationMethod(); void setSpecificationMethod( ObjectLocationSpecificationMethod specificationMethod ); @Deprecated static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta mappingMeta, Repository rep,
                                                                     VariableSpace space ); static final synchronized TransMeta loadTransformationMeta( MetaInjectMeta injectMeta, Repository rep,
                                                                     IMetaStore metaStore, VariableSpace space ); @Override List<ResourceReference> getResourceDependencies( TransMeta transMeta, StepMeta stepInfo ); @Override String exportResources( VariableSpace space, Map<String, ResourceDefinition> definitions,
                                 ResourceNamingInterface resourceNamingInterface, Repository repository,
                                 IMetaStore metaStore ); @Override boolean excludeFromCopyDistributeVerification(); @Override boolean excludeFromRowLayoutVerification(); String getSourceStepName(); void setSourceStepName( String sourceStepName ); String getTargetFile(); void setTargetFile( String targetFile ); boolean isNoExecution(); void setNoExecution( boolean noExecution ); @Override String[] getReferencedObjectDescriptions(); @Override boolean[] isReferencedObjectEnabled(); @Override String getActiveReferencedObjectDescription(); @Override @Deprecated Object loadReferencedObject( int index, Repository rep, VariableSpace space ); @Override Object loadReferencedObject( int index, Repository rep, IMetaStore metaStore, VariableSpace space ); String getStreamSourceStepname(); void setStreamSourceStepname( String streamSourceStepname ); StepMeta getStreamSourceStep(); void setStreamSourceStep( StepMeta streamSourceStep ); String getStreamTargetStepname(); void setStreamTargetStepname( String streamTargetStepname ); @Override void searchInfoAndTargetSteps( List<StepMeta> steps ); List<MetaInjectOutputField> getSourceOutputFields(); void setSourceOutputFields( List<MetaInjectOutputField> sourceOutputFields ); List<MetaInjectMapping> getMetaInjectMapping(); void setMetaInjectMapping( List<MetaInjectMapping> metaInjectMapping ); void actualizeMetaInjectMapping(); @Override void onStepChange( TransMeta transMeta, StepMeta oldMeta, StepMeta newMeta );  }