Package de.bamberg.ha.api.processing

Examples of de.bamberg.ha.api.processing.ProcessingRouteChain


public class AbstractProcessingRouteChainTest {

  @Test
  public void testRouteChaining() throws Exception  {
   
    ProcessingRouteChain route1=new AbstractProcessingRouteChain() {
      @Override
      public Future<DistributedExecutionResult> route(Message message) {
        return null;
      }     
    };

    ProcessingRouteChain route2=new AbstractProcessingRouteChain() {
      @Override
      public Future<DistributedExecutionResult> route(Message message) {
        return new FutureTask<DistributedExecutionResult>(new Callable<DistributedExecutionResult>() {

          @Override
          public DistributedExecutionResult call() throws Exception {   
            return new DistributedExecutionResult("2");
          }
         
        });
      }
    };
   
    ProcessingRouteChain route3=new AbstractProcessingRouteChain() {
      @Override
      public Future<DistributedExecutionResult> route(Message message) {
        return null;
      }
     
View Full Code Here


 
  @Test
  public void testRouteChainingIfJustOneProcessorExists() throws Exception {
   
    ProcessingRouteChain route1=new AbstractProcessingRouteChain() {
      @Override
      public Future<DistributedExecutionResult> route(Message message) {
        return new FutureTask<DistributedExecutionResult>(new Callable<DistributedExecutionResult>() {

          @Override
          public DistributedExecutionResult call() throws Exception {   
            return new DistributedExecutionResult("1");
          }
         
        });
      }
    };

    route1.processChain(new TextMessage("test"));
//    assertEquals("1", result.get().getReturnValue());
  }
View Full Code Here

TOP

Related Classes of de.bamberg.ha.api.processing.ProcessingRouteChain

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.