01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.servicemix.cxfbc.interceptors;
18:
19: import java.net.URL;
20: import java.util.logging.Logger;
21:
22: import javax.xml.namespace.QName;
23:
24: import org.apache.servicemix.cxfbc.interceptors.types.quote.Quote;
25:
26: import org.apache.servicemix.tck.SpringTestSupport;
27: import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
28: import org.springframework.context.support.AbstractXmlApplicationContext;
29:
30: public class CxfBcInterceptorTest extends SpringTestSupport {
31:
32: static final Logger LOG = Logger
33: .getLogger(CxfBcInterceptorTest.class.getName());
34:
35: public void testEndpointRPCWithExternalConsumerWithMultipleResponeParts()
36: throws Exception {
37:
38: QName stockServiceName = new QName(
39: "http://servicemix.apache.org/cxfbc/interceptors",
40: "StockQuoteReporterRPCService");
41: URL wsdlUrl = CxfBcInterceptorTest.class
42: .getClassLoader()
43: .getResource(
44: "org/apache/servicemix/cxfbc/interceptors/quote.wsdl");
45: StockQuoteReporterRPCService quoteService = new StockQuoteReporterRPCService(
46: wsdlUrl, stockServiceName);
47:
48: QuoteReporterRPC port = quoteService
49: .getStockQuoteReporterRPCPort();
50:
51: javax.xml.ws.Holder<java.lang.String> retailTicker = new javax.xml.ws.Holder<java.lang.String>(
52: "RetailerRPC");
53:
54: Quote quote = port.getStockQuote("FUSE", retailTicker);
55: Thread.sleep(1000);
56: //Thread.sleep(10 * 60 * 1000);
57:
58: assertEquals("FUSE ESB", quote.getID());
59: assertEquals("8.00", quote.getTime());
60: assertEquals(26.0, quote.getVal(), 0);
61: System.out.println("retail val = " + retailTicker.value);
62: assertEquals("IONA PLC", retailTicker.value);
63: }
64:
65: @Override
66: protected AbstractXmlApplicationContext createBeanFactory() {
67: return new ClassPathXmlApplicationContext(
68: "org/apache/servicemix/cxfbc/interceptors/xbean.xml");
69: }
70:
71: }
|