@Test
public void testConvertJcrValue() throws Exception {

    ValueFactory vf = ValueFactoryImpl.getInstance();
    final String expectString = "hey I'm a string";
    assertEquals("expect equal string", expectString,
            DefaultSlingSimulator.convertJcrValue(vf.createValue(expectString)));
    final Calendar expectDate = Calendar.getInstance();
    assertEquals("expect equal date", expectDate,
            DefaultSlingSimulator.convertJcrValue(vf.createValue(expectDate)));
    final double expectDouble = 42.0D;
    assertEquals("expect equal double", expectDouble,
            (Double) DefaultSlingSimulator.convertJcrValue(vf.createValue(expectDouble)), 1.0D);
    final long expectLong = 404L;
    assertEquals("expect equal long", expectLong,
            DefaultSlingSimulator.convertJcrValue(vf.createValue(expectLong)));
    final Boolean expectBoolean = Boolean.TRUE;
    assertEquals("expect equal boolean", expectBoolean,
            DefaultSlingSimulator.convertJcrValue(vf.createValue(expectBoolean)));
    assertNull("expect null for name",
            DefaultSlingSimulator.convertJcrValue(vf.createValue("aName", PropertyType.NAME)));
}