Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * $Id: JsonBeanRoundTripNonAsciiTestCase.java 19858 2010-10-07 00:49:12Z dzapata $
  * --------------------------------------------------------------------------------------
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
  *
  * The software in this package is published under the terms of the CPAL v1.0
  * license, a copy of which has been included with this distribution in the
  * LICENSE.txt file.
  */
package org.mule.module.json.transformers;
    private static final String ENCODING = "Windows-31J";
    private final String jsonString;
    private final FruitCollection jsonObject;
    {
    	 = "{\"apple\":{\"washed\":false,\"bitten\":true},\"orange\":{\"brand\":\""
            +  getBrandOfOrange(.)
            + "\",\"segments\":8,\"radius\":3.45,\"listProperties\":null,\"mapProperties\":null,\"arrayProperties\":null}}";
    	
         = new FruitCollection(new Apple(true), nullnew Orange(8, new Double(3.45), getBrandOfOrange(.)));
    }
   
    @Override
    public Transformer getRoundTripTransformer() throws Exception
    {
        Transformer trans = super.getRoundTripTransformer();
        EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test");
        builder.setEncoding();
            builder);
        trans.setEndpoint(endpoint);
        return trans;
    }
    @Override
    public Transformer getTransformer() throws Exception
    {
        Transformer trans = super.getTransformer();
        trans.setReturnDataType(new SimpleDataType<byte[]>(byte[].class));
        EndpointBuilder builder = new EndpointURIEndpointBuilder("test://test");
        builder.setEncoding();
            builder);
        trans.setEndpoint(endpoint);
        return trans;
    }
    
    @Override
    public Object getTestData()
    {
        return ;
    }
    @Override
    public Object getResultData()
    {
        try
        {
            return .getBytes();
        }
        catch (UnsupportedEncodingException e)
        {
            fail();
            return null;
        }
    }
    private String getBrandOfOrange(Locale locale)
    {
        return LocaleMessageHandler.getString("test-data"locale"JsonBeanRoundTripNonAsciiTestCase.getBrandOfOrange"new Object[] {});
    }
New to GrepCode? Check out our FAQ X