@Test
public void testJsonRead()
{
String jsonData = "{\"firstName\": \"George\", \"lastName\": \"Gastaldi\"}";
JsonParser parser = Json.createParser(new StringReader(jsonData));
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.START_OBJECT, parser.next());
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.KEY_NAME, parser.next());
Assert.assertEquals("firstName", parser.getString());
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.VALUE_STRING, parser.next());
Assert.assertEquals("George", parser.getString());
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.KEY_NAME, parser.next());
Assert.assertEquals("lastName", parser.getString());
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.VALUE_STRING, parser.next());
Assert.assertEquals("Gastaldi", parser.getString());
Assert.assertTrue(parser.hasNext());
Assert.assertEquals(Event.END_OBJECT, parser.next());
Assert.assertFalse(parser.hasNext());
}