use of org.apache.servicecomb.core.executor.FixedThreadExecutor in project incubator-servicecomb-java-chassis by apache.
the class TestExecutors method testFixedThreadExecutor.
@Test
public void testFixedThreadExecutor() {
FixedThreadExecutor oFixedThreadExecutor = new FixedThreadExecutor();
oFixedThreadExecutor.execute(new Runnable() {
@Override
public void run() {
}
});
Map<Long, Executor> threadExecutorMap = Deencapsulation.getField(oFixedThreadExecutor, "threadExecutorMap");
Assert.assertEquals(true, (threadExecutorMap.size() > 0));
List<Executor> executorList = Deencapsulation.getField(oFixedThreadExecutor, "executorList");
Assert.assertEquals(true, (executorList.size() > 1));
ReactiveExecutor oReactiveExecutor = new ReactiveExecutor();
oReactiveExecutor.execute(new Runnable() {
@Override
public void run() {
strThreadTest = "thread Ran";
}
});
Assert.assertEquals("thread Ran", strThreadTest);
}
Aggregations