use of io.servicecomb.demo.server.Test in project java-chassis by ServiceComb.
the class ClientThread method run.
@Override
public void run() {
Test test = PojoClient.test;
CseContext.getInstance().getConsumerProviderManager().setTransport("pojo", Config.getTransport());
System.out.printf("test %s performance\n", Config.getTransport());
while (isRunning()) {
int idx = 0;
for (; ; ) {
User user = new User();
TestRequest request = new TestRequest();
request.setUser(user);
request.setIndex(idx);
request.setData(PojoClient.buffer);
try {
User result = test.wrapParam(request);
if (result.getIndex() != idx) {
System.out.printf("error result:%s, expect idx %d\n", result, idx);
}
} catch (Throwable e) {
// e.printStackTrace();
}
}
}
}
Aggregations