Package com.robustaweb.library.rest.representation

Examples of com.robustaweb.library.rest.representation.Representation


        assertFalse(house.getId().equals(formerId) );
    }

    @Test
    public void testGetRepresentation() throws Exception {
        Representation representation = house.getRepresentation();
        assertTrue(representation != null);
        assertTrue(representation.get("id").equals(house.getId()));


        representation = johnDoe.getRepresentation();
        assertTrue(representation != null);
        assertTrue(representation.get("id").equals(johnDoe.getId().toString()));
        assertTrue(representation.getNumber("id") == johnDoe.getId());

    }
View Full Code Here


        String errorMessage = "getting " + resId
            + " for representation " + rp.getClass().getName()
            + " instead of " + expectedId;
        assertEquals(errorMessage, expectedId, resId);

        Representation clone = rp.copy();
        clone.set("float", "12.2");
        float expected = 12.2f;
        float result = clone.getNumber("float", asFloat);
        errorMessage = "getting " + result + " for representation "
            + clone.getClass().getName() + " instead of "
            + expected;
        assertTrue(errorMessage, expected == result);// no epsilon test
                                // here
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.robustaweb.library.rest.representation.Representation

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.