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

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

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

Query.filter介绍

暂无

代码示例

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

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

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

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

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

@Test
  public void testGetIterator() throws Exception {
    Iterator<RequestData> it = dao.getIterator(
      new Query().filter("path", Arrays.asList("/two", "/seven"), Comparison.IN ));
      
    assertTrue(it.hasNext());
    RequestData data = it.next();
    assertEquals("/two", data.getPath());
    
    assertTrue(it.hasNext());
    data = it.next();
    assertEquals("/seven", data.getPath());
    
    assertFalse(it.hasNext());
  }
}

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

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

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

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

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

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

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

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

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

@Test
public void testGetRequestsFilterOr() throws Exception {
  assertEquals(4, dao.getRequests(new Query().filter("path", "/seven", Comparison.EQ)
    .or("widgets", "resources", Comparison.IN)).size()); 
}

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

@Test
public void testGetCount() throws Exception {
  assertEquals(4, dao.getCount(new Query().filter("path","/foo", Comparison.EQ)));
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@Test
public void testGetRequestsAdvancedFilter() throws Exception {
  Filter filter = new Filter("path", "/four", Comparison.EQ)
    .or(new Filter("service", "foo", Comparison.EQ).and(
      new Filter("resource", Arrays.asList("widgets"), Comparison.IN)));
  
  List<RequestData> datas = dao.getRequests(new Query().filter(filter));
  assertEquals(2, datas.size());
  assertCovered(datas, 4, 11);
}

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

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

相关文章