Package org.apache.synapse

Examples of org.apache.synapse.Processor


public class AddressingProcessorTest extends TestCase {

    public void testAddressingProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        Processor addressingProcessor = new AddressingInProcessor();
        SynapseEnvironment env = new Axis2SynapseEnvironment(null,null);
        boolean result = addressingProcessor.process(env,sm);
        assertTrue(((Boolean) sm.getProperty(
                Constants.MEDIATOR_RESPONSE_PROPERTY)).booleanValue());
        assertTrue(result);
    }
View Full Code Here


    }

    public void testAddressingConfigurator() throws Exception {
        AddressingProcessorConfigurator conf = new AddressingProcessorConfigurator();

        Processor pro = conf.createProcessor(env,config.getFirstElement().getFirstElement());
        assertTrue(pro instanceof AddressingInProcessor);
        assertNull(pro.getName());
    }
View Full Code Here

      log.info("process called on empty processor list");
      return true;
    }
    Iterator it = processors.iterator();
    while (it.hasNext()) {
      Processor p = (Processor) it.next();
      log.debug(p.getName() + " = "+ p.getClass());
      if (!p.process(se,smc))
        return false;
    }
    return true;
  }
View Full Code Here

  public void setList(List p) {
    log.debug("setting list");
    Iterator it = p.iterator();
    while (it.hasNext()) {
      Processor x = (Processor)it.next();
      log.debug(x.getName() +" = "+ x.getClass());
    }
    processors = p;
  }
View Full Code Here

    }

    public void testRegexProcessorConfigurator() throws Exception {
        RegexProcessorConfigurator conf = new RegexProcessorConfigurator();
        Processor pro = conf.createProcessor(env,config.getFirstElement().getFirstElement());
        assertTrue(pro instanceof RegexProcessor);
        assertEquals("to",((RegexProcessor)pro).getHeaderType());

    }
View Full Code Here

        env.injectMessage(smc);
        assertEquals("xpath", env.lookupProcessor("xpath").getName());
    }
    public void testXpathProcessorConfigurator() throws Exception {
        XPathProcessorConfigurator conf = new XPathProcessorConfigurator();
        Processor pro = conf.createProcessor(env,config.getFirstElement().getFirstElement());
        assertTrue(pro instanceof XPathProcessor);
        assertEquals("//ns:text",((XPathProcessor)pro).getXPathExpr());
    }
View Full Code Here

        env.injectMessage(smc);
        assertNotNull(env.lookupProcessor("mediation"));
    }
    public void testClassMediatorConfigurator() throws Exception {
        ClassMediatorProcessorConfigurator conf = new ClassMediatorProcessorConfigurator();
        Processor pro = conf.createProcessor(env, config.getFirstElement().getFirstElement());
        assertTrue(pro instanceof ClassMediatorProcessor);
        assertEquals("mediation",pro.getName());
    }
View Full Code Here

public class BulitinProcessorTest extends TestCase {
    public void testLogProcessor() throws Exception {
        SynapseMessage sm = new Axis2SynapseMessage(
                Axis2EnvSetup.axis2Deployment("target/synapse-repository"));
        Processor log = new LogProcessor();
        boolean result = log.process(null,sm);
        assertTrue(result);
    }
View Full Code Here

    Iterator it = el.getChildElements();
    List processors = new LinkedList();
    while (it.hasNext()) {
      OMElement child = (OMElement) it.next();
      Processor proc = ProcessorConfiguratorFinder.getProcessor(se, child);
      if (proc != null)
        processors.add(proc);
      else
        log.info("Unknown child of all" + child.getLocalName());
    }
View Full Code Here

   
    Class cls = find(new QName(n.getName(), element
        .getLocalName()));
    try {
      ProcessorConfigurator pc = (ProcessorConfigurator) cls.newInstance();
      Processor p = pc.createProcessor(synapseEnv, element);
      return p;
    } catch (InstantiationException e) {
      throw new SynapseException(e);
    } catch (IllegalAccessException e) {
      throw new SynapseException(e);
View Full Code Here

TOP

Related Classes of org.apache.synapse.Processor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.