@Test public void testGetUsedArguments() throws KettleException { JobExecutionConfiguration executionConfiguration = new JobExecutionConfiguration(); JobMeta jobMeta = new JobMeta( ); jobMeta.jobcopies = new ArrayList<>( ); String[] commandLineArguments = new String[ 0 ]; IMetaStore metaStore = mock( IMetaStore.class ); JobEntryCopy jobEntryCopy0 = new JobEntryCopy( ); TransMeta transMeta0 = mock( TransMeta.class ); Map<String, String> map0 = new HashMap<>( ); map0.put( "arg0", "argument0" ); when( transMeta0.getUsedArguments( commandLineArguments ) ).thenReturn( map0 ); JobEntryInterface jobEntryInterface0 = mock( JobEntryInterface.class ); when( jobEntryInterface0.isTransformation() ).thenReturn( false ); jobEntryCopy0.setEntry( jobEntryInterface0 ); jobMeta.jobcopies.add( jobEntryCopy0 ); JobEntryCopy jobEntryCopy1 = new JobEntryCopy( ); TransMeta transMeta1 = mock( TransMeta.class ); Map<String, String> map1 = new HashMap<>( ); map1.put( "arg1", "argument1" ); when( transMeta1.getUsedArguments( commandLineArguments ) ).thenReturn( map1 ); JobEntryTrans jobEntryTrans1 = mock( JobEntryTrans.class ); when( jobEntryTrans1.isTransformation() ).thenReturn( true ); when( jobEntryTrans1.getTransMeta( executionConfiguration.getRepository(), metaStore, jobMeta ) ).thenReturn( transMeta1 ); jobEntryCopy1.setEntry( jobEntryTrans1 ); jobMeta.jobcopies.add( jobEntryCopy1 ); JobEntryCopy jobEntryCopy2 = new JobEntryCopy( ); TransMeta transMeta2 = mock( TransMeta.class ); Map<String, String> map2 = new HashMap<>( ); map2.put( "arg1", "argument1" ); map2.put( "arg2", "argument2" ); when( transMeta2.getUsedArguments( commandLineArguments ) ).thenReturn( map2 ); JobEntryTrans jobEntryTrans2 = mock( JobEntryTrans.class ); when( jobEntryTrans2.isTransformation() ).thenReturn( true ); when( jobEntryTrans2.getTransMeta( executionConfiguration.getRepository(), metaStore, jobMeta ) ).thenReturn( transMeta2 ); jobEntryCopy2.setEntry( jobEntryTrans2 ); jobMeta.jobcopies.add( jobEntryCopy2 ); executionConfiguration.getUsedArguments( jobMeta, commandLineArguments, metaStore ); assertEquals( 2, executionConfiguration.getArguments().size() ); }
public void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ) { for ( JobEntryCopy jobEntryCopy : jobMeta.jobcopies ) { if ( jobEntryCopy.isTransformation() ) { JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryCopy.getEntry(); try { TransMeta transMeta = jobEntryTrans.getTransMeta( repository, metaStore, jobMeta ); Map<String, String> map = transMeta.getUsedArguments( commandLineArguments ); for ( String key : map.keySet() ) { String value = map.get( key ); if ( !arguments.containsKey( key ) ) { arguments.put( key, value ); } } } catch ( KettleException ke ) { log.logBasic( ke.getMessage(), ke ); } } } }
JobExecutionConfiguration implements ExecutionConfiguration { public void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ) { for ( JobEntryCopy jobEntryCopy : jobMeta.jobcopies ) { if ( jobEntryCopy.isTransformation() ) { JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryCopy.getEntry(); try { TransMeta transMeta = jobEntryTrans.getTransMeta( repository, metaStore, jobMeta ); Map<String, String> map = transMeta.getUsedArguments( commandLineArguments ); for ( String key : map.keySet() ) { String value = map.get( key ); if ( !arguments.containsKey( key ) ) { arguments.put( key, value ); } } } catch ( KettleException ke ) { log.logBasic( ke.getMessage(), ke ); } } } } }
JobExecutionConfiguration implements ExecutionConfiguration { public void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ) { for ( JobEntryCopy jobEntryCopy : jobMeta.jobcopies ) { if ( jobEntryCopy.isTransformation() ) { JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryCopy.getEntry(); try { TransMeta transMeta = jobEntryTrans.getTransMeta( repository, metaStore, jobMeta ); Map<String, String> map = transMeta.getUsedArguments( commandLineArguments ); for ( String key : map.keySet() ) { String value = map.get( key ); if ( !arguments.containsKey( key ) ) { arguments.put( key, value ); } } } catch ( KettleException ke ) { log.logBasic( ke.getMessage(), ke ); } } } } JobExecutionConfiguration();  JobExecutionConfiguration( Node trecNode ); }
JobExecutionConfiguration implements ExecutionConfiguration { public void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ) { for ( JobEntryCopy jobEntryCopy : jobMeta.jobcopies ) { if ( jobEntryCopy.isTransformation() ) { JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryCopy.getEntry(); try { TransMeta transMeta = jobEntryTrans.getTransMeta( repository, metaStore, jobMeta ); Map<String, String> map = transMeta.getUsedArguments( commandLineArguments ); for ( String key : map.keySet() ) { String value = map.get( key ); if ( !arguments.containsKey( key ) ) { arguments.put( key, value ); } } } catch ( KettleException ke ) { log.logBasic( ke.getMessage(), ke ); } } } } JobExecutionConfiguration();  JobExecutionConfiguration( Node trecNode ); Object clone(); Map<String, String> getArguments(); void setArguments( Map<String, String> arguments ); void setParams( Map<String, String> params ); Map<String, String> getParams(); void setArgumentStrings( String[] arguments ); Map<String, String> getVariables(); void setVariables( Map<String, String> variables ); void setVariables( VariableSpace space ); boolean isExecutingRemotely(); void setExecutingRemotely( boolean remoteExecution ); boolean isExecutingLocally(); void setExecutingLocally( boolean localExecution ); SlaveServer getRemoteServer(); void setRemoteServer( SlaveServer remoteServer ); void getUsedVariables( JobMeta jobMeta ); Date getReplayDate(); void setReplayDate( Date replayDate ); boolean isSafeModeEnabled(); void setSafeModeEnabled( boolean usingSafeMode ); @Override String getRunConfiguration(); @Override void setRunConfiguration( String runConfiguration ); LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); String getXML(); Repository connectRepository( String repositoryName, String username, String password ); Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ); String[] getArgumentStrings(); Result getPreviousResult(); void setPreviousResult( Result previousResult ); Repository getRepository(); void setRepository( Repository repository ); boolean isClearingLog(); void setClearingLog( boolean clearingLog ); boolean isPassingExport(); void setPassingExport( boolean passingExport ); String getStartCopyName(); void setStartCopyName( String startCopyName ); int getStartCopyNr(); void setStartCopyNr( int startCopyNr ); boolean isGatheringMetrics(); void setGatheringMetrics( boolean gatheringMetrics ); void setExpandingRemoteJob( boolean expandingRemoteJob ); boolean isExpandingRemoteJob(); Map<String, String> getExtensionOptions(); void setExtensionOptions( Map<String, String> extensionOptions ); Long getPassedBatchId(); void setPassedBatchId( Long passedBatchId ); void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ); }
JobExecutionConfiguration implements ExecutionConfiguration { public void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ) { for ( JobEntryCopy jobEntryCopy : jobMeta.jobcopies ) { if ( jobEntryCopy.isTransformation() ) { JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryCopy.getEntry(); try { TransMeta transMeta = jobEntryTrans.getTransMeta( repository, metaStore, jobMeta ); Map<String, String> map = transMeta.getUsedArguments( commandLineArguments ); for ( String key : map.keySet() ) { String value = map.get( key ); if ( !arguments.containsKey( key ) ) { arguments.put( key, value ); } } } catch ( KettleException ke ) { log.logBasic( ke.getMessage(), ke ); } } } } JobExecutionConfiguration();  JobExecutionConfiguration( Node trecNode ); Object clone(); Map<String, String> getArguments(); void setArguments( Map<String, String> arguments ); void setParams( Map<String, String> params ); Map<String, String> getParams(); void setArgumentStrings( String[] arguments ); Map<String, String> getVariables(); void setVariables( Map<String, String> variables ); void setVariables( VariableSpace space ); boolean isExecutingRemotely(); void setExecutingRemotely( boolean remoteExecution ); boolean isExecutingLocally(); void setExecutingLocally( boolean localExecution ); SlaveServer getRemoteServer(); void setRemoteServer( SlaveServer remoteServer ); void getUsedVariables( JobMeta jobMeta ); Date getReplayDate(); void setReplayDate( Date replayDate ); boolean isSafeModeEnabled(); void setSafeModeEnabled( boolean usingSafeMode ); @Override String getRunConfiguration(); @Override void setRunConfiguration( String runConfiguration ); LogLevel getLogLevel(); void setLogLevel( LogLevel logLevel ); String getXML(); Repository connectRepository( String repositoryName, String username, String password ); Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ); String[] getArgumentStrings(); Result getPreviousResult(); void setPreviousResult( Result previousResult ); Repository getRepository(); void setRepository( Repository repository ); boolean isClearingLog(); void setClearingLog( boolean clearingLog ); boolean isPassingExport(); void setPassingExport( boolean passingExport ); String getStartCopyName(); void setStartCopyName( String startCopyName ); int getStartCopyNr(); void setStartCopyNr( int startCopyNr ); boolean isGatheringMetrics(); void setGatheringMetrics( boolean gatheringMetrics ); void setExpandingRemoteJob( boolean expandingRemoteJob ); boolean isExpandingRemoteJob(); Map<String, String> getExtensionOptions(); void setExtensionOptions( Map<String, String> extensionOptions ); Long getPassedBatchId(); void setPassedBatchId( Long passedBatchId ); void getUsedArguments( JobMeta jobMeta, String[] commandLineArguments, IMetaStore metaStore ); static final String XML_TAG; }