Package er.rest.model

Examples of er.rest.model.Car


    public void testCustomIdKeyFormat() {
        EOEditingContext editingContext = ERXEC.newEditingContext(_osc);
        editingContext.lock();
        try {
            Car c = Car.cars().objectAtIndex(0);
            ERXRestFormat format = new ERXRestFormat("json", new ERXXmlRestParser(), new ERXXmlRestWriter(), new ERXRestFormatDelegate("CUSTOMID", "type", "nil", true, true, true, true, true));
            assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<car CUSTOMID=\"Cooper S\" type=\"car\">\n" + "  <name>Cooper S</name>\n" + "</car>\n", format.toString(c, ERXKeyFilter.filterWithAttributes(), new ERXRestContext(editingContext)));
        }
        finally {
            editingContext.unlock();
View Full Code Here


        Manufacturer m = Manufacturer.PORSCHE;
        assertEquals("{\"id\":\"Porsche\",\"type\":\"Manufacturer\",\"name\":\"Porsche\"}\n", ERXRestFormat.json().toString(m));
    }

    public void testNonEntityWithRelationship() {
        Car c = Car.cars().lastObject();
        assertEquals("{\"id\":\"Celica\",\"type\":\"Car\",\"name\":\"Celica\",\"manufacturer\":{\"id\":\"Toyota\",\"type\":\"Manufacturer\",\"name\":\"Toyota\"}}\n", ERXRestFormat.json().toString(c));
    }
View Full Code Here

TOP

Related Classes of er.rest.model.Car

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.