View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transformer.simple;
8   
9   import org.mule.api.transformer.Transformer;
10  import org.mule.transformer.AbstractTransformerTestCase;
11  
12  import java.util.ArrayList;
13  import java.util.List;
14  
15  public class ObjectToStringWithCollectionTestCase extends AbstractTransformerTestCase
16  {
17      @Override
18      public Transformer getTransformer() throws Exception
19      {
20          return new ObjectToString();
21      }
22  
23      @Override
24      public Object getTestData()
25      {
26          List<String> list = new ArrayList<String>();
27          list.add("one");
28          list.add(null);
29          list.add("three");
30          return list;
31      }
32  
33      @Override
34      public Object getResultData()
35      {
36          return "[one, null, three]";
37      }
38  
39      @Override
40      public Transformer getRoundTripTransformer() throws Exception
41      {
42          // we do not want round trip transforming tested
43          return null;
44      }
45  }