Skip to content

Commit

Permalink
re-enable testCustomExecutor (apache#2917)
Browse files Browse the repository at this point in the history
* fix testCustomExecutor

* fix ci
  • Loading branch information
gudegg authored and beiwei30 committed Dec 10, 2018
1 parent bb3216d commit 38c2151
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import java.util.concurrent.TimeUnit;

import org.apache.dubbo.common.utils.NamedThreadFactory;
import org.junit.Ignore;
import org.junit.Test;


Expand All @@ -48,7 +47,7 @@ public void testCreate() throws InterruptedException {
CompletableFuture<Boolean> completableFuture = CompletableFuture.supplyAsync(() -> {
countDownLatch.countDown();
return true;
},executor);
}, executor);
countDownLatch.await();
}

Expand Down Expand Up @@ -77,7 +76,7 @@ public void testListener() throws InterruptedException {
}
return "hello";

},executor);
}, executor);
final CountDownLatch countDownLatch = new CountDownLatch(1);
completableFuture.thenRunAsync(new Runnable() {
@Override
Expand All @@ -90,13 +89,11 @@ public void run() {


@Test
@Ignore
public void testCustomExecutor() {
Executor mockedExecutor = mock(Executor.class);
CompletableFuture<Integer> completableFuture = CompletableFuture.supplyAsync(() -> {
return 0;
});
completableFuture.thenRunAsync(mock(Runnable.class), mockedExecutor);
}, mockedExecutor);
verify(mockedExecutor, times(1)).execute(any());
}
}

0 comments on commit 38c2151

Please sign in to comment.