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

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

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

Query.between介绍

暂无

代码示例

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

  1. @Test
  2. public void testToQueryString() throws Exception {
  3. Date from = toDate("2010-07-23T15:56:44");
  4. Date to = toDate("2010-07-23T16:16:44");
  5. Query q = new Query().between(from, to);
  6. q.filter("service", "WFS", Comparison.EQ).and("status", "RUNNING", Comparison.EQ)
  7. .and("path", Arrays.asList("/foo", "/bar"), Comparison.IN);
  8. String qs = RequestResource.toQueryString(q);
  9. assertEquals('?', qs.charAt(0));
  10. qs = qs.substring(1);
  11. Map<String,String> kvp = new HashMap();
  12. for (String s : qs.split("&")) {
  13. kvp.put(s.split("=")[0], s.split("=")[1]);
  14. }
  15. assertEquals(from, RequestResource.DATE_FORMAT.parse(kvp.get("from")));
  16. assertEquals(to, RequestResource.DATE_FORMAT.parse(kvp.get("to")));
  17. assertEquals("service:EQ:WFS;status:EQ:RUNNING;path:IN:/foo,/bar", kvp.get("filter"));
  18. }
  19. }

代码示例来源: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/monitor-core

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

代码示例来源: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. }

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

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

相关文章