Package org.mokai.action

Examples of org.mokai.action.JsonParserAction.execute()


    action.setField("body");

    Message message = new Message();
    message.setProperty("body", "{ \"number\": 2, \"boolean\": false, \"string\": \"this is a test\", \"double\": 2.23 }");

    action.execute(message);

    Assert.assertEquals(message.getProperty("number", int.class).intValue(), 2);
    Assert.assertEquals(message.getProperty("boolean", Boolean.class).booleanValue(), false);
    Assert.assertEquals(message.getProperty("string", String.class), "this is a test");
    Assert.assertEquals(message.getProperty("double", Double.class).doubleValue(), 2.23);
View Full Code Here


    action.setField("body");

    Message message = new Message();
    message.setProperty("body", "[ 2, 3, 4 ]");

    action.execute(message);

    message.setProperty("body", "{ \"numbers\": { \"one\": [1, 2, 3], \"two\": [2, 3, 4], \"three\": [3, 4, 5] } }");

    action.execute(message);
View Full Code Here

    action.execute(message);

    message.setProperty("body", "{ \"numbers\": { \"one\": [1, 2, 3], \"two\": [2, 3, 4], \"three\": [3, 4, 5] } }");

    action.execute(message);

    Assert.assertNotNull(message.getProperty("numbers"));
    Map<String,Object> numbers = message.getProperty("numbers", Map.class);
    List list = (List) numbers.get("one");
    Assert.assertNotNull(list);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.