Package org.exoplatform.ws.frameworks.json

Examples of org.exoplatform.ws.frameworks.json.BeanWithBookEnum


      assertTrue(tmp.contains(StringEnum.TREE.name()));
   }

   public void testBeanEnumObject() throws Exception
   {
      BeanWithBookEnum be = new BeanWithBookEnum();
      be.setBook(BookEnum.JUNIT_IN_ACTION);
      JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(be);
      //System.out.println(jsonValue);
      assertEquals(BookEnum.JUNIT_IN_ACTION.name(), jsonValue.getElement("book").getStringValue());
   }
View Full Code Here


      JsonParser jsonParser = new JsonParserImpl();
      JsonDefaultHandler handler = new JsonDefaultHandler();
      jsonParser.parse(new ByteArrayInputStream(source.getBytes()), handler);
      JsonValue jsonValue = handler.getJsonObject();
      //System.out.println(jsonValue);
      BeanWithBookEnum o = ObjectBuilder.createObject(BeanWithBookEnum.class, jsonValue);
      assertEquals(BookEnum.BEGINNING_C, o.getBook());
   }
View Full Code Here

      assertTrue(tmp.contains(StringEnum.TREE.name()));
   }

   public void testBeanEnumObject() throws Exception
   {
      BeanWithBookEnum be = new BeanWithBookEnum();
      be.setBook(BookEnum.JUNIT_IN_ACTION);
      JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(be);
      assertEquals(BookEnum.JUNIT_IN_ACTION.name(), jsonValue.getElement("book").getStringValue());
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.ws.frameworks.json.BeanWithBookEnum

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.