Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient.dispatch()


    {
        LocalMuleClient client = muleContext.getClient();
        FeedReceiver component = (FeedReceiver)getComponent("feedConsumer");
        component.getReceivedEntries().set(0); //reset since the build reports that it's getting incremented someplace else
        String feed = loadResourceAsString("sample-feed.atom");
        client.dispatch("jms://feed.split.in", feed, null);
        Thread.sleep(5000);
        assertEquals(25, component.getCount());
    }
}
View Full Code Here


            public void onNotification(ExceptionNotification notification)
            {
                latch.countDown();
            }
        });
        client.dispatch("vm://in","some message",null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
    }
View Full Code Here

            public void onNotification(ExceptionNotification notification)
            {
                latch.countDown();
            }
        });
        client.dispatch("jms://in?connector=activeMq","some message",null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
    }
View Full Code Here

            {
                deliveredTimes.increment();
                latch.countDown();
            }
        });
        client.dispatch("jms://in2?connector=activeMq", MESSAGE,null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
        assertThat(deliveredTimes.intValue(), is(EXPECTED_DELIVERED_TIMES));
View Full Code Here

          public void onNotification(ExceptionNotification notification)
          {
              latch.countDown();
          }
      });
      client.dispatch("vm://in5","some message",null);
      if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
      {
          fail("message should have been delivered at least 5 times");
      }
        MuleMessage result = client.send("vm://in5", MESSAGE, null, TIMEOUT);
View Full Code Here

            {
                deliveredTimes.increment();
                latch.countDown();
            }
        });
        client.dispatch("jms://in3?connector=activeMq", MESSAGE, null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
        assertThat(deliveredTimes.intValue(), is(EXPECTED_DELIVERED_TIMES));
View Full Code Here

            {
                deliveredTimes.increment();
                latch.countDown();
            }
        });
        client.dispatch("vm://in3","some message",null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
        assertThat(deliveredTimes.intValue(),is(EXPECTED_DELIVERED_TIMES));
View Full Code Here

            {
                deliveredTimes.increment();
                latch.countDown();
            }
        });
        client.dispatch("vm://in4","some message",null);
        if (!latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("message should have been delivered at least 5 times");
        }
        assertThat(deliveredTimes.intValue(),is(EXPECTED_DELIVERED_TIMES));
View Full Code Here

    @Test
    public void testRollbackExceptionStrategyCatchMessageRedeliveryDespiteChoiceConfiguration() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("vm://in7","some message",null);
        if (!CallMessageProcessor.latch.await(TIMEOUT, TimeUnit.MILLISECONDS))
        {
            fail("custom message processor wasn't call");
        }
    }
View Full Code Here

   
  @Test
  public void testCatchWithComponent() throws Exception
  {
      LocalMuleClient client = muleContext.getClient();
      client.dispatch("vm://in2","some message",null);
        MuleMessage result = client.send("vm://in2", MESSAGE, null, TIMEOUT);
        assertThat(result,IsNull.<Object>notNullValue());
        assertThat(result.getPayloadAsString(), Is.is(MESSAGE + " Caught"));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.