1 7 8 10 package org.jboss.test.jbossnet.basic; 11 12 import junit.framework.Test; 13 import junit.framework.TestSuite; 14 import org.jboss.test.jbossnet.JBossNetTestBase; 15 16 import java.io.BufferedReader ; 17 import java.io.InputStreamReader ; 18 import java.net.URL ; 19 20 27 28 public class AxisUnitTestCase extends JBossNetTestBase 29 { 30 31 public AxisUnitTestCase(String name) 33 { 34 super(name); 35 } 36 37 38 public void testServlet() throws Exception 39 { 40 doLegalAccess("Servlet availability", new URL ("http://" + getServerHost() + ":8080/jboss-net/servlet/AxisServlet")); 41 doLegalAccess("service availability", new URL ("http://" + getServerHost() + ":8080/jboss-net/services")); 42 } 43 44 45 private void doLegalAccess(String message, URL target) throws Exception 46 { 47 BufferedReader reader = new BufferedReader (new InputStreamReader (target.openStream())); 48 try 49 { 50 String line = reader.readLine(); 51 assertNotNull(message + " proper response", line); 52 } 53 finally 54 { 55 reader.close(); 56 } 57 } 58 59 public static Test suite() throws Exception 60 { 61 return new TestSuite(AxisUnitTestCase.class); 63 } 64 } 65 | Popular Tags |