@Test
public void shouldProvideStringForDate() throws Exception {

    Calendar date = Calendar.getInstance();
    date.set(2008, 7, 18, 12, 0, 0);
    date.set(Calendar.MILLISECOND, 0);
    String expectedValue = "2008-08-18T12:00:00.000";
    assertThat(new JcrValue(factories, PropertyType.DATE, date).getString().substring(0, expectedValue.length()),
               is(expectedValue));
    assertThat(new JcrValue(factories, PropertyType.DATE, date.getTime()).getString().substring(0, expectedValue.length()),
               is(expectedValue));
}