use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class ProxyServiceSerializationTest method testProxyServiceSerializationSenarioThree.
public void testProxyServiceSerializationSenarioThree() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " + "name=\"name\" startOnLoad=\"true\" transports=\"http\"><description>" + "description</description><target><inSequence onError=\"ref\"><description>Test documentation</description><send/></inSequence>" + "<outSequence><send/></outSequence></target><publishWSDL key=\"key\"></publishWSDL>" + "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
OMElement inputOM = createOMElement(inputXml);
ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
assertTrue(compare(resultOM, inputOM));
}
use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class SynapseXMLConfigurationSerializerTest method testSerializeConfiguration4.
/**
* Test serializeConfigurationMethod with proxyServices added for SynapseConfiguration and assert OMElement returned
*/
@Test
public void testSerializeConfiguration4() {
SynapseXMLConfigurationSerializer serializer = new SynapseXMLConfigurationSerializer();
SynapseConfiguration synapseConfiguration = new SynapseConfiguration();
ProxyService proxyService = new ProxyService("testProxyService");
synapseConfiguration.addProxyService(proxyService.getName(), proxyService);
OMElement element = serializer.serializeConfiguration(synapseConfiguration);
Assert.assertNotNull("OMElement is not returned", element);
Assert.assertEquals("definitions", element.getLocalName());
Assert.assertTrue("ProxyService added is not serialized.", element.getChildren().next().toString().contains("name=\"testProxyService\""));
}
use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class ProxyServiceSerializationTest method testProxyServiceSerializationSenarioFour.
public void testProxyServiceSerializationSenarioFour() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " + "name=\"name\" startOnLoad=\"true\" transports=\"http\"><description>" + "description</description><target><inSequence onError=\"ref\"><send/></inSequence>" + "<outSequence><send/></outSequence></target><enableAddressing/><publishWSDL key=\"key\"></publishWSDL>" + "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
OMElement inputOM = createOMElement(inputXml);
ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
assertTrue(compare(resultOM, inputOM));
}
use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class ProxyServiceSerializationTest method testProxyServiceSerializationWithPreserveProxy.
/**
* Serialization of 'preserveProxy' attribute in PublishWSDL
*
* @throws Exception
*/
public void testProxyServiceSerializationWithPreserveProxy() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description><target>" + "<endpoint><address uri=\"http://www.example.com/testepr\"/></endpoint><outSequence><send/>" + "</outSequence></target><publishWSDL preservePolicy=\"true\" endpoint=\"wsdl_ep\"></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>";
OMElement inputOM = createOMElement(inputXml);
ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
assertTrue(compare(resultOM, inputOM));
}
use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class ProxyServiceSerializationTest method testProxyServiceSerializationSenarioTwo.
public void testProxyServiceSerializationSenarioTwo() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description>" + "<target endpoint=\"epr\" outSequence=\"out\"/><publishWSDL key=\"key\">" + "</publishWSDL><policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>";
OMElement inputOM = createOMElement(inputXml);
ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
assertTrue(compare(resultOM, inputOM));
}
Aggregations