File tree Expand file tree Collapse file tree
mobius-core/src/test/java/com/spotify/mobius Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- version =1.5.9-SNAPSHOT
1+ version =1.5.9
22
33GROUP =com.spotify.mobius
44
Original file line number Diff line number Diff line change 4141import com .spotify .mobius .runners .ImmediateWorkRunner ;
4242import com .spotify .mobius .runners .WorkRunner ;
4343import com .spotify .mobius .runners .WorkRunners ;
44- import java .util .concurrent .ExecutorService ;
45- import java .util .concurrent .Executors ;
4644import java .util .concurrent .Semaphore ;
4745import java .util .concurrent .TimeUnit ;
4846import java .util .concurrent .atomic .AtomicBoolean ;
4947import java .util .concurrent .atomic .AtomicReference ;
50- import java .util .concurrent .locks .Lock ;
51- import java .util .concurrent .locks .ReentrantLock ;
52- import javax .annotation .Nonnull ;
5348import org .junit .Before ;
5449import org .junit .Test ;
5550import org .mockito .InOrder ;
@@ -638,10 +633,11 @@ private static class KnownThreadWorkRunner implements WorkRunner {
638633 @ Override
639634 @ SuppressWarnings ("FutureReturnValueIgnored" )
640635 public void post (final Runnable runnable ) {
641- delegate .post (() -> {
642- workerThread = Thread .currentThread ();
643- runnable .run ();
644- });
636+ delegate .post (
637+ () -> {
638+ workerThread = Thread .currentThread ();
639+ runnable .run ();
640+ });
645641 }
646642
647643 @ Override
Original file line number Diff line number Diff line change @@ -293,21 +293,22 @@ public WorkRunner get() {
293293 return WorkRunners .from (Executors .newFixedThreadPool (4 ));
294294 }
295295 });
296- final Thread thread = new Thread (
297- new Runnable () {
298- @ Override
299- public void run () {
300- for (int i = 0 ; i < 100 ; i ++) {
301- mobiusLoop = builder .startFrom ("foo" );
302- try {
303- Thread .sleep (random .nextInt (10 ));
304- } catch (InterruptedException e ) {
305- throw new RuntimeException (e );
296+ final Thread thread =
297+ new Thread (
298+ new Runnable () {
299+ @ Override
300+ public void run () {
301+ for (int i = 0 ; i < 100 ; i ++) {
302+ mobiusLoop = builder .startFrom ("foo" );
303+ try {
304+ Thread .sleep (random .nextInt (10 ));
305+ } catch (InterruptedException e ) {
306+ throw new RuntimeException (e );
307+ }
308+ mobiusLoop .dispose ();
309+ }
306310 }
307- mobiusLoop .dispose ();
308- }
309- }
310- });
311+ });
311312 thread .start ();
312313
313314 for (int i = 0 ; i < 1000 ; i ++) {
You can’t perform that action at this time.
0 commit comments