Example #1
0
  public void testRequestResponseComplex2() throws Exception {
    MuleClient client = new MuleClient();
    RemoteDispatcher dispatcher = client.getRemoteDispatcher("tcp://localhost:38100");
    try {
      String[] args = new String[] {"Betty", "Rubble"};
      UMOMessage result =
          dispatcher.sendRemote(
              "axis:http://localhost:38104/mule/services/mycomponent3?method=addPerson",
              args,
              null);
      assertNotNull(result);
      assertTrue(result.getPayload() instanceof Person);
      assertEquals("Betty", ((Person) result.getPayload()).getFirstName());
      assertEquals("Rubble", ((Person) result.getPayload()).getLastName());

      // do a receive
      result =
          client.send(
              "axis:http://localhost:38104/mule/services/mycomponent3?method=getPerson",
              "Betty",
              null);
      assertNotNull(result);
      assertTrue(result.getPayload() instanceof Person);
      assertEquals("Betty", ((Person) result.getPayload()).getFirstName());
      assertEquals("Rubble", ((Person) result.getPayload()).getLastName());
    } finally {
      client.dispose();
    }
  }
Example #2
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();
 }
Example #3
0
 public void testRequestResponse() throws Throwable {
   MuleClient client = new MuleClient();
   RemoteDispatcher dispatcher = client.getRemoteDispatcher("tcp://localhost:38100");
   try {
     UMOMessage result =
         dispatcher.sendRemote(
             "axis:http://localhost:38104/mule/services/mycomponent2?method=echo", "test", null);
     assertNotNull(result);
     assertEquals("test", result.getPayloadAsString());
   } finally {
     client.dispose();
   }
 }
Example #4
0
 public void testRequestResponseComplex() throws Exception {
   MuleClient client = new MuleClient();
   RemoteDispatcher dispatcher = client.getRemoteDispatcher("tcp://localhost:38100");
   try {
     UMOMessage result =
         dispatcher.sendRemote(
             "axis:http://localhost:38104/mule/services/mycomponent3?method=getPerson",
             "Fred",
             null);
     assertNotNull(result);
     System.out.println(result.getPayload());
     assertTrue(result.getPayload() instanceof Person);
     assertEquals("Fred", ((Person) result.getPayload()).getFirstName());
     assertEquals("Flintstone", ((Person) result.getPayload()).getLastName());
   } finally {
     client.dispose();
   }
 }
Example #5
0
 protected void doTearDown() throws Exception {
   super.doTearDown();
   client.dispose();
 }