# DOIPTestsuite **Repository Path**: bdoa/doip-testsuite ## Basic Information - **Project Name**: DOIPTestsuite - **Description**: doip sdk的测试工具集 - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 4 - **Created**: 2022-09-02 - **Last Updated**: 2024-09-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # project introduction This project is the test case set of DOIP V2.1 protocol, including the test of DOIP V2.1 protocol on TCP, TLS, UDP, WS communication protocol and the test of DOIP V2.0 protocol. The project provides DOIP Client based on different communication protocols, as well as a sample DOIP Server. The test case is based on the JUnit framework, and the downloaded project is opened in the IDE to directly execute the test case to test the target DOIP Server # project structure All test cases are located in the doip.testcase directory, with subdirectories named after the communication protocol and each subdirectory containing the testcase client And a sample test server. -DoExample Examples of digital objects for testing, both large and small DO - TestRepoHandler example DOIP Server specific processing logic # testing process The following is a brief introduction to the test content and execution scheme of TestCase using the TCP protocol as an example. ## start DOIP Server Modify the port number and DOIP service ID and execute the main method. ```java class TCPTestServer{ static int port = 21042; static final String serviceID = "aibd.govdata.tj/do.3f9c41e6-9f8e-48a0-9220-53f438d40e43"; public static void main(String[] arg) throws InterruptedException { if (arg != null && arg.length > 0) { port = Integer.parseInt(arg[0]); } run(port); } //…… } ``` ## Start the DOIP Client and access the target Server Configure the target DOIP service address and service ID Four test cases were executed separately to test the performance of accessing/updating large/small DO. ```java public class TCPTestClient { static String serviceAddr = "tcp://127.0.0.1:1717"; static String serviceID = "aibd/do.e626924a-3b1c-492f-9a41-59179bfe0361"; @Test public void retrieveSmallReqSmallResp() throws InterruptedException { } @Test public void retrieveSmallReqLargeResp() throws InterruptedException { } @Test public void updateLargeReqSmallResp() throws InterruptedException { } @Test public void updateLargeReqLargeResp() throws InterruptedException { } } ``` The output of the test results is as follows: Repeat the request 1000 times, and output the number of successful requests, their duration, and processing performance. ``` ========GOServer====== [INFO ]22:47:57.138 tcp://39.104.208.148:21043 Final Result:100/100 dur:143820 rps:0.70 ========JavaServer====== [INFO ]22:39:13.940 tcp://39.104.208.148:21042 Final Result:100/100 dur:143744 rps:0.70 =========From Ali To Ali============ ========GOServer====== [INFO ]23:24:31.354 tcp://39.104.208.148:21043 Final Result:1000/1000 dur:6272 rps:159.44 [INFO ]23:24:47.992 tcp://39.104.208.148:21043 Final Result:1000/1000 dur:6224 rps:160.67 ========JavaServer====== [INFO ]23:20:44.496 tcp://39.104.208.148:21043 Final Result:1000/1000 dur:8119 rps:123.17 [INFO ]23:21:09.055 tcp://39.104.208.148:21043 Final Result:1000/1000 dur:7979 rps:125.33 ```