@@ -0,0 +1,2206 @@
+package com.cosmos.app.controller;%0A%0Aimport com.cosmos.protocol.EchoProtocol.EchoPb;%0Aimport com.cosmos.protocol.user.UserServicePb;%0Aimport com.google.protobuf.CodedInputStream;%0Aimport com.google.protobuf.CodedOutputStream;%0Aimport org.junit.Test;%0A%0Aimport java.net.Socket;%0A%0A/**%0A * Test Case%0A *%0A * @author David%0A */%0Apublic class EchoControllerTest %7B%0A%0A    @Test%0A    public void testLogin() %7B%0A        long start = System.currentTimeMillis();%0A        try %7B%0A            Socket socket = new Socket(%22localhost%22, 20303);%0A            EchoPb.Builder builder = EchoPb.newBuilder();%0A%0A            builder.setInterfaceVersion(EchoPb.InterfaceVersion.V30);%0A            builder.setSystemType(EchoPb.SystemType.ANDROID);%0A%0A            UserServicePb.UserService.Builder userService = UserServicePb.UserService.newBuilder();%0A%0A            UserServicePb.LoginRequest.Builder loginRequest = UserServicePb.LoginRequest.newBuilder();%0A            loginRequest.setAccount(%22david%22);%0A            loginRequest.setPassword(%22password%22);%0A            userService.setLoginRequest(loginRequest);%0A%0A            builder.setUserService(userService.build());%0A%0A            byte%5B%5D dd = builder.build().toByteArray();%0A%0A            System.out.println(%22-------------- client request message ---------------%22);%0A            System.out.println(EchoPb.parseFrom(dd).toString());%0A%0A            CodedOutputStream codeOut = CodedOutputStream.newInstance(socket.getOutputStream());%0A            codeOut.writeRawVarint32(dd.length);%0A            codeOut.writeRawBytes(dd);%0A            codeOut.flush();%0A%0A            CodedInputStream codeInput = CodedInputStream.newInstance(socket.getInputStream());%0A%0A            int length = codeInput.readRawVarint32();%0A            System.out.println(%22length = %22 + length);%0A%0A            byte%5B%5D buffer = codeInput.readRawBytes(length);%0A            EchoPb baseModel = EchoPb.parseFrom(buffer);%0A%0A            System.out.println(%22-------------- server response message ---------------%22);%0A            System.out.println(baseModel.toString());%0A            socket.close();%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        System.out.println(%22time.........%22 + (System.currentTimeMillis() - start));%0A    %7D%0A%7D%0A

add test case