use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandClearSkipProxyInSequence.
public void testDebugManagerProcessCommandClearSkipProxyInSequence() throws Exception {
ProxyService ps = new ProxyService("test_proxy_7");
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\":\"skip\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"proxy\":{\"proxy-key\":\"test_proxy_7\",\"sequence-type\":\"proxy_inseq\"," + "\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
debug_command = "{\"command\":\"clear\",\"command-argument\":\"skip\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"proxy\":{\"proxy-key\":\"test_proxy_7\",\"sequence-type\":\"proxy_inseq\"," + "\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(!((AbstractMediator) ps.getTargetInLineInSequence().getChild(0)).isSkipEnabled());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandClearBreakPointProxyOutSequence.
public void testDebugManagerProcessCommandClearBreakPointProxyOutSequence() throws Exception {
ProxyService ps = new ProxyService("test_proxy_4");
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_4\",\"sequence-type\":\"proxy_outseq\"," + "\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
debug_command = "{\"command\":\"clear\",\"command-argument\":\"breakpoint\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"proxy\":{\"proxy-key\":\"test_proxy_4\",\"sequence-type\":\"proxy_outseq\"," + "\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(!((AbstractMediator) ps.getTargetInLineOutSequence().getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetBreakPointProxyInSequence.
public void testDebugManagerProcessCommandSetBreakPointProxyInSequence() throws Exception {
ProxyService ps = new ProxyService("test_proxy_1");
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_1\",\"sequence-type\":\"proxy_inseq\",\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) ps.getTargetInLineInSequence().getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetBreakPointInboundSequence.
public void testDebugManagerProcessCommandSetBreakPointInboundSequence() throws Exception {
InboundEndpoint inboundEndpoint = new InboundEndpoint();
inboundEndpoint.setName("test_inbound_1");
TestMediator in1 = new TestMediator();
TestMediator in2 = new TestMediator();
TestMediator in3 = new TestMediator();
SequenceMediator dispatchSeq = new SequenceMediator();
dispatchSeq.addChild(in1);
dispatchSeq.addChild(in2);
dispatchSeq.addChild(in3);
TestMediator out1 = new TestMediator();
TestMediator out2 = new TestMediator();
TestMediator out3 = new TestMediator();
SequenceMediator errorSeq = new SequenceMediator();
errorSeq.addChild(out1);
errorSeq.addChild(out2);
errorSeq.addChild(out3);
synConfig.addSequence("dispatch", dispatchSeq);
inboundEndpoint.setInjectingSeq("dispatch");
synConfig.addSequence("error", errorSeq);
inboundEndpoint.setOnErrorSeq("error");
synConfig.addInboundEndpoint(inboundEndpoint.getName(), inboundEndpoint);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"breakpoint\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"inbound\":{\"inbound-key\":\"test_inbound_1\",\"sequence-type\":\"inbound_seq\",\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) dispatchSeq.getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator 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());
}
Aggregations