use of org.apache.axis2.engine.AxisConfiguration in project wso2-axis2-transports by wso2.
the class AxisTestClientContext method setUp.
@Setup
@SuppressWarnings("unused")
private void setUp(TransportDescriptionFactory tdf, AxisTestClientContextConfigurator[] configurators) throws Exception {
cfgCtx = ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
TransportOutDescription trpOutDesc = tdf.createTransportOutDescription();
axisCfg.addTransportOut(trpOutDesc);
sender = trpOutDesc.getSender();
sender.init(cfgCtx, trpOutDesc);
boolean useListener = false;
for (AxisTestClientContextConfigurator configurator : configurators) {
if (configurator.isTransportListenerRequired()) {
useListener = true;
break;
}
}
TransportInDescription trpInDesc;
if (useListener) {
trpInDesc = tdf.createTransportInDescription();
} else {
trpInDesc = null;
}
for (AxisTestClientContextConfigurator configurator : configurators) {
configurator.setupTransport(trpInDesc, trpOutDesc);
}
if (useListener) {
listenerManager = new ListenerManager();
listenerManager.init(cfgCtx);
cfgCtx.setTransportManager(listenerManager);
listenerManager.addListener(trpInDesc, false);
listenerManager.start();
}
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-axis2-transports by wso2.
the class UDPTest method getClientCfgCtx.
public ConfigurationContext getClientCfgCtx() throws Exception {
ConfigurationContext cfgCtx = ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
axisCfg.engageModule("addressing");
TransportInDescription trpInDesc = new TransportInDescription("udp");
trpInDesc.setReceiver(new UDPListener());
axisCfg.addTransportIn(trpInDesc);
TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
trpOutDesc.setSender(new UDPSender());
axisCfg.addTransportOut(trpOutDesc);
return cfgCtx;
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-axis2-transports by wso2.
the class AbstractTransportTest method getClientCfgCtx.
/**
* Get the default axis2 configuration context for a client
* @return
* @throws Exception
*/
protected ConfigurationContext getClientCfgCtx() throws Exception {
AxisConfiguration axisCfg = new AxisConfiguration();
ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg);
return cfgCtx;
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-axis2-transports by wso2.
the class AxisTestEndpointContext method setUp.
@Setup
@SuppressWarnings("unused")
private void setUp(TransportDescriptionFactory tdf, AxisTestEndpointContextConfigurator[] configurators) throws Exception {
server = new UtilsTransportServer();
TransportOutDescription trpOutDesc = tdf.createTransportOutDescription();
trpInDesc = tdf.createTransportInDescription();
server.addTransport(trpInDesc, trpOutDesc);
for (AxisTestEndpointContextConfigurator configurator : configurators) {
configurator.setupTransport(trpInDesc, trpOutDesc);
}
ConfigurationContext cfgCtx = server.getConfigurationContext();
cfgCtx.setContextRoot("/");
cfgCtx.setServicePath("services");
AxisConfiguration axisConfiguration = server.getAxisConfiguration();
server.start();
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-axis2-transports by wso2.
the class ContentTypeRuleTest method setUp.
@Override
public void setUp() throws Exception {
AxisConfiguration axisCfg = new AxisConfiguration();
ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg);
AxisService service = new AxisService();
InputStream in = ContentTypeRuleTest.class.getResourceAsStream(getName() + ".xml");
try {
OMElement element = new StAXOMBuilder(in).getDocumentElement();
new ServiceBuilder(cfgCtx, service).populateService(element);
} finally {
in.close();
}
ruleSet = ContentTypeRuleFactory.parse(service.getParameter("test"));
}
Aggregations