View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule;
8   
9   import org.mule.api.ThreadSafeAccess;
10  
11  import java.util.Map;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertTrue;
16  
17  public class ThreadSafeAccessTestCase extends AbstractThreadSafeAccessTestCase
18  {
19      @Test
20      public void testConfig()
21      {
22          assertTrue(ThreadSafeAccess.AccessControl.isFailOnMessageScribbling());
23          assertTrue(ThreadSafeAccess.AccessControl.isAssertMessageAccess());
24      }
25  
26      @Test
27      public void testMessage() throws InterruptedException
28      {
29          Map<String, Object> nullMap = null;
30          basicPattern(new DefaultMuleMessage(new Object(), nullMap, muleContext));
31          newCopy(new DefaultMuleMessage(new Object(), nullMap, muleContext));
32          resetAccessControl(new DefaultMuleMessage(new Object(), nullMap, muleContext));
33      }
34  
35      @Test
36      public void testEvent() throws Exception
37      {
38          basicPattern(dummyEvent());
39          newCopy(dummyEvent());
40          resetAccessControl(dummyEvent());
41      }
42  }