View Javadoc

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