1 26 27 package org.objectweb.jonas.examples.clients.webservices; 28 29 30 import org.objectweb.jonas.examples.util.JExampleTestCase; 31 32 import com.meterware.httpunit.WebForm; 33 import com.meterware.httpunit.WebLink; 34 import com.meterware.httpunit.WebResponse; 35 36 40 public abstract class A_WebServices extends JExampleTestCase { 41 42 public A_WebServices(String s, String urlPrefix) { 43 super(s, urlPrefix); 44 } 45 46 50 public void checkDeploymentCompleted(int nbHomePageLinks) throws Exception { 51 WebResponse wr = wc.getResponse(url + "index.html"); 52 WebLink[] links = wr.getLinks(); 53 assertEquals("deployment OK", nbHomePageLinks, links.length); 54 } 55 56 public WebResponse executeGoogleWebService(String page, String query) throws Exception { 57 58 WebResponse wr = wc.getResponse(url + page); 59 60 WebForm form = wr.getForms()[0]; 61 form.setParameter("search", query); 63 return form.submit(); 64 } 65 } 66 | Popular Tags |