import java.lang.*; import java.io.*; import java.net.*; import com.sun.ejte.ccl.reporter.*; public class WebTest { private static final String TEST_NAME = "callflow-dbreader-servlet"; private String host; private String port; private String contextRoot; public WebTest(String[] args) { host = args[0]; port = args[1]; contextRoot = args[2]; } public static void main(String[] args) { WebTest webTest = new WebTest(args); try { webTest.doTest(); } catch (Exception ex) { ex.printStackTrace(); } } public void doTest() throws Exception { URL url = new URL("http://" + host + ":" + port + contextRoot + "/dbReader"); System.out.println("Connecting to: " + url.toString()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.connect(); int responseCode = conn.getResponseCode(); if (responseCode != 200) { System.err.println("Unexpected return code: " + responseCode); } else { InputStream is = conn.getInputStream(); BufferedReader input = new BufferedReader(new InputStreamReader(is)); String line = input.readLine(); System.out.println ("Callflow Data : "+line); System.out.println (input.readLine()); } } }