1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- package com.miniframe.comm.httpclientapater;
- import java.util.ArrayList;
- import java.util.List;
- import org.apache.log4j.Logger;
- import com.miniframe.comm.httpclientapater.HttpclientapaterUtil;
- import com.miniframe.generate.comm.system.A_HM0001;
- import com.miniframe.generate.comm.httpclientapater.HM0001Client;
- import com.miniframe.generate.business.system.model.HM0001BaseModel;
- public class HM0001TestThread implements Runnable{
- private static final Logger logger = Logger.getLogger(HM0001TestThread.class);
- /**
- * 系统登录,获取报文体
- * @return
- */
- public static A_HM0001 getA_hm0001() {
- A_HM0001 a_hm0001 = new A_HM0001();
- // ----------以下增加【系统登录】上行体赋值-------------
-
- a_hm0001.setLogintype("1");
- a_hm0001.setPassword("2176216712");
- a_hm0001.setVerifygraph("1234");
-
- // ---------------------------------------------------
- return a_hm0001;
- }
-
-
-
- /**
- * 运行客户端测试,系统登录
- *
- * @param args
- * @throws Exception
- */
- public static void main(String[] args) throws Exception {
- List<Thread> list = new ArrayList<Thread>();
- for(int i=0;i<200;i++) {
- HM0001TestThread test = new HM0001TestThread();
- Thread thread1 = new Thread(test);
- list.add(thread1);
- }
- for(int i=0;i<200;i++) {
- Thread thread1 = (Thread) list.get(i);
- thread1.start();
- }
- }
- @Override
- public void run() {
-
- HM0001BaseModel model = new HM0001BaseModel();
- model.setA_systemhead(HttpclientapaterUtil.getA_systemhead("HM0001"));
- model.setA_hm0001(HM0001TestThread.getA_hm0001());
- HM0001Client client = new HM0001Client();
- while(true) {
- //logger.error("客户端发送前总线:\r\n"+model);
- try {
- model = client.execute(model);
- } catch (Exception e) {
- e.printStackTrace();
- }
- //logger.error("客户端发送后总线:\r\n"+model);
- //Thread.sleep(1);
- logger.error(Thread.currentThread().getId());
- }
-
- }
- }
|