use of edu.stanford.bmir.protege.web.shared.tag.TagId in project webprotege by protegeproject.
the class EntityTagsRepository_TestCase method setUp.
@Before
public void setUp() throws Exception {
Morphia morphia = createMorphia();
mongoClient = createMongoClient();
Datastore datastore = morphia.createDatastore(mongoClient, getTestDbName());
repository = new EntityTagsRepository(datastore);
repository.ensureIndexes();
entity = new OWLClassImpl(IRI.create("http://stuff.com/entities/A"));
tagIdA = TagId.getId("12345678-1234-1234-1234-123456789abc");
tagIdB = TagId.getId("12345678-5678-5678-5678-123456789abc");
projectId = ProjectId.get(UUID);
List<TagId> tags = Arrays.asList(tagIdA, tagIdB);
entityTags = new EntityTags(projectId, entity, tags);
}
use of edu.stanford.bmir.protege.web.shared.tag.TagId in project webprotege by protegeproject.
the class TagRepository_IT method shouldNotSaveTagWithDuplicateLabel.
@Test(expected = DuplicateKeyException.class)
public void shouldNotSaveTagWithDuplicateLabel() {
TagId otherTagId = TagId.getId("1234abcd-abcd-abcd-abcd-123456789abc");
Tag otherTag = new Tag(otherTagId, projectId, THE_TAG_LABEL, THE_TAG_DESCRIPTION, COLOR, BG_COLOR);
repository.saveTag(otherTag);
}
use of edu.stanford.bmir.protege.web.shared.tag.TagId in project webprotege by protegeproject.
the class EntityTagsRepository_TestCase method shouldAddTag.
@Test
public void shouldAddTag() {
repository.save(entityTags);
TagId theTagId = TagId.getId("12345678-abcd-abcd-abcd-123456789abc");
repository.addTag(projectId, entity, theTagId);
assertThat(repository.findByTagId(theTagId).size(), is(1));
}
Aggregations