Search in sources :

Example 56 with PrivilegedEvent

use of org.mule.runtime.core.privileged.event.PrivilegedEvent in project mule by mulesoft.

the class RequestContextTestCase method runThread.

protected void runThread(CoreEvent event, boolean doTest) throws InterruptedException {
    AtomicBoolean success = new AtomicBoolean(false);
    Thread thread = new Thread(new SetExceptionPayload((PrivilegedEvent) event, success));
    thread.start();
    thread.join();
    if (doTest) {
        // Since events are now immutable, there should be no failures due to this!
        assertEquals(true, success.get());
    }
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) PrivilegedEvent(org.mule.runtime.core.privileged.event.PrivilegedEvent)

Aggregations

PrivilegedEvent (org.mule.runtime.core.privileged.event.PrivilegedEvent)56 Test (org.junit.Test)35 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)22 DataType (org.mule.runtime.api.metadata.DataType)17 Message (org.mule.runtime.api.message.Message)15 CompiledExpression (org.mule.mvel2.compiler.CompiledExpression)13 ParserContext (org.mule.mvel2.ParserContext)10 InternalMessage (org.mule.runtime.core.internal.message.InternalMessage)9 MuleException (org.mule.runtime.api.exception.MuleException)7 UTF_16 (java.nio.charset.StandardCharsets.UTF_16)6 CoreMatchers.equalTo (org.hamcrest.CoreMatchers.equalTo)6 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)6 TypedValue (org.mule.runtime.api.metadata.TypedValue)6 Processor (org.mule.runtime.core.api.processor.Processor)6 Serializable (java.io.Serializable)5 HashMap (java.util.HashMap)5 Message.of (org.mule.runtime.api.message.Message.of)5 IOException (java.io.IOException)4 BigDecimal (java.math.BigDecimal)4 BigInteger (java.math.BigInteger)4