@Test public void readTwoClassesInThread() throws Throwable { final CountDownLatch counter = new CountDownLatch( 1 ); Runnable runnable = new Runnable() { @Override public void run() { Iterator<String> it = reader.getIterableClasses( new LegacyMasterProcessChannelEncoder( nul() ) ).iterator(); assertThat( it.next(), is( CommandReaderTest.class.getName() ) ); counter.countDown(); assertThat( it.next(), is( Foo.class.getName() ) ); } }; FutureTask<Object> futureTask = new FutureTask<>( runnable, null ); Thread t = new Thread( futureTask ); t.start(); counter.await(); addTestToPipeline( Foo.class.getName() ); try { futureTask.get(); } catch ( ExecutionException e ) { throw e.getCause(); } }
Iterable<String> getIterableClasses( MasterProcessChannelEncoder eventChannel ) { return new ClassesIterable( eventChannel ); }
CommandReader implements CommandChainReader { Iterable<String> getIterableClasses( MasterProcessChannelEncoder eventChannel ) { return new ClassesIterable( eventChannel ); } }
CommandReader implements CommandChainReader { Iterable<String> getIterableClasses( MasterProcessChannelEncoder eventChannel ) { return new ClassesIterable( eventChannel ); } CommandReader( MasterProcessChannelDecoder decoder, Shutdown shutdown, ConsoleLogger logger ); }
CommandReader implements CommandChainReader { Iterable<String> getIterableClasses( MasterProcessChannelEncoder eventChannel ) { return new ClassesIterable( eventChannel ); } CommandReader( MasterProcessChannelDecoder decoder, Shutdown shutdown, ConsoleLogger logger ); @Override boolean awaitStarted(); @Override void addSkipNextTestsListener( CommandListener listener ); @Override void addShutdownListener( CommandListener listener ); void addNoopListener( CommandListener listener ); void addByeAckListener( CommandListener listener ); void stop(); }
CommandReader implements CommandChainReader { Iterable<String> getIterableClasses( MasterProcessChannelEncoder eventChannel ) { return new ClassesIterable( eventChannel ); } CommandReader( MasterProcessChannelDecoder decoder, Shutdown shutdown, ConsoleLogger logger ); @Override boolean awaitStarted(); @Override void addSkipNextTestsListener( CommandListener listener ); @Override void addShutdownListener( CommandListener listener ); void addNoopListener( CommandListener listener ); void addByeAckListener( CommandListener listener ); void stop();  }