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: */
19:
20: package org.apache.synapse.transport;
21:
22: import junit.framework.TestCase;
23: import org.apache.axiom.om.OMAbstractFactory;
24: import org.apache.axiom.om.OMElement;
25: import org.apache.axiom.om.OMFactory;
26: import org.apache.axiom.om.OMNamespace;
27: import org.apache.axis2.context.ConfigurationContext;
28: import org.apache.axis2.description.TransportOutDescription;
29: import org.apache.axis2.engine.AxisConfiguration;
30: import org.apache.synapse.transport.vfs.VFSTransportSender;
31:
32: public class AbstractTransportTest extends TestCase {
33:
34: protected UtilsTransportServer server = null;
35:
36: protected void setUp() throws Exception {
37: server.start();
38: }
39:
40: protected void tearDown() throws Exception {
41: server.stop();
42: }
43:
44: /**
45: * Create the payload for an echoOMElement request
46: * @return
47: */
48: protected OMElement createPayload() {
49: OMFactory fac = OMAbstractFactory.getOMFactory();
50: OMNamespace omNs = fac.createOMNamespace(
51: "http://localhost/axis2/services/EchoXMLService", "my");
52: OMElement method = fac.createOMElement("echoOMElement", omNs);
53: OMElement value = fac.createOMElement("myValue", omNs);
54: value.addChild(fac.createOMText(value, "omTextValue"));
55: method.addChild(value);
56: return method;
57: }
58:
59: /**
60: * Get the default axis2 configuration context for a client
61: * @return
62: * @throws Exception
63: */
64: protected ConfigurationContext getClientCfgCtx() throws Exception {
65: AxisConfiguration axisCfg = new AxisConfiguration();
66: ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg);
67: return cfgCtx;
68: }
69:
70: }
|