예제 #1
0
 @Test
 public void testGetPathWithProperties() throws Exception {
   final FedoraEvent e =
       new FedoraEvent(
           new TestEvent(
               PROPERTY_CHANGED,
               "Path/Child",
               "UserId",
               "Identifier",
               ImmutableMap.of("1", "2"),
               "data",
               0L));
   assertEquals("Path", e.getPath());
 }
예제 #2
0
  @Test
  public void testToString() throws RepositoryException {
    final String text = e.toString();
    assertTrue("Should contain path: " + text, text.contains(e.getPath()));
    assertTrue("Should contain info: " + text, text.contains(e.getInfo().toString()));

    assertTrue(
        "Should contain types: " + text,
        text.contains(Integer.toString(e.getTypes().iterator().next())));
    assertTrue("Should contain date: " + text, text.contains(Long.toString(e.getDate())));

    assertFalse("Should not contain user-data: " + text, text.contains(e.getUserData()));
    assertFalse("Should not contain identifier: " + text, text.contains(e.getIdentifier()));
    assertFalse("Should not contain user-id: " + text, text.contains(e.getUserID()));
  }
예제 #3
0
 @Test
 public void testGetPath() throws Exception {
   assertEquals("Path/Child", e.getPath());
 }