Search in sources :

Example 1 with EntityLookupRequest

use of edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest in project webprotege by protegeproject.

the class EntityLookupRequestTestCase method getSearchedEntityTypesReturnsCopy.

@Test
public void getSearchedEntityTypesReturnsCopy() {
    Set<EntityType<?>> types = new HashSet<EntityType<?>>();
    types.add(EntityType.CLASS);
    EntityLookupRequest request = new EntityLookupRequest("Test", SearchType.SUB_STRING_MATCH_IGNORE_CASE, 20, types);
    request.getSearchedEntityTypes().add(EntityType.OBJECT_PROPERTY);
    assertEquals(types, request.getSearchedEntityTypes());
}
Also used : EntityType(org.semanticweb.owlapi.model.EntityType) EntityLookupRequest(edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 2 with EntityLookupRequest

use of edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest in project webprotege by protegeproject.

the class EntityLookupRequestTestCase method getSearchTypeReturnsSuppliedType.

@Test
public void getSearchTypeReturnsSuppliedType() {
    EntityLookupRequest request = new EntityLookupRequest("Test", SearchType.SUB_STRING_MATCH_IGNORE_CASE, 5, Arrays.asList(EntityType.CLASS));
    assertEquals(SearchType.SUB_STRING_MATCH_IGNORE_CASE, request.getSearchType());
}
Also used : EntityLookupRequest(edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest) Test(org.junit.Test)

Example 3 with EntityLookupRequest

use of edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest in project webprotege by protegeproject.

the class EntityLookupRequestTestCase method equalArgsGiveEqualRequests.

@Test
public void equalArgsGiveEqualRequests() {
    EntityLookupRequest requestA = new EntityLookupRequest("Test", SearchType.SUB_STRING_MATCH_IGNORE_CASE, 5, Arrays.asList(EntityType.CLASS));
    EntityLookupRequest requestB = new EntityLookupRequest("Test", SearchType.SUB_STRING_MATCH_IGNORE_CASE, 5, Arrays.asList(EntityType.CLASS));
    assertEquals(requestA.hashCode(), requestB.hashCode());
    assertEquals(requestA, requestB);
}
Also used : EntityLookupRequest(edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest) Test(org.junit.Test)

Example 4 with EntityLookupRequest

use of edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest in project webprotege by protegeproject.

the class EntityLookupRequestTestCase method defaultSearchTypeIsTheSameAsSearchTypeDefault.

@Test
public void defaultSearchTypeIsTheSameAsSearchTypeDefault() {
    EntityLookupRequest request = new EntityLookupRequest("Test");
    assertEquals(SearchType.getDefault(), request.getSearchType());
}
Also used : EntityLookupRequest(edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest) Test(org.junit.Test)

Example 5 with EntityLookupRequest

use of edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest in project webprotege by protegeproject.

the class EntityLookupRequestTestCase method getSearchStringReturnsSuppliedString.

@Test
public void getSearchStringReturnsSuppliedString() {
    EntityLookupRequest request = new EntityLookupRequest("Test");
    assertEquals("Test", request.getSearchString());
}
Also used : EntityLookupRequest(edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest) Test(org.junit.Test)

Aggregations

EntityLookupRequest (edu.stanford.bmir.protege.web.shared.entity.EntityLookupRequest)8 Test (org.junit.Test)7 HashSet (java.util.HashSet)2 EntityType (org.semanticweb.owlapi.model.EntityType)2