Пример #1
0
  @Test
  public void testAddType() {
    e.addType(PROPERTY_CHANGED);
    assertEquals(2, e.getTypes().size());

    assertTrue(
        "Should contain: " + PROPERTY_CHANGED, contains(e.getTypes().iterator(), PROPERTY_CHANGED));
    assertTrue("Should contain: 1", contains(e.getTypes().iterator(), 1));
  }
Пример #2
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());
 }
Пример #3
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()));
  }
Пример #4
0
  @Test
  public void testGetUserData() throws Exception {

    assertEquals("data", e.getUserData());
  }
Пример #5
0
  @Test
  public void testGetInfo() throws Exception {
    final Map<?, ?> m = e.getInfo();

    assertEquals("2", m.get("1"));
  }
Пример #6
0
  @Test
  public void testGetIdentifier() throws Exception {

    assertEquals("Identifier", e.getIdentifier());
  }
Пример #7
0
  @Test
  public void testGetUserID() {

    assertEquals("UserId", e.getUserID());
  }
Пример #8
0
 @Test
 public void testGetPath() throws Exception {
   assertEquals("Path/Child", e.getPath());
 }
Пример #9
0
 @Test
 public void testGetType() {
   assertEquals(singleton(1), e.getTypes());
 }
Пример #10
0
 @Test
 public void testAddProperty() {
   e.addProperty("prop");
   assertEquals(1, e.getProperties().size());
   assertEquals("prop", e.getProperties().iterator().next());
 }
Пример #11
0
 @Test
 public void testGetDate() throws Exception {
   assertEquals(0L, e.getDate());
 }