1 25 26 package org.objectweb.jonas.examples.clients.webservices; 27 28 import junit.framework.TestSuite; 29 30 import com.meterware.httpunit.WebResponse; 31 32 33 38 public class F_WsAccessTest extends A_WebServices { 39 40 43 private static final String URL_WSACCESSTEST = "/wsaccess/"; 44 45 49 public static void main(String [] args) { 50 51 String testtorun = null; 52 for (int argn = 0; argn < args.length; argn++) { 54 String sArg = args[argn]; 55 if (sArg.equals("-n")) { 56 testtorun = args[++argn]; 57 } 58 } 59 60 if (testtorun == null) { 61 junit.textui.TestRunner.run(suite()); 62 } else { 63 junit.textui.TestRunner.run(new F_WsAccessTest(testtorun)); 64 } 65 } 66 67 71 public static TestSuite suite() { 72 return new TestSuite(F_WsAccessTest.class); 73 } 74 75 80 protected void setUp() throws Exception { 81 super.setUp(); 82 useWar("wsaccess"); 83 } 84 85 89 public F_WsAccessTest(String s) { 90 super(s, URL_WSACCESSTEST); 91 } 92 93 97 public void testDeploymentCompleted() throws Exception { 98 checkDeploymentCompleted(2+3); 100 } 101 102 106 public void testWebServiceJspAccess() throws Exception { 107 108 WebResponse wr = executeGoogleWebService("googleByJSP.jsp", 109 "ObjectWeb JOnAS"); 110 assertTrue("a list is returned", wr.getLinks().length > 0); 111 } 112 113 117 public void testWebServiceServletAccess() throws Exception { 118 119 WebResponse wr = executeGoogleWebService("googleByServlet.html", 120 "ObjectWeb JOnAS"); 121 assertTrue("a list is returned", wr.getLinks().length > 0); 122 123 } 124 } 125 | Popular Tags |