Skip to content

Commit

Permalink
update better modify
Browse files Browse the repository at this point in the history
  • Loading branch information
alipaydeshui committed Mar 28, 2023
1 parent 8e05d1b commit 64d8feb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import com.iast.astbenchmark.common.utils.MyCommonTestUtil;
import com.iast.astbenchmark.common.CommonConsts;
import com.iast.astbenchmark.common.utils.TaintMethodUtil;
import lombok.Data;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
Expand Down Expand Up @@ -336,7 +334,7 @@ public Map<String, Object> aTaintCase0033(@RequestBody Map<String, String> json)
public Map<String, Object> aTaintCase0034(@RequestBody TicketRequest ticketRequest) {
Map<String, Object> modelMap = new HashMap<>();
try {
Runtime.getRuntime().exec(ticketRequest.getOrderList().get(0).getPhase());
Runtime.getRuntime().exec(ticketRequest.getPhase());
modelMap.put("status", CommonConsts.SUCCESS_STR);
} catch (IOException e) {
modelMap.put("status", CommonConsts.ERROR_STR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class OrderRequest {

public String lotteryType;

public String phase;


@JacksonXmlProperty(localName = "lotterytype")
public String getLotteryType() {
Expand All @@ -18,12 +18,6 @@ public void setLotteryType(String lotteryType) {
this.lotteryType = lotteryType;
}

@JacksonXmlProperty(localName = "phase")
public String getPhase() {
return phase;
}

public void setPhase(String phase) {
this.phase = phase;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@

@JacksonXmlRootElement(localName ="message")
public class TicketRequest {

@JacksonXmlElementWrapper(localName ="orderlist")
@JacksonXmlProperty(localName ="order")
private List<OrderRequest> orderList;

public List<OrderRequest> getOrderList() {
return orderList;
public String phase;
@JacksonXmlProperty(localName = "phase")
public String getPhase() {
return phase;
}

public void setOrderList(List<OrderRequest> orderList) {
this.orderList = orderList;
public void setPhase(String phase) {
this.phase = phase;
}
//@JacksonXmlElementWrapper(localName ="orderlist")
//@JacksonXmlProperty(localName ="order")
//private List<OrderRequest> orderList;
//
//public List<OrderRequest> getOrderList() {
// return orderList;
//}
//
//public void setOrderList(List<OrderRequest> orderList) {
// this.orderList = orderList;
//}

}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ iast:
seeker:
detectionPath: /Users/curry/Documents/seeker0818.json
dongtai:
detectionPath: /Users/curry/IdeaProjects/antcode/astbenchmark/data/dongtai.json
detectionPath: /Users/curry/IdeaProjects/antcode/astbenchmark/data/dongtai_0328.json
xmirror:
detectionPath: /Users/curry/IdeaProjects/antcode/astbenchmark/data/xmirror.json

2 changes: 1 addition & 1 deletion src/main/resources/case_target_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
{"data":[{"result":true,"tag":"aTaintCase00946"},{"result":true,"tag":"aTaintCase00946_2"},{"result":false,"tag":"aTaintCase00946_3"}],"caseNo":"aTaintCase00946","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00947"},{"result":true,"tag":"aTaintCase00947_2"},{"result":false,"tag":"aTaintCase00947_3"}],"caseNo":"aTaintCase00947","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00948"},{"result":true,"tag":"aTaintCase00948_2"},{"result":false,"tag":"aTaintCase00948_3"}],"caseNo":"aTaintCase00948","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00949"},{"result":true,"tag":"aTaintCase00949_2"},{"result":false,"tag":"aTaintCase00949_3"}],"caseNo":"aTaintCase00949","caseType":"T005","caseDesc":""},
{"data":[{"result":false,"tag":"aTaintCase00949"},{"result":true,"tag":"aTaintCase00949_2"},{"result":true,"tag":"aTaintCase00949_3"}],"caseNo":"aTaintCase00949","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00950"},{"result":true,"tag":"aTaintCase00950_2"},{"result":false,"tag":"aTaintCase00950_3"}],"caseNo":"aTaintCase00950","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00951"},{"result":true,"tag":"aTaintCase00951_2"},{"result":false,"tag":"aTaintCase00951_3"}],"caseNo":"aTaintCase00951","caseType":"T005","caseDesc":""},
{"data":[{"result":true,"tag":"aTaintCase00952"},{"result":true,"tag":"aTaintCase00952_2"},{"result":false,"tag":"aTaintCase00952_3"}],"caseNo":"aTaintCase00952","caseType":"T005","caseDesc":""},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void contextLoads() {

@BeforeAll
static void init() {
//url_root = "http://30.98.121.247:39100/";
url_root = "http://localhost:39100/";
// caseUniqGroupId=System.currentTimeMillis();
caseUniqGroupId = 54877081211069L;
Expand Down Expand Up @@ -475,19 +476,7 @@ void aTaintCase0034() {
.body("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"\n" +
"<message> \n" +
" <orderlist> \n" +
" <order> \n" +
" <lotterytype>2004</lotterytype> \n" +
" <phase>ls</phase> \n" +
" <orderid>zy2014090234322</orderid> \n" +
" <playtype>200401</playtype> \n" +
" <betcode>00,02,03,04,05,06,07^</betcode> \n" +
" <multiple>1</multiple> \n" +
" <amount>2</amount> \n" +
" <add>0</add> \n" +
" <endtime>结束时间</endtime> \n" +
" </order> \n" +
" </orderlist> \n" +
"</message>").execute();

System.out.println(response.body());
Expand Down

0 comments on commit 64d8feb

Please sign in to comment.