View Javadoc

1   /*
2    * $Id: PropertyEditorTextToValueTransformerTestCase.java 20355 2010-11-26 11:42:30Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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.transformer.simple;
12  
13  import org.mule.api.transformer.Transformer;
14  import org.mule.transformer.AbstractTransformerTestCase;
15  
16  import java.beans.PropertyEditor;
17  
18  public class PropertyEditorTextToValueTransformerTestCase extends AbstractTransformerTestCase
19  {
20  
21      @Override
22      public Object getResultData()
23      {
24          return new Boolean(true);
25      }
26  
27      @Override
28      public Transformer getRoundTripTransformer() throws Exception
29      {
30          return new PropertyEditorValueToTextTransformer((PropertyEditor) Class.forName("sun.beans.editors.BoolEditor").newInstance(), Boolean.class);
31      }
32  
33      @Override
34      public Object getTestData()
35      {
36          return "True";
37      }
38  
39      @Override
40      public Transformer getTransformer() throws Exception
41      {
42          return new PropertyEditorTextToValueTransformer((PropertyEditor) Class.forName("sun.beans.editors.BoolEditor").newInstance(), Boolean.class);
43      }
44  
45  }