01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.systest.jaxws;
19:
20: import javax.xml.namespace.QName;
21: import javax.xml.ws.Endpoint;
22:
23: import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
24: import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
25: import org.junit.BeforeClass;
26: import org.junit.Test;
27:
28: public class ClientServerRPCLitDefatulAnnoTest extends
29: AbstractClientServerTestBase {
30:
31: public static class Server extends AbstractBusTestServerBase {
32:
33: protected void run() {
34: Object implementor = new HelloImpl();
35: String address = "http://localhost:9090/hello";
36: Endpoint.publish(address, implementor);
37: }
38:
39: public static void main(String[] args) {
40: try {
41: Server s = new Server();
42: s.start();
43: } catch (Exception ex) {
44: ex.printStackTrace();
45: System.exit(-1);
46: } finally {
47: System.out.println("done!");
48: }
49: }
50: }
51:
52: @BeforeClass
53: public static void startServers() throws Exception {
54: assertTrue("server did not launch correctly",
55: launchServer(Server.class));
56: }
57:
58: @Test
59: public void testBasicConnection() throws Exception {
60: QName serviceName = new QName(
61: "http://cxf.apache.org/systest/jaxws/", "HelloService");
62: HelloService service = new HelloService(getClass().getResource(
63: "/wsdl/hello.wsdl"), serviceName);
64: assertNotNull(service);
65: Hello hello = service.getHelloPort();
66: assertEquals("getSayHi", hello.sayHi("SayHi"));
67:
68: }
69: }
|