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