Exemplo n.º 1
0
 public static BoundingBoxInputImpl createBoundingBoxInput(String key, BoundingBox bounds) {
   BoundingBoxInputDefinition bid = new BoundingBoxInputDefinition();
   CodeType ct = new CodeType();
   ct.setValue(key);
   bid.setIdentifier(ct);
   DefaultPoint min =
       new DefaultPoint(null, null, null, new double[] {bounds.getMinLon(), bounds.getMinLat()});
   DefaultPoint max =
       new DefaultPoint(null, null, null, new double[] {bounds.getMaxLon(), bounds.getMaxLat()});
   Envelope env = new DefaultEnvelope(min, max);
   BoundingBoxInputImpl lii =
       new BoundingBoxInputImpl(
           bid, new LanguageString(key, null), new LanguageString(key, null), env);
   return lii;
 }
  @Test
  @Category(UnitTest.class)
  public void testGetByBounds() throws Exception {
    final BoundingBox queryBounds = ReviewTestUtils.createTestQueryBounds();
    ReviewTestUtils.createPreparedData(resource());
    ReviewTestUtils.markSomeItemsReviewed();

    final ReviewableItemsStatistics response =
        execGet(String.valueOf(mapId), null, queryBounds.toServicesString());

    Assert.assertEquals(mapId, response.getMapId());
    Assert.assertEquals(54, response.getNumTotalItems());
    // TODO: fix - this should be returning 7 instead; I believe its ignoring way -44, whose review
    // against item is a relation with a node inside the query bounds; oddly enough the review get
    // resource test performs this query correctly, and they use nearly the same query code
    Assert.assertEquals(6, response.getNumReviewableItems());
    Assert.assertEquals(3, response.getNumReviewedItems());
  }