Package org.jboss.soa.esb.message

Examples of org.jboss.soa.esb.message.Message


        test_splitIds(aggregator3, "splitId1", "splitId1");

    }

    private void test_splitIds(Aggregator aggregator, String splitId1, String splitId2) throws ActionProcessingException {
        Message messageIn = MessageFactory.getInstance().getMessage();
        AggregationDetails aggrDetails;
        List<String> aggrTags = new ArrayList<String>();

        aggrDetails = new AggregationDetails("xx", 1, 2, 123123);
        aggrDetails.setSplitId(splitId1);
View Full Code Here


 
  @Test
  public void getExecutionContextAttributes() throws ConfigurationException, ActionProcessingException
  {
    SmooksAction action = new SmooksAction( config );
    Message message = MessageFactory.getInstance().getMessage();
    message.getBody().add( expectedString );
   
    Message process = action.process( message );
   
    Object object = process.getBody().get( SmooksAction.EXECUTION_CONTEXT_ATTR_MAP_KEY );
    assertTrue( object instanceof Map );
  }
View Full Code Here

       
        return properties;
    }

    private Message createNewMessage(String fromType, String from, String to, String toType) {
        Message message;
        message = MessageFactory.getInstance().getMessage();

        message.getProperties().setProperty(SmooksTransformer.FROM_TYPE, fromType);
        message.getProperties().setProperty(SmooksTransformer.FROM, from);
        message.getProperties().setProperty(SmooksTransformer.TO_TYPE, toType);
        message.getProperties().setProperty(SmooksTransformer.TO, to);

        return message;
    }
View Full Code Here

      if (args.length < 3)
      {
        System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
      }
     
      Message esbMessage = MessageFactory.getInstance().getMessage();

      esbMessage.getBody().add(args[2]);
     
        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
     
    }
View Full Code Here

{
  @Test
  public void process()
  {
    StreamToSourceResult action = new StreamToSourceResult();
    Message message = MessageFactory.getInstance().getMessage();
    ByteArrayInputStream inputStream = new ByteArrayInputStream( "testing".getBytes() );
    message.getBody().add( inputStream );
    message = action.process( message );
   
    Object object = message.getBody().get();
    assertTrue( object instanceof SourceResult );
   
  }
View Full Code Here

    FileEpr epr = getEpr(url);
    epr.setInputSuffix(".esbMessage");
    epr.setPostDelete(true);
    TwoWayCourier courier = CourierFactory.getPickupCourier(epr);

    Message message = null;
    while (null != (message = courier.pickup(100)))
      System.out.println(message.getHeader().getCall().getMessageID());
  }
View Full Code Here

  private final void deliver (String url) throws Exception
  {
    Call call = new Call(getEpr(url));
    call.setMessageID(new URI(UUID.randomUUID().toString()));

    Message message = MessageFactory.getInstance().getMessage();
    message.getHeader().setCall(call);
    message.getBody().add("Hello World".getBytes());
    Courier courier = CourierFactory.getCourier(call.getTo());

    courier.deliver(message);
  }
View Full Code Here

        esbConfig.resetESBProperties();
    }

    public void test_String2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(new String(personXmlBytes));
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }

    public void test_bytes2String() throws MessageDeliverException, RegistryException, FaultMessageException {
        ServiceInvoker invoker = new ServiceInvoker("Transform", "String");
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(personXmlBytes);
        message = invoker.deliverSync(message, 30000);

        assertEquals("<someone called=\"Tom Fennelly\" is=\"21\">", message.getBody().get());
    }
View Full Code Here

  private ArrayList<String> messagePathList;

  @Test
  public void processDiscount() throws ObjectMappingException, ConfigurationException, RegistryException, MessageRouterException, ActionProcessingException
  {
    Message message = createMessageWithOrder( order );
        ConfigTree configTree = new CBRConfigTreeBuilder( true ).ruleFile( "JBossESBPricingRulesStateful.drl" ).messagePaths(messagePathList).build();
    BusinessRulesProcessor processor = new BusinessRulesProcessor( configTree );

    processor.process( message );

        assertEquals( 20.0, order.getDiscount(), 0);
        assertEquals( "20%" ,message.getBody().get("DiscountObject"));
  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.message.Message

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.