Examples of FilterQuery


Examples of org.camunda.bpm.engine.filter.FilterQuery

      // expected
    }
  }

  public void testQueryPaging() {
    FilterQuery query = filterService.createFilterQuery();

    assertEquals(4, query.listPage(0, Integer.MAX_VALUE).size());

    // Verifying the un-paged results
    assertEquals(4, query.count());
    assertEquals(4, query.list().size());

    // Verifying paged results
    assertEquals(2, query.listPage(0, 2).size());
    assertEquals(2, query.listPage(2, 2).size());
    assertEquals(1, query.listPage(3, 1).size());

    // Verifying odd usages
    assertEquals(0, query.listPage(-1, -1).size());
    assertEquals(0, query.listPage(4, 2).size()); // 4 is the last index with a result
    assertEquals(4, query.listPage(0, 15).size()); // there are only 4 tasks
  }
View Full Code Here

Examples of org.camunda.bpm.engine.filter.FilterQuery

    return new FilterResourceImpl(getProcessEngine().getName(), getObjectMapper(), filterId, relativeRootResourcePath);
  }

  public List<FilterDto> getFilters(UriInfo uriInfo, Boolean itemCount, Integer firstResult, Integer maxResults) {
    FilterService filterService = getProcessEngine().getFilterService();
    FilterQuery query = getQueryFromQueryParameters(uriInfo.getQueryParameters());

    List<Filter> matchingFilters = executeFilterQuery(query, firstResult, maxResults);

    List<FilterDto> filters = new ArrayList<FilterDto>();
    for (Filter filter : matchingFilters) {
View Full Code Here

Examples of org.camunda.bpm.engine.filter.FilterQuery

    }
    return query.listPage(firstResult, maxResults);
  }

  public CountResultDto getFiltersCount(UriInfo uriInfo) {
    FilterQuery query = getQueryFromQueryParameters(uriInfo.getQueryParameters());
    return new CountResultDto(query.count());
  }
View Full Code Here

Examples of org.camunda.bpm.engine.filter.FilterQuery

  }

  public static FilterQuery createMockFilterQuery() {
    List<Filter> mockFilters = createMockFilters();

    FilterQuery query = mock(FilterQuery.class);

    when(query.list()).thenReturn(mockFilters);
    when(query.count()).thenReturn((long) mockFilters.size());
    when(query.filterId(anyString())).thenReturn(query);
    when(query.singleResult()).thenReturn(mockFilters.get(0));

    FilterQuery nonExistingQuery = mock(FilterQuery.class);
    when(query.filterId(NON_EXISTING_ID)).thenReturn(nonExistingQuery);
    when(nonExistingQuery.singleResult()).thenReturn(null);

    return query;

  }
View Full Code Here

Examples of org.camunda.bpm.engine.filter.FilterQuery

  public void setUpRuntimeData() {
    filterServiceMock = mock(FilterService.class);

    when(processEngine.getFilterService()).thenReturn(filterServiceMock);

    FilterQuery filterQuery = MockProvider.createMockFilterQuery();

    when(filterServiceMock.createFilterQuery()).thenReturn(filterQuery);

    filterMock = MockProvider.createMockFilter();
View Full Code Here

Examples of org.infinispan.objectfilter.query.FilterQuery

   public FilterSubscription registerFilter(Query query, FilterCallback callback) {
      if (!(query instanceof FilterQuery)) {
         throw new IllegalArgumentException("The Query object must be created by a QueryFactory returned by this Matcher");
      }
      FilterQuery filterQuery = (FilterQuery) query;
      return registerFilter(filterQuery.getJpqlString(), callback);
   }
View Full Code Here

Examples of org.infinispan.objectfilter.query.FilterQuery

   @Override
   public ObjectFilter getObjectFilter(Query query) {
      if (!(query instanceof FilterQuery)) {
         throw new IllegalArgumentException("The Query object must be created by a QueryFactory returned by this Matcher");
      }
      FilterQuery filterQuery = (FilterQuery) query;
      return getObjectFilter(filterQuery.getJpqlString());
   }
View Full Code Here

Examples of org.infinispan.objectfilter.query.FilterQuery

   @Override
   public FilterSubscription registerFilter(Query query, FilterCallback callback) {
      if (!(query instanceof FilterQuery)) {
         throw new IllegalArgumentException("The Query object must be created by a QueryFactory returned by this Matcher");
      }
      FilterQuery filterQuery = (FilterQuery) query;
      return registerFilter(filterQuery.getJpqlString(), callback);
   }
View Full Code Here

Examples of org.infinispan.objectfilter.query.FilterQuery

   @Override
   public ObjectFilter getObjectFilter(Query query) {
      if (!(query instanceof FilterQuery)) {
         throw new IllegalArgumentException("The Query object must be created by a QueryFactory returned by this Matcher");
      }
      FilterQuery filterQuery = (FilterQuery) query;
      return getObjectFilter(filterQuery.getJpqlString());
   }
View Full Code Here

Examples of org.infinispan.objectfilter.query.FilterQuery

   @Override
   public FilterSubscription registerFilter(Query query, FilterCallback callback) {
      if (!(query instanceof FilterQuery)) {
         throw new IllegalArgumentException("The Query object must be created by a QueryFactory returned by this Matcher");
      }
      FilterQuery filterQuery = (FilterQuery) query;
      return registerFilter(filterQuery.getJpqlString(), callback);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.