use of org.apache.axis2.engine.AxisConfiguration in project wso2-synapse by wso2.
the class MetricsAggregatorModuleTest method testInit.
/**
* Initializing metricsAggregationModule and assert for the returned counter obj
* @throws AxisFault
*/
public void testInit() throws AxisFault {
AxisConfiguration axisConfiguration = new AxisConfiguration();
ConfigurationContext configurationContext = new ConfigurationContext(axisConfiguration);
metricsAggregatorModule.init(configurationContext, null);
Counter counter = (Counter) axisConfiguration.getParameter(MetricsConstants.GLOBAL_REQUEST_COUNTER).getValue();
Assert.assertEquals("Counter should be 0", counter.getCount(), 0);
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-synapse by wso2.
the class ServerConfigurationInformationFactory method getAxis2ParameterValue.
/**
* Helper method to get a value of a parameters in the AxisConfiguration
*
* @param axisConfiguration AxisConfiguration instance
* @param paramKey The name / key of the parameter
* @return The value of the parameter
*/
private static String getAxis2ParameterValue(AxisConfiguration axisConfiguration, String paramKey) {
Parameter parameter = axisConfiguration.getParameter(paramKey);
if (parameter == null) {
return null;
}
Object value = parameter.getValue();
if (value != null && value instanceof String) {
return (String) parameter.getValue();
} else {
return null;
}
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-synapse by wso2.
the class SynapseObserverTest method testSimpleObserver.
public void testSimpleObserver() {
SynapseConfiguration synapseConfig = new SynapseConfiguration();
synapseConfig.setAxisConfiguration(new AxisConfiguration());
synapseConfig.registerObserver(observer);
Endpoint epr = new AddressEndpoint();
epr.setName("endpoint1");
synapseConfig.addEndpoint(epr.getName(), epr);
assertItemAdded(epr.getName(), ENDPOINT);
synapseConfig.removeEndpoint(epr.getName());
assertItemRemoved(epr.getName(), ENDPOINT);
SequenceMediator seq = new SequenceMediator();
seq.setName("sequence1");
synapseConfig.addSequence(seq.getName(), seq);
assertItemAdded(seq.getName(), SEQUENCE);
synapseConfig.removeSequence(seq.getName());
assertItemRemoved(seq.getName(), SEQUENCE);
TemplateMediator template = new TemplateMediator();
template.setName("template1");
synapseConfig.addSequenceTemplate(template.getName(), template);
assertItemAdded(template.getName(), SEQUENCE_TEMPLATE);
synapseConfig.removeSequenceTemplate(template.getName());
assertItemRemoved(template.getName(), SEQUENCE_TEMPLATE);
Entry entry = new Entry();
entry.setKey("entry1");
synapseConfig.addEntry(entry.getKey(), entry);
assertItemAdded(entry.getKey(), ENTRY);
synapseConfig.removeEntry(entry.getKey());
assertItemRemoved(entry.getKey(), ENTRY);
ProxyService proxy = new ProxyService("proxy1");
synapseConfig.addProxyService(proxy.getName(), proxy);
assertItemAdded(proxy.getName(), PROXY);
synapseConfig.removeProxyService(proxy.getName());
assertItemRemoved(proxy.getName(), PROXY);
Startup startup = new StartUpController();
startup.setName("startup1");
synapseConfig.addStartup(startup);
assertItemAdded(startup.getName(), STARTUP);
synapseConfig.removeStartup(startup.getName());
assertItemRemoved(startup.getName(), STARTUP);
SynapseEventSource eventSrc = new SynapseEventSource("eventSrc1");
synapseConfig.addEventSource(eventSrc.getName(), eventSrc);
assertItemAdded(eventSrc.getName(), EVENT_SRC);
synapseConfig.removeEventSource(eventSrc.getName());
assertItemRemoved(eventSrc.getName(), EVENT_SRC);
PriorityExecutor exec = new PriorityExecutor();
exec.setName("exec1");
synapseConfig.addPriorityExecutor(exec.getName(), exec);
assertItemAdded(exec.getName(), EXECUTOR);
synapseConfig.removeExecutor(exec.getName());
assertItemRemoved(exec.getName(), EXECUTOR);
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-synapse by wso2.
the class HessianMessageBuilderTest method testProcessDocumentFaultWithSynEnv.
public void testProcessDocumentFaultWithSynEnv() throws IOException {
SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()), new SynapseConfiguration());
testProcessDocumentFault(synEnv);
}
use of org.apache.axis2.engine.AxisConfiguration in project wso2-synapse by wso2.
the class HessianMessageBuilderTest method testProcessDocumentWithSynEnv.
public void testProcessDocumentWithSynEnv() throws IOException {
SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()), new SynapseConfiguration());
testProcessDocument(synEnv);
}
Aggregations