@Test public void testCallExtensionPoint() throws Exception { runConfigurationInjectExtensionPoint.callExtensionPoint( log, executionExt ); verify( runConfigurationManager, times( 2 ) ).load( eq( runConfName ) ); }
@Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { if ( !( object instanceof JobExecutionExtension ) ) { return; } JobExecutionExtension extension = (JobExecutionExtension) object; Job job = extension.job; JobMeta jobMeta = job.getJobMeta(); final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore(); RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build( embeddedMetaStore ); for ( JobEntryTrans trans : job.getActiveJobEntryTransformations().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( trans.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } for ( JobEntryJob subJob : job.getActiveJobEntryJobs().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( subJob.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } }
RunConfigurationInjectExtensionPoint implements ExtensionPointInterface { @Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { if ( !( object instanceof JobExecutionExtension ) ) { return; } JobExecutionExtension extension = (JobExecutionExtension) object; Job job = extension.job; JobMeta jobMeta = job.getJobMeta(); final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore(); RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build( embeddedMetaStore ); for ( JobEntryTrans trans : job.getActiveJobEntryTransformations().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( trans.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } for ( JobEntryJob subJob : job.getActiveJobEntryJobs().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( subJob.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } } }
RunConfigurationInjectExtensionPoint implements ExtensionPointInterface { @Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { if ( !( object instanceof JobExecutionExtension ) ) { return; } JobExecutionExtension extension = (JobExecutionExtension) object; Job job = extension.job; JobMeta jobMeta = job.getJobMeta(); final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore(); RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build( embeddedMetaStore ); for ( JobEntryTrans trans : job.getActiveJobEntryTransformations().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( trans.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } for ( JobEntryJob subJob : job.getActiveJobEntryJobs().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( subJob.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } } RunConfigurationInjectExtensionPoint( RunConfigurationManager runConfigurationManager ); }
RunConfigurationInjectExtensionPoint implements ExtensionPointInterface { @Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { if ( !( object instanceof JobExecutionExtension ) ) { return; } JobExecutionExtension extension = (JobExecutionExtension) object; Job job = extension.job; JobMeta jobMeta = job.getJobMeta(); final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore(); RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build( embeddedMetaStore ); for ( JobEntryTrans trans : job.getActiveJobEntryTransformations().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( trans.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } for ( JobEntryJob subJob : job.getActiveJobEntryJobs().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( subJob.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } } RunConfigurationInjectExtensionPoint( RunConfigurationManager runConfigurationManager ); @Override void callExtensionPoint( LogChannelInterface log, Object object ); }
RunConfigurationInjectExtensionPoint implements ExtensionPointInterface { @Override public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException { if ( !( object instanceof JobExecutionExtension ) ) { return; } JobExecutionExtension extension = (JobExecutionExtension) object; Job job = extension.job; JobMeta jobMeta = job.getJobMeta(); final EmbeddedMetaStore embeddedMetaStore = jobMeta.getEmbeddedMetaStore(); RunConfigurationManager embeddedRunConfigurationManager = EmbeddedRunConfigurationManager.build( embeddedMetaStore ); for ( JobEntryTrans trans : job.getActiveJobEntryTransformations().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( trans.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } for ( JobEntryJob subJob : job.getActiveJobEntryJobs().values() ) { RunConfiguration loadedRunConfiguration = runConfigurationManager.load( jobMeta.environmentSubstitute( subJob.getRunConfiguration() ) ); embeddedRunConfigurationManager.save( loadedRunConfiguration ); } } RunConfigurationInjectExtensionPoint( RunConfigurationManager runConfigurationManager ); @Override void callExtensionPoint( LogChannelInterface log, Object object );  }