View Javadoc

1   /*
2    * $Id: ObjectToStringWithCollectionTestCase.java 20378 2010-11-29 14:04:47Z 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.transformer.simple;
12  
13  import org.mule.api.transformer.Transformer;
14  import org.mule.transformer.AbstractTransformerTestCase;
15  
16  import java.util.ArrayList;
17  import java.util.List;
18  
19  public class ObjectToStringWithCollectionTestCase extends AbstractTransformerTestCase
20  {
21      @Override
22      public Transformer getTransformer() throws Exception
23      {
24          return new ObjectToString();
25      }
26  
27      @Override
28      public Object getTestData()
29      {
30          List<String> list = new ArrayList<String>();
31          list.add("one");
32          list.add(null);
33          list.add("three");
34          return list;
35      }
36  
37      @Override
38      public Object getResultData()
39      {
40          return "[one, null, three]";
41      }
42  
43      @Override
44      public Transformer getRoundTripTransformer() throws Exception
45      {
46          // we do not want round trip transforming tested
47          return null;
48      }
49  }