View Javadoc

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