Package org.apache.qpid.disttest.json

Examples of org.apache.qpid.disttest.json.JsonHandler


    @Override
    protected void setUp() throws Exception
    {
        super.setUp();

        _jsonHandler = new JsonHandler();

        _testCommand = new SendChristmasCards(CommandType.START_TEST, Collections.singletonMap(SendChristmasCards.CardType.FUNNY, 5));
        _testCommand.persons = Arrays.asList(new Person("Phil"), new Person("Andrew"));
    }
View Full Code Here


        Message jmsMessage = null;
        try
        {
            jmsMessage = session.createMessage();
            jmsMessage.setStringProperty(DistributedTestConstants.MSG_COMMAND_PROPERTY, command.getType().name());
            final JsonHandler jsonHandler = new JsonHandler();
            jmsMessage.setStringProperty(DistributedTestConstants.MSG_JSON_PROPERTY, jsonHandler.marshall(command));
        }
        catch (final JMSException jmse)
        {
            throw new DistributedTestException("Unable to convert command " + command + " to JMS Message", jmse);
        }
View Full Code Here

        Command command = null;
        try
        {
            final CommandType commandType = CommandType.valueOf(jmsMessage
                            .getStringProperty(DistributedTestConstants.MSG_COMMAND_PROPERTY));
            final JsonHandler jsonHandler = new JsonHandler();
            command = jsonHandler.unmarshall(jmsMessage.getStringProperty(DistributedTestConstants.MSG_JSON_PROPERTY),
                            getCommandClassFromType(commandType));
        }
        catch (final JMSException jmse)
        {
            throw new DistributedTestException("Unable to convert JMS message " + jmsMessage + " to command object",
View Full Code Here

    @Override
    protected void setUp() throws Exception
    {
        super.setUp();

        _jsonHandler = new JsonHandler();

        _testCommand = new SendChristmasCards(CommandType.START_TEST, Collections.singletonMap(SendChristmasCards.CardType.FUNNY, 5));
        _testCommand.persons = Arrays.asList(new Person("Phil"), new Person("Andrew"));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.json.JsonHandler

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.