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.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map;
import java.util.Set; import java.util.Set;
import osc.git.eh3.utils.AESEncrypter; import osc.git.eh3.redis.JedisUtil;
import osc.git.eh3.utils.Base64;
public class TestCode { public class TestCode {
@ -202,8 +203,37 @@ public class TestCode {
// List<String> list = JSONArray.toList(array, new String(), new JsonConfig()); // List<String> list = JSONArray.toList(array, new String(), new JsonConfig());
// System.out.println(list); // 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

@ -1,51 +1,52 @@
package osc.git.eh3.test; package osc.git.eh3.test;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.caucho.hessian.client.HessianProxyFactory; import com.caucho.hessian.client.HessianProxyFactory;
import osc.git.eh3.redis.JedisUtil; import osc.git.eh3.redis.JedisUtil;
import osc.git.eh3.utils.HttpClientUtil; import osc.git.eh3.utils.HttpClientUtil;
public class TestThread implements Runnable { public class TestThread implements Runnable {
@Override @Override
public void run() { public void run() {
HessianProxyFactory factory = new HessianProxyFactory(); // HessianProxyFactory factory = new HessianProxyFactory();
IChargeCounter readLogs; // IChargeCounter readLogs;
for(int i=0;i<5;i++){ // for(int i=0;i<5;i++){
try { // try {
readLogs = (IChargeCounter) factory.create(IChargeCounter.class, "http://192.168.1.135:8080/dsp-counter/remote/chargeCounter"); // readLogs = (IChargeCounter) factory.create(IChargeCounter.class, "http://localhost:8080/dsp-counter/remote/chargeCounter");
readLogs.counterControlForThisSumResult("100003", 1, "m"); // readLogs.counterControlForThisSumResult("100003", 1, "m");
//System.out.println(JedisUtil.getStr("dsp_counter_100003")); // //System.out.println(JedisUtil.getStr("dsp_counter_100003"));
break; // break;
} catch (Exception e) { // } catch (Exception e) {
try { // try {
Thread.sleep(1000); // Thread.sleep(1000);
} catch (InterruptedException e1) { // } catch (InterruptedException e1) {
e1.printStackTrace(); // e1.printStackTrace();
} // }
} // }
} // }
// Map<String, String> postParam = new HashMap<String, String>(); Map<String, String> postParam = new HashMap<String, String>();
// postParam.put("groupid", "100003"); postParam.put("groupid", "100003");
// postParam.put("count", "1"); postParam.put("count", "1");
// postParam.put("type", "m"); postParam.put("type", "m");
// for(int i=0;i<5;i++){ for(int i=0;i<5;i++){
// try { try {
// HttpClientUtil.sendPostParam("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", postParam); 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"); // HttpClientUtil.sendPost("http://192.168.1.135:8080/dsp-counter/remote/chargeCounter/counterControlForThisSumResult", "groupid=100003&count=1&type=m");
// break; break;
// } catch (Exception e) { } catch (Exception e) {
// try { System.out.println(e.getMessage());
// Thread.sleep(1000); try {
// } catch (InterruptedException e1) { Thread.sleep(1000);
// e1.printStackTrace(); } catch (InterruptedException e1) {
// } e1.printStackTrace();
// } }
// } }
} }
} }
}