@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof WFSInfo)) return false; final WFSInfo other = (WFSInfo) obj; if (gml == null) { if (other.getGML() != null) return false; } else if (!gml.equals(other.getGML())) return false; if (maxFeatures != other.getMaxFeatures()) return false; if (featureBounding != other.isFeatureBounding()) return false; if (canonicalSchemaLocation != other.isCanonicalSchemaLocation()) return false; if (serviceLevel == null) { if (other.getServiceLevel() != null) return false; } else if (!serviceLevel.equals(other.getServiceLevel())) return false; if (encodeFeatureMember != other.isEncodeFeatureMember()) return false; if (hitsIgnoreMaxFeatures != other.isHitsIgnoreMaxFeatures()) return false; if (srs == null) { if (other.getSRS() != null) return false; } else if (!srs.equals(other.getSRS())) return false; return true; } }
if (wfs.isHitsIgnoreMaxFeatures() && request.isResultTypeHits()) { maxFeatures = org.geotools.data.Query.DEFAULT_MAX;
WFSInfo wfs = getWFS(); int oldMaxFeatures = wfs.getMaxFeatures(); boolean hitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures();
@Test public void testNumReturnedMatchedWithMaxFeatures() throws Exception { WFSInfo wfs = getWFS(); int oldMaxFeatures = wfs.getMaxFeatures(); boolean oldHitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures(); try { wfs.setMaxFeatures(1); wfs.setHitsIgnoreMaxFeatures(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=results&service=wfs"); assertGML32(doc); assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched")); assertEquals("1", doc.getDocumentElement().getAttribute("numberReturned")); } finally { wfs.setMaxFeatures(oldMaxFeatures); wfs.setHitsIgnoreMaxFeatures(oldHitsIgnoreMaxFeatures); getGeoServer().save(wfs); } }