Search in sources :

Example 1 with Test

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();
            }
        }
    }
}
Also used : User(io.servicecomb.demo.server.User) Test(io.servicecomb.demo.server.Test) TestRequest(io.servicecomb.demo.server.TestRequest)

Aggregations

Test (io.servicecomb.demo.server.Test)1 TestRequest (io.servicecomb.demo.server.TestRequest)1 User (io.servicecomb.demo.server.User)1