测试项目更新

dev
lixiangrong 2016-06-07 17:47:43 +08:00
parent 5615898dd0
commit cc0fe842f2
4 changed files with 181 additions and 154 deletions

1
.gitignore vendored
View File

@ -6,7 +6,6 @@
*.ear
/target/
target
com
*.project
*.classpath
/.settings

View File

@ -21,23 +21,23 @@ import osc.git.eh3.utils.Base64;
public class TestCode {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
// String pathName = "/dsp/archer/dddfd/jkjl";
//
// String projectName = pathName.substring(0,
// pathName.indexOf("archer"));
//
// System.out.println(projectName);
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
// String pathName = "/dsp/archer/dddfd/jkjl";
//
// String projectName = pathName.substring(0,
// pathName.indexOf("archer"));
//
// System.out.println(projectName);
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// ParsePosition pos = new ParsePosition(0);
// System.out.println(formatter.parse("dsd", pos));
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
// ParsePosition pos = new ParsePosition(0);
// System.out.println(formatter.parse("dsd", pos));
// System.out.println(parseDate("") - 2232);
// System.out.println(parseDate("") - 2232);
// Map<String, Object> resultMap = new HashMap<String, Object>();
// System.out.println((String)resultMap.get("dd"));
// Map<String, Object> resultMap = new HashMap<String, Object>();
// System.out.println((String)resultMap.get("dd"));
// try {
// String str = null;
@ -48,81 +48,81 @@ public class TestCode {
// }
// System.out.println("fffff");
// String[] s = {"111","eee"};
// System.out.println(Arrays.toString(s));
// String[] s = {"111","eee"};
// System.out.println(Arrays.toString(s));
// List<String> list = new ArrayList<String>();
// list.add("2");
// list.add("3");
// list.add("7");
// list.add("1");
//
// System.out.println(list.toString());
// List<String> list = new ArrayList<String>();
// list.add("2");
// list.add("3");
// list.add("7");
// list.add("1");
//
// System.out.println(list.toString());
// JSONArray areaTarget = new JSONArray();
// areaTarget.add("3");
// areaTarget.add("5");
// areaTarget.add("4");
// areaTarget.add("7");
// System.out.println(JSONArray.toList(areaTarget));
// JSONArray areaTarget = new JSONArray();
// areaTarget.add("3");
// areaTarget.add("5");
// areaTarget.add("4");
// areaTarget.add("7");
// System.out.println(JSONArray.toList(areaTarget));
// String whiteStr = "2,4,5,8,3";
// System.out.println(JSONArray.fromObject(whiteStr.split(",")));
// String whiteStr = "2,4,5,8,3";
// System.out.println(JSONArray.fromObject(whiteStr.split(",")));
// for (int i = 0;i<2;i++) {
//
// if ("1".equals("1")) {
// if ("1".equals("1")) {
// System.out.println("111111111111111");
// continue;
// }
// System.out.println("2222222222222222");
// }
// System.out.println("3333333333333333333333");
// }
// for (int i = 0;i<2;i++) {
//
// if ("1".equals("1")) {
// if ("1".equals("1")) {
// System.out.println("111111111111111");
// continue;
// }
// System.out.println("2222222222222222");
// }
// System.out.println("3333333333333333333333");
// }
// String str = "http://www.test.com";
// System.out.println(str.replace("http://www.", "").replace("www.",
// ""));
// String str = "http://www.test.com";
// System.out.println(str.replace("http://www.", "").replace("www.",
// ""));
// SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
// SimpleDateFormat sdf = new SimpleDateFormat("HH");
// String str = "23:59:59";
// System.out.println(sdf.format(formatter.parse(str)));
// SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
// SimpleDateFormat sdf = new SimpleDateFormat("HH");
// String str = "23:59:59";
// System.out.println(sdf.format(formatter.parse(str)));
// Spring Hessian代理Servelet
// String url = "http://localhost:8080/sync-logs/remote/readlogs";
// HessianProxyFactory factory = new HessianProxyFactory();
//
// IReadLogs readLogs = (IReadLogs) factory.create(IReadLogs.class,
// url);
// JSONArray result = JSONArray.fromObject(readLogs.readFile("2016-02-22
// 15:00:00", "00000000000000"));
// System.out.println(result);
// Spring Hessian代理Servelet
// String url = "http://localhost:8080/sync-logs/remote/readlogs";
// HessianProxyFactory factory = new HessianProxyFactory();
//
// IReadLogs readLogs = (IReadLogs) factory.create(IReadLogs.class,
// url);
// JSONArray result = JSONArray.fromObject(readLogs.readFile("2016-02-22
// 15:00:00", "00000000000000"));
// System.out.println(result);
// JSONArray jonsArr = new JSONArray();
// JSONArray arr = new JSONArray();
// jonsArr = JSONArray.fromObject("[ { 'category': 2, 'clks': 4, 'cost':
// 13, 'createtime': null, 'creativeid':
// 'cf0714f4-8b92-41f2-a843-19c94fe3af74', 'downloads': 0, 'flag': 0,
// 'imprs': 5, 'regists': 0, 'time': null } ]");
// arr.addAll(JSONArray.toCollection(jonsArr));
// System.out.println(arr);
// JSONArray jonsArr = new JSONArray();
// JSONArray arr = new JSONArray();
// jonsArr = JSONArray.fromObject("[ { 'category': 2, 'clks': 4, 'cost':
// 13, 'createtime': null, 'creativeid':
// 'cf0714f4-8b92-41f2-a843-19c94fe3af74', 'downloads': 0, 'flag': 0,
// 'imprs': 5, 'regists': 0, 'time': null } ]");
// arr.addAll(JSONArray.toCollection(jonsArr));
// System.out.println(arr);
// String str =
// "20160222,18:59:50.523,DBG,ip:36.100.240.103,adx:3,bid:08a2d93b-0153-1000-fd75-3f89c5394190,mapid:62367312-d881-426d-81b4-fe635d1db989,deviceid:726e14bf3ba615e5387c256059e9f24a94721f76,deviceidtype:97,mtype:m";
// for(String dd : str.split(",")){
//
// System.out.println(dd);
// }
// String str =
// "20160222,18:59:50.523,DBG,ip:36.100.240.103,adx:3,bid:08a2d93b-0153-1000-fd75-3f89c5394190,mapid:62367312-d881-426d-81b4-fe635d1db989,deviceid:726e14bf3ba615e5387c256059e9f24a94721f76,deviceidtype:97,mtype:m";
// for(String dd : str.split(",")){
//
// System.out.println(dd);
// }
// BigDecimal dd = new BigDecimal("1111.10");
// JSONObject jj = new JSONObject();
// jj.put("test", dd);
// System.out.println(jj.optDouble("test"));
// BigDecimal dd = new BigDecimal("1111.10");
// JSONObject jj = new JSONObject();
// jj.put("test", dd);
// System.out.println(jj.optDouble("test"));
// JSONObject jj = new JSONObject();
// System.out.println(jj.optString("pring"));
// JSONObject jj = new JSONObject();
// System.out.println(jj.optString("pring"));
// // 根据网卡取本机配置的IP
@ -141,7 +141,6 @@ public class TestCode {
// System.out.println(test.dd("ddd"));
// Package pkg = Package.getPackage("osc.git.eh3.test");
// Annotation[] annotations = pkg.getAnnotations();
// for (Annotation annotation : annotations) {
@ -322,40 +321,69 @@ public class TestCode {
// System.out.println(jsonParam);
String head = "00,";
head = head.substring(0, head.lastIndexOf(","));
System.out.println(head);
// String head = "00,";
// head = head.substring(0, head.lastIndexOf(","));
// System.out.println(head);
//
// String ip = "127, 0, 0,1";
// // String [] s = ip.split(".");
// String[] s = ip.split("\\,");
// for (String string : s) {
// System.out.println(string);
// }
//
// Object str = null;
//// String dd = (String)str;
// String dd = String.valueOf(str);
// System.out.println(String.valueOf(str) == String.valueOf("null"));
}
public static Long parseDate(String s) {
Long time = null;
if (s == null || "" == s) {
time = null;
} else {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = format.parse(s);
time = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
}
return time;
}
String sr = "2016-05-25 00:39:33,285 zanadu INFO \"39.159.247.16\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4\" \"http://site.pxene.com/Audi2016Q2Wap/?bid=7ef9ab83e32c4f9c80312b92fba261b1&mapid=0055cb29-dee1-4e77-81bb-0991d2d644c8\" \"load success:Audi load success:bid=7ef9ab83e32c4f9c80312b92fba261b1&mapid=0055cb29-dee1-4e77-81bb-0991d2d644c8\"";
String[] split = sr.split("\"");
for (String s1 : split) {
System.out.println(s1);
}
public <B> B dd(B t){
return t;
}
public static <T extends Object> Set<T> Array2Set(T[] tArray) {
Set<T> tSet = new HashSet<T>(Arrays.asList(tArray));
return tSet;
}
String date = "Mon May 30 14:42:42 GMT+08:00 2016";
System.out.println(date);
public static <T extends Object> void printArrs(T[] arrs){
for (T t : arrs) {
System.out.println(t);
}
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat sdf1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", java.util.Locale.US);
System.out.println(sdf.format(sdf1.parse(date)));
System.out.println("可吉可吉");
}
public static Long parseDate(String s) {
Long time = null;
if (s == null || "" == s) {
time = null;
} else {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try {
Date date = format.parse(s);
time = date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
}
return time;
}
public <B> B dd(B t) {
return t;
}
public static <T extends Object> Set<T> Array2Set(T[] tArray) {
Set<T> tSet = new HashSet<T>(Arrays.asList(tArray));
return tSet;
}
public static <T extends Object> void printArrs(T[] arrs) {
for (T t : arrs) {
System.out.println(t);
}
}
}

View File

@ -10,7 +10,7 @@ import osc.git.eh3.utils.Base64;
import osc.git.eh3.utils.HttpClientUtil;
public class TestOpenPuton {
public static String URL = "http://127.0.0.1:8080/dsp-open/pxene/dsp.do";
private static String URL = "http://127.0.0.1:8080/dsp-open/pxene/dsp.do";
private static String key = "adjdjfjfjfjdkdkd";//
private static String appid = "t123456";// 用户
private static String token = "cst123456";// 令牌

View File

@ -23,7 +23,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.pxene.dsp.archer.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="dsp_t_open_data_query" domainObjectName="OpenDataQueryModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
<table tableName="dsp_t_advertiser" domainObjectName="AdvertiserModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true" />
<!--
<table tableName="dsp_t_open_request_data" domainObjectName="OpenRequestDataModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table>
<table tableName="dsp_t_amnet_ad_owner" domainObjectName="AmnetAdOwnerModel" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"></table>