Package org.apache.qpid.disttest.client.property

Examples of org.apache.qpid.disttest.client.property.PropertyValue


        final TestCommand unmarshalledCommand = _jsonHandler.unmarshall(json, TestCommand.class);
        Map<String, PropertyValue> properties = unmarshalledCommand.getMessageProperties();
        assertNotNull("Properties should not be null", properties);
        assertFalse("Properties should not be empty", properties.isEmpty());
        assertEquals("Unexpected properties size", 2, properties.size());
        PropertyValue testProperty = properties.get("test");
        assertNotNull("Unexpected property test", testProperty);
        assertTrue("Unexpected property test", testProperty.getValue() instanceof Number);
        assertEquals("Unexpected property value", 1, ((Number)testProperty.getValue()).intValue());
        Object generatorObject = properties.get("generator");
        assertTrue("Unexpected generator object", generatorObject instanceof ListPropertyValue);
        PropertyValue generator = (PropertyValue)generatorObject;
        assertEquals("Unexpected generator value", "first", generator.getValue());
        for (int i = 0; i < 10; i++)
        {
            assertEquals("Unexpected generator value", new Integer(i), generator.getValue());
        }
        String newJson =_jsonHandler.marshall(unmarshalledCommand);
        final TestCommand newUnmarshalledCommand = _jsonHandler.unmarshall(newJson, TestCommand.class);
        assertEquals("Unmarshalled command should be equal to the original object", unmarshalledCommand, newUnmarshalledCommand);
    }
View Full Code Here


        final TestCommand unmarshalledCommand = _jsonHandler.unmarshall(json, TestCommand.class);
        Map<String, PropertyValue> properties = unmarshalledCommand.getMessageProperties();
        assertNotNull("Properties should not be null", properties);
        assertFalse("Properties should not be empty", properties.isEmpty());
        assertEquals("Unexpected properties size", 2, properties.size());
        PropertyValue testProperty = properties.get("test");
        assertNotNull("Unexpected property test", testProperty);
        assertTrue("Unexpected property test", testProperty.getValue() instanceof Number);
        assertEquals("Unexpected property value", 1, ((Number)testProperty.getValue()).intValue());
        Object generatorObject = properties.get("generator");
        assertTrue("Unexpected generator object", generatorObject instanceof ListPropertyValue);
        PropertyValue generator = (PropertyValue)generatorObject;
        assertEquals("Unexpected generator value", "first", generator.getValue());
        for (int i = 0; i < 10; i++)
        {
            assertEquals("Unexpected generator value", new Integer(i), generator.getValue());
        }
        String newJson =_jsonHandler.marshall(unmarshalledCommand);
        final TestCommand newUnmarshalledCommand = _jsonHandler.unmarshall(newJson, TestCommand.class);
        assertEquals("Unmarshalled command should be equal to the original object", unmarshalledCommand, newUnmarshalledCommand);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.client.property.PropertyValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.