本文整理了Java中org.geoserver.monitor.Query.between
方法的一些代码示例,展示了Query.between
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.between
方法的具体详情如下:
包路径:org.geoserver.monitor.Query
类名称:Query
方法名:between
暂无
代码示例来源:origin: org.geoserver.extension/monitor-core
@Test
public void testToQueryString() throws Exception {
Date from = toDate("2010-07-23T15:56:44");
Date to = toDate("2010-07-23T16:16:44");
Query q = new Query().between(from, to);
q.filter("service", "WFS", Comparison.EQ).and("status", "RUNNING", Comparison.EQ)
.and("path", Arrays.asList("/foo", "/bar"), Comparison.IN);
String qs = RequestResource.toQueryString(q);
assertEquals('?', qs.charAt(0));
qs = qs.substring(1);
Map<String,String> kvp = new HashMap();
for (String s : qs.split("&")) {
kvp.put(s.split("=")[0], s.split("=")[1]);
}
assertEquals(from, RequestResource.DATE_FORMAT.parse(kvp.get("from")));
assertEquals(to, RequestResource.DATE_FORMAT.parse(kvp.get("to")));
assertEquals("service:EQ:WFS;status:EQ:RUNNING;path:IN:/foo,/bar", kvp.get("filter"));
}
}
代码示例来源:origin: org.geoserver.extension/gs-monitor-core
@Test
public void testGetRequestsBetween() throws Exception {
List<RequestData> datas =
dao.getRequests(
new Query()
.between(
toDate("2010-07-23T15:55:00"),
toDate("2010-07-23T16:17:00")));
assertCoveredInOrder(datas, 6, 5, 4);
}
代码示例来源:origin: org.geoserver.extension/monitor-core
@Test
public void testGetRequestsBetween() throws Exception {
List<RequestData> datas = dao.getRequests(new Query().between(
toDate("2010-07-23T15:55:00"), toDate("2010-07-23T16:17:00")));
assertCoveredInOrder(datas, 6, 5, 4);
}
代码示例来源:origin: org.geoserver.extension/gs-monitor-core
@Test
public void testGetRequestsBetween2() throws Exception {
// test that the query is inclusive, and test sorting
List<RequestData> datas =
dao.getRequests(
new Query()
.between(
toDate("2010-07-23T15:56:44"),
toDate("2010-07-23T16:16:44"))
.sort("startTime", SortOrder.ASC));
assertCoveredInOrder(datas, 4, 5, 6);
}
代码示例来源:origin: org.geoserver.extension/monitor-core
@Test
public void testGetRequestsBetween2() throws Exception {
//test that the query is inclusive, and test sorting
List<RequestData> datas = dao.getRequests(new Query().between(
toDate("2010-07-23T15:56:44"), toDate("2010-07-23T16:16:44"))
.sort("startTime", SortOrder.ASC));
assertCoveredInOrder(datas, 4, 5, 6);
}
内容来源于网络,如有侵权,请联系作者删除!