Cron9000 / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

minTemp is conveted in to mINTemp #493

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
This is the test case of mine

 String definition = "{" +
                "  'name':'org.wso2.esb.MediatorStatistics'," +
                "  'version':'2.3.0'," +
                "  'nickName': 'Stock Quote Information'," +
                "  'description': 'Some Desc'," +
                "  'tags':['foo', 'bar']," +
                "  'metaData':[" +
                "          {'name':'ipAdd','type':'STRING'}" +
                "  ]," +
                "  'payloadData':[" +
                "          {'name':'symbol','type':'string'}," +
                "          {'name':'price','type':'double'}," +
                "          {'name':'volume','type':'int'}," +
                "          {'name':'maxTemp','type':'double'}," +
                "          {'name':'minTemp','type':'double'}" +
                "  ]" +
                "}";

        StreamDefinition streamDefinition1 = EventDefinitionConverterUtils.convertFromJson(definition);
        Assert.assertTrue(null != streamDefinition1.getStreamId());
//        System.out.println(gson.toJson(streamDefinition1));

        StreamDefinition streamDefinition2 =
                new StreamDefinition("org.wso2.esb.MediatorStatistics", "2.3.0");
        List<Attribute> meta = new ArrayList<Attribute>(1);
        meta.add(new Attribute("ipAdd", AttributeType.STRING));
        streamDefinition2.setMetaData(meta);
        List<Attribute> payload = new ArrayList<Attribute>(5);
        payload.add(new Attribute("symbol", AttributeType.STRING));
        payload.add(new Attribute("price", AttributeType.DOUBLE));
        payload.add(new Attribute("volume", AttributeType.INT));
        payload.add(new Attribute("maxTemp", AttributeType.DOUBLE));
        payload.add(new Attribute("minTemp", AttributeType.DOUBLE));
        streamDefinition2.setPayloadData(payload);

        Assert.assertEquals(streamDefinition1, streamDefinition2);

What is the expected output? What do you see instead?

junit.framework.AssertionFailedError: 
Expected 
:StreamDefinition{streamId='org.wso2.esb.MediatorStatistics-2.3.0-a832ccaa-7379-
4e37-81c8-3c7046a54a58', name='org.wso2.esb.MediatorStatistics', 
version='2.3.0', nickName='Stock Quote Information', description='Some Desc', 
tags=[foo, bar], metaData=[Attribute{name='ipAdd', type=STRING}], 
correlationData=null, payloadData=[Attribute{name='symbol', type=STRING}, 
Attribute{name='price', type=DOUBLE}, Attribute{name='volume', type=INT}, 
Attribute{name='maxTemp', type=DOUBLE}, Attribute{name='mINTemp', type=DOUBLE}]}
Actual   
:StreamDefinition{streamId='org.wso2.esb.MediatorStatistics-2.3.0-7415cfec-7821-
4c8b-85dc-81ac40fdd1e8', name='org.wso2.esb.MediatorStatistics', 
version='2.3.0', nickName='null', description='null', tags=null, 
metaData=[Attribute{name='ipAdd', type=STRING}], correlationData=null, 
payloadData=[Attribute{name='symbol', type=STRING}, Attribute{name='price', 
type=DOUBLE}, Attribute{name='volume', type=INT}, Attribute{name='maxTemp', 
type=DOUBLE}, Attribute{name='minTemp', type=DOUBLE}]}

What version of the product are you using? On what operating system?
i tryed with 2.1 & 2.2.2
Using Ubuntu 12.04 java 1.6 

Original issue reported on code.google.com by s...@wso2.com on 5 Jan 2013 at 6:14

GoogleCodeExporter commented 9 years ago
Sorry this is a user bug 
sorry for the inconvenience.

Original comment by s...@wso2.com on 5 Jan 2013 at 6:16

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 4 Feb 2013 at 3:57