Search in sources :

Example 1 with AbstractMediator

use of org.apache.synapse.mediators.AbstractMediator in project wso2-synapse by wso2.

the class DebugManagerTest method testDebugManagerProcessCommandClearSkipTemplate.

public void testDebugManagerProcessCommandClearSkipTemplate() throws Exception {
    TestMediator t1 = new TestMediator();
    TestMediator t2 = new TestMediator();
    TestMediator t3 = new TestMediator();
    TemplateMediator temp = new TemplateMediator();
    temp.addChild(t1);
    temp.addChild(t2);
    temp.addChild(t3);
    temp.setName("test_sequence_template_4");
    synConfig.addSequenceTemplate(temp.getName(), temp);
    String debug_command = "{\"command\":\"set\",\"command-argument\":\"skip\"," + "\"mediation-component\":\"template\",\"template\":{\"template-key\":\"test_sequence_template_4\"," + "\"mediator-position\": \"0\"}}";
    dm.processDebugCommand(debug_command);
    debug_command = "{\"command\":\"clear\",\"command-argument\":\"skip\",\"mediation-component\":\"template\"," + "\"template\":{\"template-key\":\"test_sequence_template_4\",\"mediator-position\": \"0\"}}";
    dm.processDebugCommand(debug_command);
    assertTrue(!((AbstractMediator) temp.getChild(0)).isSkipEnabled());
}
Also used : TemplateMediator(org.apache.synapse.mediators.template.TemplateMediator) TestMediator(org.apache.synapse.mediators.TestMediator) AbstractMediator(org.apache.synapse.mediators.AbstractMediator)

Example 2 with AbstractMediator

use of org.apache.synapse.mediators.AbstractMediator 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());
}
Also used : TestMediator(org.apache.synapse.mediators.TestMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator) AbstractMediator(org.apache.synapse.mediators.AbstractMediator)

Example 3 with AbstractMediator

use of org.apache.synapse.mediators.AbstractMediator 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());
}
Also used : TestMediator(org.apache.synapse.mediators.TestMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator) AbstractMediator(org.apache.synapse.mediators.AbstractMediator)

Example 4 with AbstractMediator

use of org.apache.synapse.mediators.AbstractMediator 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());
}
Also used : ProxyService(org.apache.synapse.core.axis2.ProxyService) TestMediator(org.apache.synapse.mediators.TestMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator) AbstractMediator(org.apache.synapse.mediators.AbstractMediator)

Example 5 with AbstractMediator

use of org.apache.synapse.mediators.AbstractMediator 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());
}
Also used : ProxyService(org.apache.synapse.core.axis2.ProxyService) TestMediator(org.apache.synapse.mediators.TestMediator) SequenceMediator(org.apache.synapse.mediators.base.SequenceMediator) AbstractMediator(org.apache.synapse.mediators.AbstractMediator)

Aggregations

AbstractMediator (org.apache.synapse.mediators.AbstractMediator)20 Mediator (org.apache.synapse.Mediator)12 SynapseSequenceType (org.apache.synapse.debug.constructs.SynapseSequenceType)8 TestMediator (org.apache.synapse.mediators.TestMediator)8 ProxyService (org.apache.synapse.core.axis2.ProxyService)6 SequenceMediationFlowPoint (org.apache.synapse.debug.constructs.SequenceMediationFlowPoint)6 SequenceMediator (org.apache.synapse.mediators.base.SequenceMediator)6 SynapseMediationFlowPoint (org.apache.synapse.debug.constructs.SynapseMediationFlowPoint)5 APIMediationFlowPoint (org.apache.synapse.debug.constructs.APIMediationFlowPoint)2 ConnectorMediationFlowPoint (org.apache.synapse.debug.constructs.ConnectorMediationFlowPoint)2 InboundEndpoint (org.apache.synapse.inbound.InboundEndpoint)2 TemplateMediator (org.apache.synapse.mediators.template.TemplateMediator)2 API (org.apache.synapse.rest.API)2 Resource (org.apache.synapse.rest.Resource)2