use of io.servicecomb.core.executor.FixedThreadExecutor in project java-chassis by ServiceComb.
the class TestExecutors method testFixedThreadExecutor.
@Test
public void testFixedThreadExecutor() {
FixedThreadExecutor oFixedThreadExecutor = new FixedThreadExecutor();
oFixedThreadExecutor.execute(new Runnable() {
@Override
public void run() {
}
});
Map<Long, Executor> threadExectorMap = Deencapsulation.getField(oFixedThreadExecutor, "threadExectorMap");
Assert.assertEquals(true, (threadExectorMap.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() {
// TODO Auto-generated method stub
strThreadTest = "thread Ran";
}
});
Assert.assertEquals("thread Ran", strThreadTest);
}
Aggregations