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.versioning;
19:
20: import java.lang.reflect.UndeclaredThrowableException;
21:
22: import javax.xml.namespace.QName;
23:
24: import org.apache.cxf.systest.jaxws.ServerMixedStyle;
25: import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
26: import org.apache.hello_world_mixedstyle.Greeter;
27: import org.apache.hello_world_mixedstyle.SOAPService;
28: import org.apache.hello_world_mixedstyle.types.GreetMe1;
29: import org.apache.hello_world_mixedstyle.types.GreetMeResponse;
30: import org.junit.BeforeClass;
31: import org.junit.Test;
32:
33: public class ClientServerVersioningTest extends
34: AbstractClientServerTestBase {
35:
36: private final QName portName = new QName(
37: "http://apache.org/hello_world_mixedstyle", "SoapPort");
38:
39: @BeforeClass
40: public static void startServers() throws Exception {
41: assertTrue("server did not launch correctly",
42: launchServer(ServerMixedStyle.class));
43: }
44:
45: @Test
46: public void testVersionBasedRouting() throws Exception {
47:
48: SOAPService service = new SOAPService();
49: assertNotNull(service);
50:
51: try {
52: Greeter greeter = service.getPort(portName, Greeter.class);
53:
54: GreetMe1 request = new GreetMe1();
55: request.setRequestType("Bonjour");
56: GreetMeResponse greeting = greeter.greetMe(request);
57: assertNotNull("no response received from service", greeting);
58: assertEquals("Hello Bonjour", greeting.getResponseType());
59:
60: String reply = greeter.sayHi();
61: assertNotNull("no response received from service", reply);
62: assertEquals("Bonjour", reply);
63: } catch (UndeclaredThrowableException ex) {
64: throw (Exception) ex.getCause();
65: }
66: }
67:
68: }
|