Package er.extensions.eof

Examples of er.extensions.eof.ERXKeyFilter.include()


        message.put("priority", Integer.valueOf(10));
        response.put("message", message);

        ERXKeyFilter messageFilter = new ERXKeyFilter(ERXKeyFilter.Base.Attributes);
        messageFilter.setUnknownKeyIgnored(true);
        messageFilter.include("message.subject");
        messageFilter.include("message.message");
        messageFilter.include("message.priority");
        assertEquals("{\"message\":{\"subject\":\"this is a subject\",\"message\":\"this is a message\",\"priority\":10}}\n", ERXRestFormat.json().toString(response, messageFilter));
       
        response.remove("message");
View Full Code Here


        response.put("message", message);

        ERXKeyFilter messageFilter = new ERXKeyFilter(ERXKeyFilter.Base.Attributes);
        messageFilter.setUnknownKeyIgnored(true);
        messageFilter.include("message.subject");
        messageFilter.include("message.message");
        messageFilter.include("message.priority");
        assertEquals("{\"message\":{\"subject\":\"this is a subject\",\"message\":\"this is a message\",\"priority\":10}}\n", ERXRestFormat.json().toString(response, messageFilter));
       
        response.remove("message");
        assertEquals("{\"nil\":true}\n", ERXRestFormat.json().toString(response, messageFilter));
View Full Code Here

        ERXKeyFilter messageFilter = new ERXKeyFilter(ERXKeyFilter.Base.Attributes);
        messageFilter.setUnknownKeyIgnored(true);
        messageFilter.include("message.subject");
        messageFilter.include("message.message");
        messageFilter.include("message.priority");
        assertEquals("{\"message\":{\"subject\":\"this is a subject\",\"message\":\"this is a message\",\"priority\":10}}\n", ERXRestFormat.json().toString(response, messageFilter));
       
        response.remove("message");
        assertEquals("{\"nil\":true}\n", ERXRestFormat.json().toString(response, messageFilter));
    }
View Full Code Here

    }

    public void testRelationshipKeys() {
        Manufacturer m = Manufacturer.PORSCHE;
        ERXKeyFilter f = ERXKeyFilter.filterWithNone();
        f.include("cars.name");
        assertEquals("{\"id\":\"Porsche\",\"type\":\"Manufacturer\",\"cars\":[{\"id\":\"911\",\"type\":\"Car\",\"name\":\"911\"},{\"id\":\"Cayenne\",\"type\":\"Car\",\"name\":\"Cayenne\"}]}\n", ERXRestFormat.json().toString(m, f));
        assertEquals("{\n" +
            "\t\"type\" = \"Manufacturer\";\n" +
            "\t\"id\" = \"Porsche\";\n" +
            "\t\"cars\" = (\n" +
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.