Signed-off-by: lixiangrong <lixiangrong@pxene.com>

This commit is contained in:
lixiangrong 2016-03-26 20:07:48 +08:00
parent 18085150fd
commit a87d321290
2 changed files with 86 additions and 55 deletions

View File

@ -4,11 +4,12 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import osc.git.eh3.utils.AESEncrypter;
import osc.git.eh3.utils.Base64;
import osc.git.eh3.redis.JedisUtil;
public class TestCode {
@ -202,8 +203,37 @@ public class TestCode {
// List<String> list = JSONArray.toList(array, new String(), new JsonConfig());
// System.out.println(list);
System.out.println(System.nanoTime());
System.out.println(System.nanoTime());
// System.out.println(System.nanoTime());
// System.out.println(System.nanoTime());
// Map<String, String> postParam = new HashMap<String, String>();
// postParam.put("groupid", "100003");
// postParam.put("count", "1");
// postParam.put("type", "m");
// for(int i=0;i<5;i++){
// try {
// HttpClientUtil.sendPostParam("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", postParam);
//// HttpClientUtil.sendPost("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", "groupid=100003&count=1&type=m");
// break;
// } catch (Exception e) {
// System.out.println(e.getMessage());
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e1) {
// e1.printStackTrace();
// }
// }
// }
// String str = "0,";
// System.out.println(str.split(",").length);
// System.out.println(JedisUtil.getStr("0000"));
// Map<String,Integer> result = new HashMap<String, Integer>();
// System.out.println(result.get("jj"));
double budgets = 10000;
System.out.println((budgets/100));
}

View File

@ -12,32 +12,13 @@ public class TestThread implements Runnable {
@Override
public void run() {
HessianProxyFactory factory = new HessianProxyFactory();
IChargeCounter readLogs;
for(int i=0;i<5;i++){
try {
readLogs = (IChargeCounter) factory.create(IChargeCounter.class, "http://192.168.1.135:8080/dsp-counter/remote/chargeCounter");
readLogs.counterControlForThisSumResult("100003", 1, "m");
//System.out.println(JedisUtil.getStr("dsp_counter_100003"));
break;
} catch (Exception e) {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
}
// Map<String, String> postParam = new HashMap<String, String>();
// postParam.put("groupid", "100003");
// postParam.put("count", "1");
// postParam.put("type", "m");
// HessianProxyFactory factory = new HessianProxyFactory();
// IChargeCounter readLogs;
// for(int i=0;i<5;i++){
// try {
// HttpClientUtil.sendPostParam("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", postParam);
//// HttpClientUtil.sendPost("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", "groupid=100003&count=1&type=m");
// readLogs = (IChargeCounter) factory.create(IChargeCounter.class, "http://localhost:8080/dsp-counter/remote/chargeCounter");
// readLogs.counterControlForThisSumResult("100003", 1, "m");
// //System.out.println(JedisUtil.getStr("dsp_counter_100003"));
// break;
// } catch (Exception e) {
// try {
@ -47,5 +28,25 @@ public class TestThread implements Runnable {
// }
// }
// }
Map<String, String> postParam = new HashMap<String, String>();
postParam.put("groupid", "100003");
postParam.put("count", "1");
postParam.put("type", "m");
for(int i=0;i<5;i++){
try {
HttpClientUtil.sendPostParam("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", postParam);
// HttpClientUtil.sendPost("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", "groupid=100003&count=1&type=m");
break;
} catch (Exception e) {
System.out.println(e.getMessage());
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
}
}
}