Beispiel #1
0
 public void testDelegateClass() throws Exception {
   MuleClient client = new MuleClient();
   client.dispatch(INPUT_DC_QUEUE_NAME, "test", null);
   MuleMessage message = client.request(OUTPUT_DC_QUEUE_NAME, TIMEOUT);
   assertNotNull(message);
   assertEquals(message.getPayload(), DEFUALT_OUTPUT_MESSAGE);
   client.dispose();
 }
  @Test
  public void vmDemoTest() throws Exception {

    MuleClient client = new MuleClient(muleContext);

    final String content = "Hi_JeeConf";

    MuleMessage receivedMessage =
        client.send(
            "vm://process.message.outbound",
            "/ftp/myFile/Hi_JeeConf",
            new HashMap<String, Object>());

    Thread.sleep(5000);

    Assert.assertNotNull(receivedMessage);

    Assert.assertEquals(content, receivedMessage.getPayloadAsString());

    client.dispose();
  }