(String Data,String reqorresp)
| 30 | } |
| 31 | |
| 32 | public static String TestEncode(String Data,String reqorresp) throws IOException { |
| 33 | String Output = ""; |
| 34 | String decodeTotal = ""; |
| 35 | String[] decodeTotallists = null; |
| 36 | // Data = Data + "\n\n"; |
| 37 | String[] DataLists = Data.replace("\r", "").split("\n\n",2); |
| 38 | // if (DataLists.length > 1) { // POST |
| 39 | |
| 40 | if (IndexautoDecoder.getRadioButtontestHeaderState() && IndexautoDecoder.getRadioButtontestdifferentState()) { // 选中对数据头处理、选中请求响应分开 |
| 41 | |
| 42 | decodeTotallists = sendPostnewHeader(IndexautoDecoder.getEncodeApi(), DataLists[1], DataLists[0] + "\n", reqorresp); |
| 43 | if (decodeTotallists.length == 1) { |
| 44 | Output = decodeTotallists[0]; |
| 45 | } else { |
| 46 | if (decodeTotallists[0].endsWith("\n")) |
| 47 | Output = decodeTotallists[0] + "\n" + decodeTotallists[1]; |
| 48 | else{ |
| 49 | Output = decodeTotallists[0] + "\n\n" + decodeTotallists[1]; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | } else { |
| 54 | if (IndexautoDecoder.getRadioButtontestHeaderState()) { // 选中对数据头处理 |
| 55 | decodeTotallists = sendPostnewHeader(IndexautoDecoder.getEncodeApi(), DataLists[1], DataLists[0] + "\n"); |
| 56 | if (decodeTotallists.length == 1) { |
| 57 | Output = decodeTotallists[0]; |
| 58 | } else { |
| 59 | if (decodeTotallists[0].endsWith("\n")) |
| 60 | Output = decodeTotallists[0] + "\n" + decodeTotallists[1]; |
| 61 | else{ |
| 62 | Output = decodeTotallists[0] + "\n\n" + decodeTotallists[1]; |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | if (IndexautoDecoder.getRadioButtontestdifferentState()) { // 选中请求响应分开 |
| 68 | decodeTotal = sendPostnew(IndexautoDecoder.getEncodeApi(), DataLists[1], reqorresp); |
| 69 | Output = Data.replace(DataLists[1], decodeTotal); |
| 70 | } |
| 71 | |
| 72 | if (!IndexautoDecoder.getRadioButtontestdifferentState() && !IndexautoDecoder.getRadioButtontestHeaderState()) { // 不选中对数据头处理且不选中请求响应分开 |
| 73 | decodeTotal = sendPostnew(IndexautoDecoder.getEncodeApi(), DataLists[1]); |
| 74 | Output = Data.replace(DataLists[1], decodeTotal); |
| 75 | } |
| 76 | } |
| 77 | return Output.trim(); |
| 78 | // return Output.trim()+"\n\n"; |
| 79 | // }else{ |
| 80 | // |
| 81 | // if (IndexautoDecoder.getRadioButtontestHeaderState() && IndexautoDecoder.getRadioButtontestdifferentState()) { // 选中对数据头处理、选中请求响应分开 |
| 82 | // |
| 83 | // decodeTotallists = sendPostnewHeader(IndexautoDecoder.getEncodeApi(), DataLists[1], DataLists[0] + "\n", reqorresp); |
| 84 | // if (decodeTotallists.length == 1) { |
| 85 | // Output = decodeTotallists[0]; |
| 86 | // } else { |
| 87 | // Output = decodeTotallists[0] + "\n" + decodeTotallists[1]; |
| 88 | // } |
| 89 | // |
no test coverage detected