Bugfree??????
???????????? ???????[ 2014/9/5 14:46:20 ] ??????????????? ??????????
????JsonParser?????????bugfree????????json?????
package com.yunos.qa;
import org.json.*;
import java.util.Map;
public class JsonParser {
public static SessionInfo parseSessionInfo(String jsonResult) {
System.out.println("sessionInfo: " + jsonResult);
SessionInfo sessionInfo = new SessionInfo();
try {
JSONObject jsonObj = new JSONObject(jsonResult);
sessionInfo.setSessionName(jsonObj.getString("sessionname"));
sessionInfo.setSessionId(jsonObj.getString("sessionid"));
sessionInfo.setRand(jsonObj.getString("rand"));
} catch(JSONException ex) {
ex.printStackTrace();
}
return sessionInfo;
}
public static boolean parseLoginResult(String jsonResult) {
try {
JSONObject jsonObj = new JSONObject(jsonResult);
String status =jsonObj.getString("status");
return "success".equals(status);
} catch(JSONException ex) {
ex.printStackTrace();
}
return false;
}
public static void parseModuleList(String jsonResult?? Map<String??String> moduleName2OwnerMap) {
try {
JSONObject jsonObj = new JSONObject(jsonResult);
JSONArray moduleList =jsonObj.getJSONArray("ModuleList");
int moduleCount = moduleList.length();
for(int i=0; i<moduleCount; i++) {
JSONObject moduleObj = moduleList.getJSONObject(i);
//System.out.println("module id:" + moduleObj.getString("id"));
String moduleName = moduleObj.getString("name");
//System.out.println("module name:" + moduleName);
//System.out.println("module product_id:" + moduleObj.getString("product_id"));
//System.out.println("module grade:" + moduleObj.getString("grade"));
//moduleObj.get
//System.out.println("module parent_id:" + moduleObj.getString("parent_id"));
//System.out.println("module full_path_name:" + moduleObj.getString("full_path_name"));
//System.out.println("module display_order:" + moduleObj.getString("display_order"));
//System.out.println("module owner_id:" + moduleObj.getString("owner_id"));
String ownerName = moduleObj.getString("owner_name");
//System.out.println("module owner_name:" + ownerName);
moduleName2OwnerMap.put(moduleName?? ownerName);
}
} catch(JSONException ex) {
ex.printStackTrace();
}
}
}
????SessionInfo??????????
package com.yunos.qa;
public class SessionInfo {
private String sessionName = "";
private String sessionId = "";
private String rand = "";
public String getSessionName() {
return sessionName;
}
public void setSessionName(String sessionName) {
this.sessionName = sessionName;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public String getRand() {
return rand;
}
public void setRand(String rand) {
this.rand = rand;
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??γ????????????????????????????????????漰??Щ???????????????????????????????????????????????????????????????е???????????????????????????????????????Щ??????????????????????Ч?????????????????????????????????????α?????????????????????????????????????????????????????????????????????????????????????????????????????????????????γ?????????????????????????????ζ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????