Search in sources :

Example 1 with FilterQuery

use of org.camunda.bpm.engine.filter.FilterQuery in project camunda-bpm-platform by camunda.

the class FilterQueryTest method testQueryByInvalidFilterId.

public void testQueryByInvalidFilterId() {
    FilterQuery query = filterService.createFilterQuery().filterId("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
    try {
        filterService.createFilterQuery().filterId(null);
        fail("Exception expected");
    } catch (ProcessEngineException e) {
    // expected
    }
}
Also used : FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 2 with FilterQuery

use of org.camunda.bpm.engine.filter.FilterQuery in project camunda-bpm-platform by camunda.

the class FilterQueryTest method testQueryByInvalidOwner.

public void testQueryByInvalidOwner() {
    FilterQuery query = filterService.createFilterQuery().filterOwner("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
    try {
        filterService.createFilterQuery().filterOwner(null);
        fail("Exception expected");
    } catch (ProcessEngineException e) {
    // expected
    }
}
Also used : FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 3 with FilterQuery

use of org.camunda.bpm.engine.filter.FilterQuery in project camunda-bpm-platform by camunda.

the class FilterQueryTest method testQueryNoCriteria.

public void testQueryNoCriteria() {
    FilterQuery query = filterService.createFilterQuery();
    assertEquals(4, query.count());
    assertEquals(4, query.list().size());
    try {
        query.singleResult();
        fail("Exception expected");
    } catch (ProcessEngineException e) {
    // expected
    }
}
Also used : FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 4 with FilterQuery

use of org.camunda.bpm.engine.filter.FilterQuery in project camunda-bpm-platform by camunda.

the class FilterQueryTest method testQueryByInvalidResourceType.

public void testQueryByInvalidResourceType() {
    FilterQuery query = filterService.createFilterQuery().filterResourceType("invalid");
    assertNull(query.singleResult());
    assertEquals(0, query.list().size());
    assertEquals(0, query.count());
    try {
        filterService.createFilterQuery().filterResourceType(null);
        fail("Exception expected");
    } catch (ProcessEngineException e) {
    // expected
    }
}
Also used : FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 5 with FilterQuery

use of org.camunda.bpm.engine.filter.FilterQuery in project camunda-bpm-platform by camunda.

the class FilterQueryTest method testQueryByResourceType.

public void testQueryByResourceType() {
    FilterQuery query = filterService.createFilterQuery().filterResourceType(EntityTypes.TASK);
    try {
        query.singleResult();
        fail("Exception expected");
    } catch (ProcessEngineException e) {
    // expected
    }
    assertEquals(4, query.list().size());
    assertEquals(4, query.count());
}
Also used : FilterQuery(org.camunda.bpm.engine.filter.FilterQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

FilterQuery (org.camunda.bpm.engine.filter.FilterQuery)15 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)6 Filter (org.camunda.bpm.engine.filter.Filter)3 ArrayList (java.util.ArrayList)2 FilterService (org.camunda.bpm.engine.FilterService)2 ProcessEngineConfiguration (org.camunda.bpm.engine.ProcessEngineConfiguration)1 TaskService (org.camunda.bpm.engine.TaskService)1 NullValueException (org.camunda.bpm.engine.exception.NullValueException)1 AuthorizationServiceImpl (org.camunda.bpm.engine.impl.AuthorizationServiceImpl)1 IdentityServiceImpl (org.camunda.bpm.engine.impl.IdentityServiceImpl)1 TaskQueryImpl (org.camunda.bpm.engine.impl.TaskQueryImpl)1 TaskEntity (org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)1 Query (org.camunda.bpm.engine.query.Query)1 FilterDto (org.camunda.bpm.engine.rest.dto.runtime.FilterDto)1 VariableInstanceQuery (org.camunda.bpm.engine.runtime.VariableInstanceQuery)1 TaskQuery (org.camunda.bpm.engine.task.TaskQuery)1 Before (org.junit.Before)1