use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class POJOCommandMediatorTest method testPojoWithoutPropertiesCommandImpl.
public void testPojoWithoutPropertiesCommandImpl() throws Exception {
Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement("<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestImplementedMediator' " + "xmlns='http://ws.apache.org/ns/synapse'/>"), new Properties());
POJOCommandTestHelper.reset();
TestMessageContext msgContext = new TestMessageContext();
msgContext.setEnvironment(new Axis2SynapseEnvironment(new SynapseConfiguration()));
pcm.mediate(msgContext);
assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class POJOCommandMediatorTest method testPojoWithoutPropertiesNotCommandImpl.
public void testPojoWithoutPropertiesNotCommandImpl() throws Exception {
Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement("<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestMediator' " + "xmlns='http://ws.apache.org/ns/synapse'/>"), new Properties());
POJOCommandTestHelper.reset();
TestMessageContext msgContext = new TestMessageContext();
msgContext.setEnvironment(new Axis2SynapseEnvironment(new SynapseConfiguration()));
pcm.mediate(msgContext);
assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class POJOCommandMediatorTest method testPojoWithStaticPropertiesCommandImpl.
public void testPojoWithStaticPropertiesCommandImpl() throws Exception {
Mediator pcm = MediatorFactoryFinder.getInstance().getMediator(createOMElement("<pojoCommand name='org.apache.synapse.mediators.ext.POJOCommandTestImplementedMediator' " + "xmlns='http://ws.apache.org/ns/synapse'><property name=\"testProp\" " + "value=\"Test Property\"/></pojoCommand>"), new Properties());
POJOCommandTestHelper.reset();
TestMessageContext msgContext = new TestMessageContext();
msgContext.setEnvironment(new Axis2SynapseEnvironment(new SynapseConfiguration()));
pcm.mediate(msgContext);
assertEquals("Test Property", POJOCommandTestHelper.getInstance().getChangedProperty());
assertTrue(POJOCommandTestHelper.getInstance().isExecuted());
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class ClassMediatorTest method testInitializationAndMedition.
public void testInitializationAndMedition() throws Exception {
Mediator cm = MediatorFactoryFinder.getInstance().getMediator(createOMElement("<class name='org.apache.synapse.mediators.ext.ClassMediatorTestMediator' " + "xmlns='http://ws.apache.org/ns/synapse'/>"), new Properties());
((ManagedLifecycle) cm).init(new Axis2SynapseEnvironment(new SynapseConfiguration()));
assertTrue(ClassMediatorTestMediator.initialized);
TestMessageContext msgContext = new TestMessageContext();
msgContext.setEnvironment(new Axis2SynapseEnvironment(new SynapseConfiguration()));
cm.mediate(msgContext);
assertTrue(ClassMediatorTestMediator.invoked);
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class ClassMediatorTest method testMediationWithLiteralProperties.
public void testMediationWithLiteralProperties() throws Exception {
Mediator cm = MediatorFactoryFinder.getInstance().getMediator(createOMElement("<class name='org.apache.synapse.mediators.ext.ClassMediatorTestMediator' " + "xmlns='http://ws.apache.org/ns/synapse'><property name='testProp' value='testValue'/></class>"), new Properties());
TestMessageContext msgContext = new TestMessageContext();
msgContext.setEnvironment(new Axis2SynapseEnvironment(new SynapseConfiguration()));
cm.mediate(msgContext);
assertTrue(ClassMediatorTestMediator.invoked);
assertTrue(ClassMediatorTestMediator.testProp.equals("testValue"));
}
Aggregations