예제 #1
0
 @Test
 public void testLastModificationTime() throws Exception {
   DateFormat format = WikiPageProperty.getTimeFormat();
   WikiPageProperties props = new WikiPageProperties();
   assertEquals(
       format.format(Clock.currentDate()), format.format(props.getLastModificationTime()));
   Date date = format.parse("20040101000001");
   props.setLastModificationTime(date);
   assertEquals("20040101000001", props.get(PageData.PropertyLAST_MODIFIED));
   assertEquals(date, props.getLastModificationTime());
 }
예제 #2
0
  private void validateLoading() throws Exception {
    assertTrue(properties.has("Edit"));
    assertTrue(properties.has("Test"));
    assertFalse(properties.has("Suite"));
    assertEquals("http://someurl", properties.get("VirtualWiki"));

    WikiPageProperty parentOne = properties.getProperty("ParentOne");
    assertEquals(null, parentOne.getValue());
    assertEquals("child one value", parentOne.get("ChildOne"));

    WikiPageProperty parentTwo = properties.getProperty("ParentTwo");
    assertEquals("parent 2 value", parentTwo.getValue());
    assertEquals("child two value", parentTwo.get("ChildTwo"));

    WikiPageProperty symbolics = properties.getProperty("SymbolicLinks");
    assertEquals("<BackWard.SymLink", symbolics.get("BackLink"));
    assertEquals("RelaTive.SymLink", symbolics.get("RelLink"));
    assertEquals(".AbsoLute.SymLink", symbolics.get("AbsLink"));
    assertEquals(">SubChild.SymLink", symbolics.get("SubLink"));
  }