### Question:
JobRuntimeExtensionPoint extends BaseRuntimeExtensionPoint implements JobListener { @Override public void callExtensionPoint( LogChannelInterface logChannelInterface, Object o ) throws KettleException { if ( o instanceof Job ) { Job job = ( (Job) o ); if ( !isRuntimeEnabled() ) { return; } job.addJobListener( this ); createExecutionProfile( logChannelInterface, job ); setConsoleLog( logChannelInterface ); } }  @Override void callExtensionPoint( LogChannelInterface logChannelInterface, Object o ); @Override void jobFinished( final Job job ); @Override void jobStarted( Job job ); static String getFilename( Job job ); static String getFilename( JobMeta jobMeta );  }### Answer:
@Test public void testCallExtensionPoint() throws Exception { JobLineageHolderMap originalHolderMap = mockBuilder(); jobExtensionPoint.callExtensionPoint( null, job ); List<JobListener> listeners = job.getJobListeners(); assertNotNull( listeners ); assertTrue( listeners.contains( jobExtensionPoint ) ); JobLineageHolderMap.setInstance( originalHolderMap ); }
@Test public void testJobMetaVariablesAreCombinedWithExistingJobVariables() throws Exception { JobLineageHolderMap originalHolderMap = mockBuilder(); JobRuntimeExtensionPoint extensionPoint = new JobRuntimeExtensionPoint(); IDocumentAnalyzer documentAnalyzer = Mockito.mock( IDocumentAnalyzer.class ); final IMetaverseObjectFactory objectFactory = mock( IMetaverseObjectFactory.class ); when( mockBuilder.getMetaverseObjectFactory() ).thenReturn( objectFactory ); final IDocument document = mock( IDocument.class ); when( objectFactory.createDocumentObject() ).thenReturn( document ); job.setVariable( "dontloseme", "okipromise" ); extensionPoint.callExtensionPoint( null, job ); assertEquals( "okipromise", job.getVariable( "dontloseme" ) ); JobLineageHolderMap.setInstance( originalHolderMap ); }
@Test public void testRuntimeDisabled() throws Exception { jobExtensionPoint.setRuntimeEnabled( false ); jobExtensionPoint.callExtensionPoint( null, job ); List<JobListener> listeners = job.getJobListeners(); assertNotNull( listeners ); assertFalse( listeners.contains( jobExtensionPoint ) ); }