View Javadoc

1   /*
2    * $Id: BadTransformationContentTypeTestCase.java 20297 2010-11-22 18:49:18Z aperepel $
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.transformers.simple;
12  
13  import org.mule.api.transformer.Transformer;
14  import org.mule.tck.FunctionalTestCase;
15  
16  public class BadTransformationContentTypeTestCase extends FunctionalTestCase
17  {
18  
19  
20      public BadTransformationContentTypeTestCase()
21      {
22          setStartContext(false);
23      }
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "bad-content-type-setting-transformer-configs.xml";
29      }
30  
31      public void testReturnType() throws Exception
32      {
33          try
34          {
35              muleContext.start();
36              Transformer trans = muleContext.getRegistry().lookupTransformer("testTransformer");
37              fail("config should fail with bad content type");
38          }
39          catch (Exception ex)
40          {
41              System.err.println("Caught " + ex.getClass() + " (as expected)");
42          }
43  
44      }
45  }