Commit a6fc667a by wanggang

方法参数类型修改

parent 57490d8b
......@@ -34,7 +34,8 @@ public class MicroMedineceData {
public static Object[][] get_out_batchAction(){
return new Object[][] {
//{"warehouseId","orderNumber"}
{"39","S5240727359"}
//成功的情况:{"meta":{"code":"200","message":"成功","success":true},"data":{"outBatchSkuList":[{"id":112383,"begin":0,"perpage":0,"sort":null,"sortDir":null,"creator":0,"updator":0,"createDatetime":1582194369000,"updateDatetime":1582194390000,"deleteMark":0,"sellOrderId":84720,"sellOrderSkuId":123343,"sellOrder":null,"outBatchId":69655,"originalBatchSkuId":0,"skuId":2243,"count":1,"outStatus":3,"outStatusDesc":"已出货","sellOrderSku":null,"skuPassEntityId":104223,"skuPassVo":null,"sku":null,"allOriginalOutBatchSkus":null,"exchangedSellOrderId":0,"realPrice":0,"isPresent":0,"activityType":"","activityId":0}],"orderStatus":"已取货"}}
{39,"S5240727359"}
};
}
......@@ -45,7 +46,8 @@ public class MicroMedineceData {
public static Object[][] cancel_orderAction() {
return new Object[][] {
//{"warehouseId","orderNumber"}
{39,"S9070546349"}
// {39,"S9070546349"}
{39,"S0642169420"}
};
}
......
......@@ -956,6 +956,7 @@ public class BaseService {
* */
public JSONObject httppostMicroMedineceReturnJson(String url, String str,String methodName)
throws ClientProtocolException, IOException {
JSONObject json = null;
StringBuilder strr=new StringBuilder();//定义变长字道符内串
Random random=new Random();
//随机生成数字,并添加到字符串
......@@ -980,8 +981,15 @@ public class BaseService {
hp.setEntity(new StringEntity(str, Consts.UTF_8));
hr = hc.execute(hp);
entity = hr.getEntity();
System.out.println(EntityUtils.toString(entity, "UTF-8"));
String toString = EntityUtils.toString(entity, "UTF-8");
System.out.println(toString);
try {
json = JSONObject.fromObject(toString);
} catch (Exception e) {
json = new JSONObject();
System.out.println("返回不是json数据:" + json);
}
// BufferedReader postresult = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
//
// // 清空 strb
......
......@@ -87,7 +87,7 @@ public class MicroMedinece {
* 2)已出货{"meta":{"code":"200","message":"成功","success":true},"data":{"outBatchSkuList":[{"id":112383,"begin":0,"perpage":0,"sort":null,"sortDir":null,"creator":0,"updator":0,"createDatetime":1582194369000,"updateDatetime":1582194390000,"deleteMark":0,"sellOrderId":84720,"sellOrderSkuId":123343,"sellOrder":null,"outBatchId":69655,"originalBatchSkuId":0,"skuId":2243,"count":1,"outStatus":3,"outStatusDesc":"已出货","sellOrderSku":null,"skuPassEntityId":104223,"skuPassVo":null,"sku":null,"allOriginalOutBatchSkus":null,"exchangedSellOrderId":0,"realPrice":0,"isPresent":0,"activityType":"","activityId":0}],"orderStatus":"已取货"}}
* */
// @Test(dataProvider="get_out_batchAction",dataProviderClass=MicroMedineceData.class)
public void get_out_batchAction(String warehouseId,String orderNumber) {
public void get_out_batchAction(int warehouseId,String orderNumber) {
String url = "https://test.mjitech.com/web/weiyi_api/get_out_batch.action?supplierId=wy001" ;
json.put("warehouseId", warehouseId);
json.put("orderNumber", orderNumber);
......@@ -111,8 +111,8 @@ public class MicroMedinece {
* @date 2020-04-20
* @result {"meta":{"code":"200","message":"成功","success":true},"data":true}
* */
//@Test(dataProvider="cancel_orderAction",dataProviderClass=MicroMedineceData.class)
public void cancel_orderAction(String warehouseId,String orderNumber) {
// @Test(dataProvider="cancel_orderAction",dataProviderClass=MicroMedineceData.class)
public void cancel_orderAction(int warehouseId,String orderNumber) {
String url = "https://test.mjitech.com/web/weiyi_api/cancel_order.action?supplierId=wy001" ;
json.put("warehouseId", warehouseId);
json.put("orderNumber", orderNumber);
......@@ -184,7 +184,7 @@ public class MicroMedinece {
* @author gangwang
* @date 2020-04-17
* */
@Test(dataProvider="get_request_data",dataProviderClass=MicroMedineceData.class)
//@Test(dataProvider="get_request_data",dataProviderClass=MicroMedineceData.class)
public void get_request_data(int[] warehouseIds) {
String url = "http://test.mjitech.com/web/weiyi_api/get_request_data.action?supplierId=wy001" ;
json.put("warehouseIds", warehouseIds);
......
......@@ -57,9 +57,9 @@ function toggleAllBoxes() {
<tr>
<td>Tests passed/Failed/Skipped:</td><td>1/0/0</td>
</tr><tr>
<td>Started on:</td><td>Wed Apr 22 20:09:47 CST 2020</td>
<td>Started on:</td><td>Thu Apr 23 17:54:03 CST 2020</td>
</tr>
<tr><td>Total time:</td><td>0 seconds (911 ms)</td>
<tr><td>Total time:</td><td>1 seconds (1226 ms)</td>
</tr><tr>
<td>Included groups:</td><td></td>
</tr><tr>
......@@ -75,9 +75,9 @@ function toggleAllBoxes() {
<td><b>Instance</b></td>
</tr>
<tr>
<td title='com.mjitech.qa.test.MicroMedinece.get_request_data()'><b>get_request_data</b><br>Test class: com.mjitech.qa.test.MicroMedinece<br>Parameters: [I@b3d7190</td>
<td title='com.mjitech.qa.test.MicroMedinece.cancel_orderAction()'><b>cancel_orderAction</b><br>Test class: com.mjitech.qa.test.MicroMedinece<br>Parameters: 39, S0642169420</td>
<td></td>
<td>0</td>
<td>1</td>
<td>com.mjitech.qa.test.MicroMedinece@5f3a4b84</td></tr>
</table><p>
</body>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
<testsuite hostname="YLMF-1711181457" name="Default test" tests="1" failures="0" timestamp="22 Apr 2020 12:09:48 GMT" time="0.911" errors="0">
<testcase name="get_request_data" time="0.884" classname="com.mjitech.qa.test.MicroMedinece"/>
<testsuite hostname="YLMF-1711181457" name="Default test" tests="1" failures="0" timestamp="23 Apr 2020 09:54:04 GMT" time="1.226" errors="0">
<testcase name="cancel_orderAction" time="1.201" classname="com.mjitech.qa.test.MicroMedinece"/>
</testsuite> <!-- Default test -->
......@@ -5,7 +5,7 @@
<classes>
<class name="com.mjitech.qa.test.MicroMedinece">
<methods>
<include name="get_request_data" invocation-numbers="0"/>
<include name="cancel_orderAction" invocation-numbers="0"/>
</methods>
</class> <!-- com.mjitech.qa.test.MicroMedinece -->
</classes>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TestNG Report</title><style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}</style></head><body><table><tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr><tr><th colspan="7">Default suite</th></tr><tr><td><a href="#t0">Default test</a></td><td class="num">1</td><td class="num">0</td><td class="num">0</td><td class="num">911</td><td></td><td></td></tr></table><table><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Default suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Default test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="1">com.mjitech.qa.test.MicroMedinece</td><td><a href="#m0">get_request_data</a></td><td rowspan="1">1587557387732</td><td rowspan="1">884</td></tr></tbody></table><h2>Default test</h2><h3 id="m0">com.mjitech.qa.test.MicroMedinece#get_request_data</h3><table class="result"><tr class="param"><th>Parameter #1</th></tr><tr class="param stripe"><td>[39]</td></tr></table><p class="totop"><a href="#summary">back to summary</a></p></body></html>
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>TestNG Report</title><style type="text/css">table {margin-bottom:10px;border-collapse:collapse;empty-cells:show}th,td {border:1px solid #009;padding:.25em .5em}th {vertical-align:bottom}td {vertical-align:top}table a {font-weight:bold}.stripe td {background-color: #E6EBF9}.num {text-align:right}.passedodd td {background-color: #3F3}.passedeven td {background-color: #0A0}.skippedodd td {background-color: #DDD}.skippedeven td {background-color: #CCC}.failedodd td,.attn {background-color: #F33}.failedeven td,.stripe .attn {background-color: #D00}.stacktrace {white-space:pre;font-family:monospace}.totop {font-size:85%;text-align:center;border-bottom:2px solid #000}</style></head><body><table><tr><th>Test</th><th># Passed</th><th># Skipped</th><th># Failed</th><th>Time (ms)</th><th>Included Groups</th><th>Excluded Groups</th></tr><tr><th colspan="7">Default suite</th></tr><tr><td><a href="#t0">Default test</a></td><td class="num">1</td><td class="num">0</td><td class="num">0</td><td class="num">1,226</td><td></td><td></td></tr></table><table><thead><tr><th>Class</th><th>Method</th><th>Start</th><th>Time (ms)</th></tr></thead><tbody><tr><th colspan="4">Default suite</th></tr></tbody><tbody id="t0"><tr><th colspan="4">Default test &#8212; passed</th></tr><tr class="passedeven"><td rowspan="1">com.mjitech.qa.test.MicroMedinece</td><td><a href="#m0">cancel_orderAction</a></td><td rowspan="1">1587635643185</td><td rowspan="1">1201</td></tr></tbody></table><h2>Default test</h2><h3 id="m0">com.mjitech.qa.test.MicroMedinece#cancel_orderAction</h3><table class="result"><tr class="param"><th>Parameter #1</th><th>Parameter #2</th></tr><tr class="param stripe"><td>39</td><td>S0642169420</td></tr></table><p class="totop"><a href="#summary">back to summary</a></p></body></html>
\ No newline at end of file
......@@ -48,7 +48,7 @@
<ul>
<li>
<a href="#" class="navigator-link " panel-name="test-xml-Default_suite">
<span>C:\Users\Administrator\AppData\Local\Temp\testng-eclipse-1402836858\testng-customsuite.xml</span>
<span>C:\Users\Administrator\AppData\Local\Temp\testng-eclipse-1472228547\testng-customsuite.xml</span>
</a> <!-- navigator-link -->
</li>
<li>
......@@ -101,7 +101,7 @@
<div class="method-list-content passed suite-Default_suite">
<span>
<img width="3%" src="passed.png"/>
<a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="com.mjitech.qa.test.MicroMedinece" hash-for-method="get_request_data([39])">get_request_data([39])</a> <!-- method navigator-link -->
<a href="#" class="method navigator-link" panel-name="suite-Default_suite" title="com.mjitech.qa.test.MicroMedinece" hash-for-method="cancel_orderAction(39, S0642169420)">cancel_orderAction(39, S0642169420)</a> <!-- method navigator-link -->
</span>
<br/>
</div> <!-- method-list-content passed suite-Default_suite -->
......@@ -124,10 +124,10 @@
<div class="main-panel-content rounded-window-bottom">
<div class="method">
<div class="method-content">
<a name="get_request_data([39])">
</a> <!-- get_request_data([39]) -->
<span class="method-name">get_request_data</span>
<span class="parameters">([39])</span>
<a name="cancel_orderAction(39, S0642169420)">
</a> <!-- cancel_orderAction(39, S0642169420) -->
<span class="method-name">cancel_orderAction</span>
<span class="parameters">(39, S0642169420)</span>
</div> <!-- method-content -->
</div> <!-- method -->
</div> <!-- main-panel-content rounded-window-bottom -->
......@@ -135,7 +135,7 @@
</div> <!-- panel Default_suite -->
<div panel-name="test-xml-Default_suite" class="panel">
<div class="main-panel-header rounded-window-top">
<span class="header-content">C:\Users\Administrator\AppData\Local\Temp\testng-eclipse-1402836858\testng-customsuite.xml</span>
<span class="header-content">C:\Users\Administrator\AppData\Local\Temp\testng-eclipse-1472228547\testng-customsuite.xml</span>
</div> <!-- main-panel-header rounded-window-top -->
<div class="main-panel-content rounded-window-bottom">
<pre>
......@@ -186,14 +186,14 @@ data.addColumn('string', 'Class');
data.addColumn('number', 'Time (ms)');
data.addRows(1);
data.setCell(0, 0, 0)
data.setCell(0, 1, 'get_request_data')
data.setCell(0, 1, 'cancel_orderAction')
data.setCell(0, 2, 'com.mjitech.qa.test.MicroMedinece')
data.setCell(0, 3, 884);
data.setCell(0, 3, 1201);
window.suiteTableData['Default_suite']= { tableData: data, tableDiv: 'times-div-Default_suite'}
return data;
}
</script>
<span class="suite-total-time">Total running time: 884 ms</span>
<span class="suite-total-time">Total running time: 1 seconds</span>
<div id="times-div-Default_suite">
</div> <!-- times-div-Default_suite -->
</div> <!-- times-div -->
......@@ -221,7 +221,7 @@ return data;
<div class="chronological-class">
<div class="chronological-class-name">com.mjitech.qa.test.MicroMedinece</div> <!-- chronological-class-name -->
<div class="test-method">
<span class="method-name">get_request_data([39])</span>
<span class="method-name">cancel_orderAction(39, S0642169420)</span>
<span class="method-start">0 ms</span>
</div> <!-- test-method -->
</div> <!-- main-panel-content rounded-window-bottom -->
......
......@@ -11,7 +11,7 @@
</tr>
<tr>
<td>&nbsp;</td>
<td>get_request_data</td>
<td>cancel_orderAction</td>
<td>&nbsp;</td></tr>
<tr>
<td align='center' colspan='3'>@BeforeClass</td>
......
<h2>Methods run, sorted chronologically</h2><h3>&gt;&gt; means before, &lt;&lt; means after</h3><p/><br/><em>Default suite</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
<table border="1">
<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
<tr bgcolor="69b199"> <td>20/04/22 20:09:47</td> <td>0</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="MicroMedinece.get_request_data([I)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]">get_request_data</td>
<tr bgcolor="69b199"> <td>20/04/23 17:54:03</td> <td>0</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="MicroMedinece.cancel_orderAction(int, java.lang.String)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]">cancel_orderAction</td>
<td>main@786041152</td> <td></td> </tr>
</table>
<h2>Methods run, sorted chronologically</h2><h3>&gt;&gt; means before, &lt;&lt; means after</h3><p/><br/><em>Default suite</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
<table border="1">
<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
<tr bgcolor="69b199"> <td>20/04/22 20:09:47</td> <td>0</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="MicroMedinece.get_request_data([I)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]">get_request_data</td>
<tr bgcolor="69b199"> <td>20/04/23 17:54:03</td> <td>0</td> <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td title="MicroMedinece.cancel_orderAction(int, java.lang.String)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]">cancel_orderAction</td>
<td>main@786041152</td> <td></td> </tr>
</table>
......@@ -5,7 +5,7 @@
<classes>
<class name="com.mjitech.qa.test.MicroMedinece">
<methods>
<include name="get_request_data" invocation-numbers="0"/>
<include name="cancel_orderAction" invocation-numbers="0"/>
</methods>
</class> <!-- com.mjitech.qa.test.MicroMedinece -->
</classes>
......
......@@ -2,22 +2,27 @@
<testng-results skipped="0" failed="0" total="1" passed="1">
<reporter-output>
</reporter-output>
<suite name="Default suite" duration-ms="911" started-at="2020-04-22T12:09:47Z" finished-at="2020-04-22T12:09:48Z">
<suite name="Default suite" duration-ms="1226" started-at="2020-04-23T09:54:03Z" finished-at="2020-04-23T09:54:04Z">
<groups>
</groups>
<test name="Default test" duration-ms="911" started-at="2020-04-22T12:09:47Z" finished-at="2020-04-22T12:09:48Z">
<test name="Default test" duration-ms="1226" started-at="2020-04-23T09:54:03Z" finished-at="2020-04-23T09:54:04Z">
<class name="com.mjitech.qa.test.MicroMedinece">
<test-method status="PASS" signature="get_request_data([I)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]" name="get_request_data" duration-ms="884" started-at="2020-04-22T20:09:47Z" data-provider="get_request_data" finished-at="2020-04-22T20:09:48Z">
<test-method status="PASS" signature="cancel_orderAction(int, java.lang.String)[pri:0, instance:com.mjitech.qa.test.MicroMedinece@5f3a4b84]" name="cancel_orderAction" duration-ms="1201" started-at="2020-04-23T17:54:03Z" data-provider="cancel_orderAction" finished-at="2020-04-23T17:54:04Z">
<params>
<param index="0">
<value>
<![CDATA[[I@b3d7190]]>
<![CDATA[39]]>
</value>
</param>
<param index="1">
<value>
<![CDATA[S0642169420]]>
</value>
</param>
</params>
<reporter-output>
</reporter-output>
</test-method> <!-- get_request_data -->
</test-method> <!-- cancel_orderAction -->
</class> <!-- com.mjitech.qa.test.MicroMedinece -->
</test> <!-- Default test -->
</suite> <!-- Default suite -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment