aa

    技术2022-07-10  121

    aaa

    public class PortAutoTest { private String city; public PortAutoTest(String city) { this.city = city; } @Parameters public static Collection<String[]> getParameters() throws EncryptedDocumentException, InvalidFormatException, IOException{ String[][] params = new String[2][1]; String[] values = ExcelUtils.readData(); for (int i = 0; i < values.length; i++) { params[i][0] = values[i]; }

    return Arrays.asList(params); } @Test public void testWeather() throws Exception { String url = "http://apis.juhe.cn/simpleWeather/query?city="+city+"&key=07df57ad446d3771b766ea4eb3f789c0"; HttpGet httpGet = new HttpGet(url); HttpClient httpClient = HttpClients.createDefault(); HttpResponse httpResponse = httpClient.execute(httpGet); HttpEntity httpEntity = httpResponse.getEntity(); String entity = EntityUtils.toString(httpEntity); System.out.println(entity); }

    }

    Processed: 0.012, SQL: 9