Package org.mule.util.concurrent

Examples of org.mule.util.concurrent.Latch.await()


        // send asynchronously
        this.doSend("vm://event.multicaster", "Test Spring MuleEvent", NUMBER_OF_MESSAGES);

        whenFinished1.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        whenFinished2.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(NUMBER_OF_MESSAGES, eventCounter1.get());
        assertEquals(NUMBER_OF_MESSAGES, eventCounter2.get());
    }

    @Test
View Full Code Here


        bean2.setEventCallback(new CountingEventCallback(eventCounter1, NUMBER_OF_MESSAGES, whenFinished));

        // publish asynchronously
        this.doPublish(event, NUMBER_OF_MESSAGES);

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertEquals(NUMBER_OF_MESSAGES, eventCounter1.get());
    }

    @Test
    public void testPublishWithEventAwareTransformer() throws Exception
View Full Code Here

        bean2.setEventCallback(new CountingEventCallback(eventCounter1, 1, whenFinished));

        // publish asynchronously
        this.doPublish(event, 1);

        whenFinished.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS);
        assertTrue(transformerLatch.await(DEFAULT_LATCH_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(1, eventCounter1.get());
    }

    // asynchronously publish the given event to the ApplicationContext for 'count' number of times
View Full Code Here

                 + "  </soapenv:Body>"
                 + "</soapenv:Envelope>";

         String soapOperation = "EchoOperation1";
         MuleMessage response = executeSoap11Call(msgEchoOperation1, soapOperation);
         assertTrue(latch.await(1000L, TimeUnit.MILLISECONDS));
         String cxfOperationName = testCxfEventCallback.getCxfOperationName();
         assertEquals(soapOperation, cxfOperationName);
         assertTrue(response.getPayloadAsString().contains("<new:parameter1"));
         assertTrue(response.getPayloadAsString().contains("hello world"));
View Full Code Here

         assertTrue(response.getPayloadAsString().contains("<new:parameter1"));
         assertTrue(response.getPayloadAsString().contains("hello world"));

         soapOperation = "EchoOperation2";
         response = executeSoap11Call(msgEchoOperation2, soapOperation);
         assertTrue(latch.await(1000L, TimeUnit.MILLISECONDS));
         cxfOperationName = testCxfEventCallback.getCxfOperationName();
         assertEquals(soapOperation, cxfOperationName);
         assertTrue(response.getPayloadAsString().contains("<new:parameter2"));
         assertTrue(response.getPayloadAsString().contains("hello world"));
    }
View Full Code Here

                 + "  </soap:Body>"
                 + "</soap:Envelope>";

         String soapOperation = "EchoOperation1";
         MuleMessage response = executeSoap12Call(msgEchoOperation1, soapOperation);
         assertTrue(latch.await(1000, TimeUnit.MILLISECONDS));
         String cxfOperationName = testCxfEventCallback.getCxfOperationName();
         assertEquals(soapOperation, cxfOperationName);
         assertTrue(response.getPayloadAsString().contains("<new:parameter1"));
         assertTrue(response.getPayloadAsString().contains("hello world"));
View Full Code Here

         assertTrue(response.getPayloadAsString().contains("<new:parameter1"));
         assertTrue(response.getPayloadAsString().contains("hello world"));

         soapOperation = "EchoOperation2";
         response = executeSoap12Call(msgEchoOperation2, soapOperation);
         assertTrue(latch.await(1000, TimeUnit.MILLISECONDS));
         cxfOperationName = testCxfEventCallback.getCxfOperationName();
         assertEquals(soapOperation, cxfOperationName);
         assertTrue(response.getPayloadAsString().contains("<new:parameter2"));
         assertTrue(response.getPayloadAsString().contains("hello world"));
    }
View Full Code Here

        component.setMuleContext(muleContext);
        service.setComponent(component);
        muleContext.getRegistry().registerService(service);

        service.process(MuleTestUtils.getTestEvent("test", service, muleContext));
        assertTrue(latch.await(200, TimeUnit.MILLISECONDS));

        // This test will fail with RejectedExcecutionException if dispatch() blocks
    }

    /**
 
View Full Code Here

        muleContext.getRegistry().registerService(service);

        service.process(MuleTestUtils.getTestEvent("test",
            getTestInboundEndpoint(MessageExchangePattern.ONE_WAY), muleContext));

        assertTrue(latch.await(200, TimeUnit.MILLISECONDS));
    }

    /**
     * SEE MULE-3975
     */
 
View Full Code Here

        muleContext.getRegistry().registerService(service);

        service.process(MuleTestUtils.getTestEvent("test",
            getTestInboundEndpoint(MessageExchangePattern.ONE_WAY), muleContext));

        assertTrue(latch.await(200, TimeUnit.MILLISECONDS));
    }
}
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.