Package org.apache.shindig.social.core.util

Examples of org.apache.shindig.social.core.util.JsonObjectToMapMorpher.morph()


  public void testMorph() {
    ObjectMorpher om = new JsonObjectToMapMorpher();
    JSONObject testObj = new JSONObject();
    testObj.put("x", "y");
    testObj.put("1", "z");
    Object o = om.morph(testObj);
    assertNotSame(testObj, o);
    if (o instanceof Map) {
      Map<?, ?> fm = (Map<?, ?>) o;
      assertEquals("y", fm.get("x"));
      assertEquals("z", fm.get("1"));
View Full Code Here


      assertEquals("y", fm.get("x"));
      assertEquals("z", fm.get("1"));
      assertNull(fm.get("xyz"));
    }
    try {
      om.morph(o);
      fail();
    } catch (ClassCastException cce) {
      assertTrue(true);
    }
  }
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.