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.service.factory;
19:
20: import org.apache.cxf.Bus;
21: import org.apache.cxf.binding.BindingFactoryManager;
22: import org.apache.cxf.binding.soap.SoapBindingFactory;
23: import org.apache.cxf.binding.soap.SoapTransportFactory;
24: import org.apache.cxf.test.AbstractCXFTest;
25: import org.apache.cxf.transport.ConduitInitiatorManager;
26: import org.apache.cxf.transport.DestinationFactoryManager;
27: import org.apache.cxf.transport.local.LocalTransportFactory;
28: import org.junit.Before;
29:
30: public abstract class AbstractSimpleFrontendTest extends
31: AbstractCXFTest {
32:
33: @Before
34: public void setUp() throws Exception {
35: super .setUpBus();
36:
37: Bus bus = getBus();
38:
39: SoapBindingFactory bindingFactory = new SoapBindingFactory();
40:
41: bus.getExtension(BindingFactoryManager.class)
42: .registerBindingFactory(
43: "http://schemas.xmlsoap.org/wsdl/soap/",
44: bindingFactory);
45:
46: DestinationFactoryManager dfm = bus
47: .getExtension(DestinationFactoryManager.class);
48: SoapTransportFactory soapTF = new SoapTransportFactory();
49: soapTF.setBus(bus);
50: dfm.registerDestinationFactory(
51: "http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
52: dfm.registerDestinationFactory(
53: "http://schemas.xmlsoap.org/soap/", soapTF);
54:
55: LocalTransportFactory localTransport = new LocalTransportFactory();
56: dfm.registerDestinationFactory(
57: "http://schemas.xmlsoap.org/wsdl/soap/http",
58: localTransport);
59: dfm.registerDestinationFactory(
60: "http://schemas.xmlsoap.org/soap/http", localTransport);
61:
62: ConduitInitiatorManager extension = bus
63: .getExtension(ConduitInitiatorManager.class);
64: extension.registerConduitInitiator(
65: LocalTransportFactory.TRANSPORT_ID, localTransport);
66: extension.registerConduitInitiator(
67: "http://schemas.xmlsoap.org/wsdl/soap/http",
68: localTransport);
69: extension.registerConduitInitiator(
70: "http://schemas.xmlsoap.org/soap/http", localTransport);
71:
72: extension.registerConduitInitiator(
73: "http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
74: }
75:
76: }
|