01: package org.geotools.data.store;
02:
03: import java.util.Iterator;
04:
05: public class MaxFeaturesFeatureCollectionTest extends
06: FeatureCollectionWrapperTestSupport {
07:
08: MaxFeaturesFeatureCollection max;
09:
10: protected void setUp() throws Exception {
11: super .setUp();
12: max = new MaxFeaturesFeatureCollection(delegate, 2);
13: }
14:
15: public void testSize() throws Exception {
16: assertEquals(2, max.size());
17: }
18:
19: public void testIterator() throws Exception {
20:
21: Iterator i = max.iterator();
22: for (int x = 0; x < 2; x++) {
23: assertTrue(i.hasNext());
24: i.next();
25: }
26:
27: assertFalse(i.hasNext());
28: }
29: }
|