use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetBreakPointSequence.
public void testDebugManagerProcessCommandSetBreakPointSequence() throws Exception {
TestMediator t1 = new TestMediator();
TestMediator t2 = new TestMediator();
TestMediator t3 = new TestMediator();
SequenceMediator seq = new SequenceMediator();
seq.addChild(t1);
seq.addChild(t2);
seq.addChild(t3);
synConfig.addSequence("test_sequence_1", seq);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"breakpoint\"," + "\"mediation-component\":\"sequence\",\"sequence\":{\"sequence-key\":\"test_sequence_1\"," + "\"sequence-type\": \"named\",\"mediator-position\": \"0\"}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) seq.getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandClearBreakPointSequence.
public void testDebugManagerProcessCommandClearBreakPointSequence() throws Exception {
TestMediator t1 = new TestMediator();
TestMediator t2 = new TestMediator();
TestMediator t3 = new TestMediator();
SequenceMediator seq = new SequenceMediator();
seq.addChild(t1);
seq.addChild(t2);
seq.addChild(t3);
synConfig.addSequence("test_sequence_2", seq);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"breakpoint\"," + "\"mediation-component\":\"sequence\",\"sequence\":{\"sequence-key\":\"test_sequence_2\"," + "\"sequence-type\": \"named\",\"mediator-position\": \"0\"}}";
dm.processDebugCommand(debug_command);
debug_command = "{\"command\":\"clear\",\"command-argument\":\"breakpoint\"," + "\"mediation-component\":\"sequence\",\"sequence\":{\"sequence-key\":\"test_sequence_2\"," + "\"sequence-type\": \"named\",\"mediator-position\": \"0\"}}";
dm.processDebugCommand(debug_command);
assertTrue(!((AbstractMediator) seq.getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandClearSkipSequence.
public void testDebugManagerProcessCommandClearSkipSequence() throws Exception {
TestMediator t1 = new TestMediator();
TestMediator t2 = new TestMediator();
TestMediator t3 = new TestMediator();
SequenceMediator seq = new SequenceMediator();
seq.addChild(t1);
seq.addChild(t2);
seq.addChild(t3);
synConfig.addSequence("test_sequence_4", seq);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"skip\"," + "\"mediation-component\":\"sequence\",\"sequence\":{\"sequence-key\":\"test_sequence_4\"," + "\"sequence-type\": \"named\",\"mediator-position\": \"0\"}}";
dm.processDebugCommand(debug_command);
debug_command = "{\"command\":\"clear\",\"command-argument\":\"skip\"," + "\"mediation-component\":\"sequence\",\"sequence\":{\"sequence-key\":\"test_sequence_4\"," + "\"sequence-type\": \"named\",\"mediator-position\": \"0\"}}";
dm.processDebugCommand(debug_command);
assertTrue(!((AbstractMediator) seq.getChild(0)).isSkipEnabled());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetBreakPointInboundErrorSequence.
public void testDebugManagerProcessCommandSetBreakPointInboundErrorSequence() throws Exception {
InboundEndpoint inboundEndpoint = new InboundEndpoint();
inboundEndpoint.setName("test_inbound_2");
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_1", dispatchSeq);
inboundEndpoint.setInjectingSeq("dispatch_1");
synConfig.addSequence("error_1", errorSeq);
inboundEndpoint.setOnErrorSeq("error_1");
synConfig.addInboundEndpoint(inboundEndpoint.getName(), inboundEndpoint);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"breakpoint\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"inbound\":{\"inbound-key\":\"test_inbound_2\",\"sequence-type\":\"inbound_faultseq\",\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) errorSeq.getChild(0)).isBreakPoint());
}
use of org.apache.synapse.mediators.base.SequenceMediator in project wso2-synapse by wso2.
the class DebugManagerTest method testDebugManagerProcessCommandSetSkipInboundSequence.
public void testDebugManagerProcessCommandSetSkipInboundSequence() throws Exception {
InboundEndpoint inboundEndpoint = new InboundEndpoint();
inboundEndpoint.setName("test_inbound_3");
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_3", dispatchSeq);
inboundEndpoint.setInjectingSeq("dispatch_3");
synConfig.addSequence("error_3", errorSeq);
inboundEndpoint.setOnErrorSeq("error_3");
synConfig.addInboundEndpoint(inboundEndpoint.getName(), inboundEndpoint);
String debug_command = "{\"command\":\"set\",\"command-argument\":\"skip\",\"mediation-component\":\"sequence\"," + "\"sequence\":{\"inbound\":{\"inbound-key\":\"test_inbound_3\",\"sequence-type\":\"inbound_seq\",\"mediator-position\":\"0\"}}}";
dm.processDebugCommand(debug_command);
assertTrue(((AbstractMediator) dispatchSeq.getChild(0)).isSkipEnabled());
}
Aggregations