Search in sources :

Example 26 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithSpecifiedTargetEntity.

@Test
public void shouldBuildIssueWithSpecifiedTargetEntity() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThat(issue.getTargetEntities(), hasItem(entity));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 27 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithAddedTargetEntityEvent.

@Test
public void shouldBuildIssueWithAddedTargetEntityEvent() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThat(issue.getEvents(), hasItem(new IssueTargetAdded(userId, TIMESTAMP, entity)));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 28 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithRemovedTargetEntityEvent.

@Test
public void shouldBuildIssueWithRemovedTargetEntityEvent() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP);
    builder.removeTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThat(issue.getEvents(), hasItem(new IssueTargetRemoved(userId, TIMESTAMP, entity)));
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 29 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithUpdatedTimestampOnAddTargetEntity.

@Test
public void shouldBuildIssueWithUpdatedTimestampOnAddTargetEntity() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThatIssueUpdatedTimestampWasUpdated(issue);
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Example 30 with OWLEntity

use of org.semanticweb.owlapi.model.OWLEntity in project webprotege by protegeproject.

the class IssueBuilder_TestCase method shouldBuildIssueWithUpdatedTimestampOnRemoveTargetEntity.

@Test
public void shouldBuildIssueWithUpdatedTimestampOnRemoveTargetEntity() {
    OWLEntity entity = mock(OWLEntity.class);
    builder.addTargetEntity(entity, userId, TIMESTAMP - 5);
    builder.removeTargetEntity(entity, userId, TIMESTAMP);
    Issue issue = builder.build(mentionParser);
    assertThatIssueUpdatedTimestampWasUpdated(issue);
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) Test(org.junit.Test)

Aggregations

OWLEntity (org.semanticweb.owlapi.model.OWLEntity)45 Test (org.junit.Test)13 OWLOntologyChange (org.semanticweb.owlapi.model.OWLOntologyChange)7 OWLEntityData (edu.stanford.bmir.protege.web.shared.entity.OWLEntityData)6 ArrayList (java.util.ArrayList)6 Nonnull (javax.annotation.Nonnull)6 Inject (javax.inject.Inject)6 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)5 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)4 AccessManager (edu.stanford.bmir.protege.web.server.access.AccessManager)3 IRI (org.semanticweb.owlapi.model.IRI)3 DBObject (com.mongodb.DBObject)2 EntitySuggestion (edu.stanford.bmir.protege.web.client.library.suggest.EntitySuggestion)2 AbstractProjectActionHandler (edu.stanford.bmir.protege.web.server.dispatch.AbstractProjectActionHandler)2 ExecutionContext (edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext)2 VIEW_PROJECT (edu.stanford.bmir.protege.web.shared.access.BuiltInAction.VIEW_PROJECT)2 ColumnType (edu.stanford.bmir.protege.web.shared.csv.ColumnType)2 OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)2 ProjectEvent (edu.stanford.bmir.protege.web.shared.event.ProjectEvent)2 Comparator.comparing (java.util.Comparator.comparing)2