use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetBreakPointProxyOutSequence.
public void testDebugManagerProcessCommandSetBreakPointProxyOutSequence() throws Exception {
ProxyService ps = new ProxyService("test_proxy_2");
TestMediator in1 = new TestMediator();
TestMediator in2 = new TestMediator();
TestMediator in3 = new TestMediator();
SequenceMediator inSeq = new SequenceMediator();
inSeq.addChild(in1);
inSeq.addChild(in2);
inSeq.addChild(in3);
TestMediator out1 = new TestMediator();
TestMediator out2 = new TestMediator();
TestMediator out3 = new TestMediator();
SequenceMediator outSeq = new SequenceMediator();
outSeq.addChild(out1);
outSeq.addChild(out2);
outSeq.addChild(out3);
ps.setTargetInLineInSequence(inSeq);
ps.setTargetInLineOutSequence(inSeq);
synConfig.addProxyService(ps.getName(), ps);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"breakpoint\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"proxy\":{\"proxy-key\":\"test_proxy_2\",\"sequence-type\":\"proxy_outseq\"," + "\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) ps.getTargetInLineOutSequence().getChild(0)).isBreakPoint());
}
use of org.apache.synapse.core.axis2.ProxyService in project wso2-synapse by wso2.
the class ProxyServiceSerializationTest method testProxyServiceSerializationSenarioOne.
public void testProxyServiceSerializationSenarioOne() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " + "startOnLoad=\"true\" transports=\"http\"><description>description</description>" + "<target inSequence=\"inseqname\" outSequence=\"outseqname\" faultSequence=\"faultseqname\" />" + "<publishWSDL uri=\"http://uri\" ></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 testProxyServiceSerializationScenarioSix.
public void testProxyServiceSerializationScenarioSix() 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 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 testProxyServiceSerializationSenarioFive.
public void testProxyServiceSerializationSenarioFive() 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 uri=\"http://uri\"></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 testProxyServiceSerializationWithResourceMap.
// public void testProxyServiceSerializationSenarioSix() throws Exception {
// String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" name=\"name\" transports=\"http\"><description>description</description><target><endpoint address=\"http://www.example.com/testepr\" /></target><publish-wsdl uri=\"http://uri\" key=\"key\"></publish-wsdl><policy key=\"key\"/><parameter name=\"para\"><inline xmlns=\"http://customns\"><test/></inline></parameter></proxy>";
// OMElement inputOM = createOMElement(inputXml);
// ProxyService proxy = ProxyServiceFactory.createProxy(inputOM);
// OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
// assertTrue(comparator.compare(resultOM, inputOM));
// }
public void testProxyServiceSerializationWithResourceMap() throws Exception {
String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " + "startOnLoad=\"true\"><target><endpoint><address uri=\"http://www.example.com/testepr\"/>" + "</endpoint><outSequence><send/></outSequence></target><publishWSDL uri=\"http://uri\">" + "<resource location=\"test1.xsd\" key=\"test-key1\"/><resource location=\"test2.xsd\"" + " key=\"test-key2\"/></publishWSDL></proxy>";
OMElement inputOM = createOMElement(inputXml);
ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties());
assertNotNull(proxy.getResourceMap());
OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy);
assertTrue(compare(resultOM, inputOM));
}
Aggregations