org.geoserver.monitor.Query.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(249)

本文整理了Java中org.geoserver.monitor.Query.<init>方法的一些代码示例,展示了Query.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.<init>方法的具体详情如下:
包路径:org.geoserver.monitor.Query
类名称:Query
方法名:<init>

Query.<init>介绍

暂无

代码示例

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

  1. @Test
  2. public void testGetRequestsCount() throws Exception {
  3. final List<Object> aggs = new ArrayList();
  4. RequestDataVisitor v = new RequestDataVisitor() {
  5. public void visit(RequestData data, Object... aggregates) {
  6. aggs.addAll(Arrays.asList(aggregates));
  7. }
  8. };
  9. dao.getRequests(new Query().aggregate("count()").filter("path","/foo", Comparison.EQ), v);
  10. assertEquals(1, aggs.size());
  11. assertEquals(4, ((Number)aggs.get(0)).intValue());
  12. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetIterator() throws Exception {
  3. Iterator<RequestData> it = dao.getIterator(
  4. new Query().filter("path", Arrays.asList("/two", "/seven"), Comparison.IN ));
  5. assertTrue(it.hasNext());
  6. RequestData data = it.next();
  7. assertEquals("/two", data.getPath());
  8. assertTrue(it.hasNext());
  9. data = it.next();
  10. assertEquals("/seven", data.getPath());
  11. assertFalse(it.hasNext());
  12. }
  13. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsFilterNull() throws Exception {
  3. assertEquals(0, dao.getRequests(new Query().filter("path", null, Comparison.EQ)).size());
  4. assertEquals(
  5. testData.getData().size(),
  6. dao.getRequests(new Query().filter("path", null, Comparison.NEQ)).size());
  7. }

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

  1. @Test
  2. public void testGetRequestsJoin() throws Exception {
  3. List<RequestData> datas = dao.getRequests(new Query().properties("path", "resource")
  4. .filter("path","/foo", Comparison.EQ). group("path", "resource")
  5. .sort("resource", SortOrder.ASC));
  6. assertEquals(3, datas.size());
  7. assertEquals("stuff", datas.get(0).getResources().get(0));
  8. assertEquals("things", datas.get(1).getResources().get(0));
  9. assertEquals("widgets", datas.get(2).getResources().get(0));
  10. }
  11. @Test

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

  1. @Test
  2. public void testGetRequestsJoinIN() throws Exception {
  3. List<String> resources = Arrays.asList("widgets", "things");
  4. List<RequestData> datas = dao.getRequests(new Query().properties("resource")
  5. .aggregate("count()").filter("resource", resources, Comparison.IN)
  6. .group("resource").sort("resource", SortOrder.ASC));
  7. assertEquals(2, datas.size());
  8. assertEquals("things", datas.get(0).getResources().get(0));
  9. assertEquals("widgets", datas.get(1).getResources().get(0));
  10. }

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

  1. @Test
  2. public void testGetRequestsFilterAnd() throws Exception {
  3. assertEquals(1, dao.getRequests(new Query().filter("path", "/foo", Comparison.EQ)
  4. .filter("widgets", "resources", Comparison.IN)).size());
  5. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsVisitor() throws Exception {
  3. final List<RequestData> datas = new ArrayList();
  4. dao.getRequests(new Query().filter("path", "/seven", Comparison.EQ),
  5. new RequestDataVisitor() {
  6. public void visit(RequestData data, Object... aggregates) {
  7. datas.add(data);
  8. }
  9. });
  10. assertCoveredInOrder(datas, 7);
  11. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsFilterIN() throws Exception {
  3. List<RequestData> datas = dao.getRequests(
  4. new Query().filter("path", Arrays.asList("/two", "/seven"), Comparison.IN ));
  5. assertCovered(datas, 2, 7);
  6. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsFilterIN() throws Exception {
  3. List<RequestData> datas =
  4. dao.getRequests(
  5. new Query().filter("path", Arrays.asList("/two", "/seven"), Comparison.IN));
  6. assertCovered(datas, 2, 7);
  7. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsFilterIN2() throws Exception {
  3. List<RequestData> datas = dao.getRequests( new Query().filter(
  4. "status", Arrays.asList(Status.RUNNING, Status.WAITING), Comparison.IN ));
  5. assertCovered(datas, 1, 2, 5, 6, 10, 11, 12, 15, 16, 20);
  6. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsVisitor() throws Exception {
  3. final List<RequestData> datas = new ArrayList();
  4. dao.getRequests(
  5. new Query().filter("path", "/seven", Comparison.EQ),
  6. new RequestDataVisitor() {
  7. public void visit(RequestData data, Object... aggregates) {
  8. datas.add(data);
  9. }
  10. });
  11. assertCoveredInOrder(datas, 7);
  12. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsFilterIN2() throws Exception {
  3. List<RequestData> datas =
  4. dao.getRequests(
  5. new Query()
  6. .filter(
  7. "status",
  8. Arrays.asList(Status.RUNNING, Status.WAITING),
  9. Comparison.IN));
  10. assertCovered(datas, 1, 2, 5, 6, 10, 11, 12, 15, 16, 20);
  11. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsFilter() throws Exception {
  3. assertCoveredInOrder(
  4. dao.getRequests(new Query().filter("path", "/seven", Comparison.EQ)), 7);
  5. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsFilter() throws Exception {
  3. assertCoveredInOrder(
  4. dao.getRequests(new Query().filter("path", "/seven", Comparison.EQ)), 7);
  5. }

代码示例来源:origin: org.geoserver.extension/monitor-hibernate

  1. @Test
  2. public void testGetRequestsFilterIN3() throws Exception {
  3. List<RequestData> datas = dao.getRequests( new Query().filter(
  4. "widgets", "resources", Comparison.IN ));
  5. assertCovered(datas, 11, 14, 18);
  6. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsSorted() throws Exception {
  3. assertCoveredInOrder(dao.getRequests(new Query().filter("id", 11l, Comparison.LT)
  4. .sort("path", SortOrder.ASC)), 8, 5, 4, 9, 1, 7, 6, 10, 3, 2);
  5. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsPaged() throws Exception {
  3. List<RequestData> datas =
  4. dao.getRequests(new Query().page(5l, 2l).sort("startTime", SortOrder.ASC));
  5. assertCoveredInOrder(datas, 6, 7);
  6. }

代码示例来源:origin: org.geoserver.extension/monitor-core

  1. @Test
  2. public void testGetRequestsPaged() throws Exception {
  3. List<RequestData> datas = dao.getRequests(
  4. new Query().page(5l, 2l).sort("startTime", SortOrder.ASC));
  5. assertCoveredInOrder(datas, 6, 7);
  6. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsBetween() throws Exception {
  3. List<RequestData> datas =
  4. dao.getRequests(
  5. new Query()
  6. .between(
  7. toDate("2010-07-23T15:55:00"),
  8. toDate("2010-07-23T16:17:00")));
  9. assertCoveredInOrder(datas, 6, 5, 4);
  10. }

代码示例来源:origin: org.geoserver.extension/gs-monitor-core

  1. @Test
  2. public void testGetRequestsBetween2() throws Exception {
  3. // test that the query is inclusive, and test sorting
  4. List<RequestData> datas =
  5. dao.getRequests(
  6. new Query()
  7. .between(
  8. toDate("2010-07-23T15:56:44"),
  9. toDate("2010-07-23T16:16:44"))
  10. .sort("startTime", SortOrder.ASC));
  11. assertCoveredInOrder(datas, 4, 5, 6);
  12. }

相关文章