View Javadoc

1   /*
2    * $Id: RejectOldConfigTestCase.java 22414 2011-07-14 13:24:46Z dirk.olmes $
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.config.spring;
12  
13  import org.mule.api.MuleContext;
14  import org.mule.tck.junit4.FunctionalTestCase;
15  
16  import org.junit.Test;
17  
18  import static org.junit.Assert.assertTrue;
19  import static org.junit.Assert.fail;
20  
21  public class RejectOldConfigTestCase extends FunctionalTestCase
22  {
23  
24      @Override
25      protected String getConfigResources()
26      {
27          return "old-config.xml";
28      }
29  
30      @Test
31      public void testParse()
32      {
33          // see overloaded methods
34      }
35  
36      @Override
37      protected MuleContext createMuleContext() throws Exception
38      {
39          try {
40              super.createMuleContext();
41              fail("Context created with no problems - expected failure");
42          }
43          catch (Exception e)
44          {
45              String msg = e.getMessage();
46              assertTrue(msg, msg.indexOf("Unable to locate NamespaceHandler for namespace [null]") > -1);
47          }
48          return null;
49      }
50  
51  }