package client; import javax.xml.ws.WebServiceRef; import endpoint.HelloImplService; import endpoint.HelloImpl; import com.sun.ejte.ccl.reporter.SimpleReporterAdapter; public class Client { private static SimpleReporterAdapter stat = new SimpleReporterAdapter("appserv-tests"); @WebServiceRef(wsdlLocation="http://HTTP_HOST:HTTP_PORT/HelloImplService/HelloImpl?WSDL") static HelloImplService service; public static void main(String[] args) { stat.addDescription("ejb-exception"); Client client = new Client(); client.doTest(args); stat.printSummary("ejb-exception"); } public void doTest(String[] args) { try { HelloImpl port = service.getHelloImplPort(); for (int i=0;i<10;i++) { String ret = port.sayHello("Appserver Tester !"); if(ret.indexOf("WebSvcTest-Hello") == -1) { System.out.println("Unexpected greeting " + ret); stat.addStatus("Simple-Annotation", stat.FAIL); return; } System.out.println(ret); } // we were supposed to fail ! stat.addStatus("ejb-exception", stat.FAIL); } catch(Exception e) { System.out.println("Got expected exception " + e.getMessage()); stat.addStatus("ejb-exception", stat.PASS); } } }