Exemplo n.º 1
0
 @Test
 public void testRemoveMark() {
   for (final Identity ident : identities) {
     marking.setMark(ores, ident, subPath1, "");
   }
   marking.removeMark(ores, ident1, subPath1);
   final boolean markedAfterRemove = marking.isMarked(ores, ident1, subPath1);
   assertEquals(markedAfterRemove, false);
   final boolean marked = marking.isMarked(ores, ident2, subPath1);
   assertTrue(marked);
 }
Exemplo n.º 2
0
 @Test
 public void testSetMark() {
   for (final Identity ident : identities) {
     final Mark mark = marking.setMark(ores, ident, subPath1, "");
     assertEquals(ident, mark.getCreator());
     assertEquals(subPath1, mark.getResSubPath());
     assertEquals(
         ores.getResourceableTypeName(), mark.getOLATResourceable().getResourceableTypeName());
     assertEquals(ores.getResourceableId(), mark.getOLATResourceable().getResourceableId());
     final boolean marked = marking.isMarked(ores, ident, subPath1);
     assertTrue(marked);
   }
 }
Exemplo n.º 3
0
  @Test
  public void testRemoveResource() {
    for (final Identity ident : identities) {
      for (final String subPath : subPaths) {
        marking.setMark(ores, ident, subPath, "");
      }
    }

    marking.deleteMark(ores);

    boolean marked = false;
    for (final Identity ident : identities) {
      for (final String subPath : subPaths) {
        marked |= marking.isMarked(ores, ident, subPath);
      }
    }
    assertFalse(marked);
  }