private ILaunchManager mockLaunchManager() { ILaunchManager result = mock( ILaunchManager.class ); doAnswer( new Answer<Object>() { @Override public Object answer( InvocationOnMock invocation ) { launchesListeners.add( ( ILaunchesListener2 )invocation.getArguments()[ 0 ] ); return null; } } ).when( result ).addLaunchListener( any( ILaunchesListener2.class ) ); return result; }
private void fireLaunchTerminated( ILaunch launch ) { for( ILaunchesListener2 launchesListener : launchesListeners ) { launchesListener.launchesTerminated( new ILaunch[] { launch } ); } }