1 17 18 package org.apache.geronimo.jetty; 19 20 import java.io.BufferedReader ; 21 import java.io.InputStreamReader ; 22 import java.net.HttpURLConnection ; 23 import java.net.URL ; 24 25 28 public class ApplicationTest extends AbstractWebModuleTest { 29 30 public void testApplication() throws Exception { 31 setUpInsecureAppContext(); 32 33 setUpStaticContentServlet(); 34 35 HttpURLConnection connection = (HttpURLConnection ) new URL ("http://localhost:5678/test/hello.txt").openConnection(); 36 BufferedReader reader = new BufferedReader (new InputStreamReader (connection.getInputStream())); 37 assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode()); 38 assertEquals("Hello World", reader.readLine()); 39 connection.disconnect(); 40 } 41 42 } 43 | Popular Tags |