MemoryFeatureStore implements FeatureStore { @Override public FeatureInputStream query( Query query ) throws FilterEvaluationException, FeatureStoreException { return storedFeatures.query( query ); } MemoryFeatureStore( AppSchema schema, ICRS storageCRS, MemoryFeatureStoreMetadata metadata,
                        ConnectionProvider lockConnection ); @Override void destroy(); @Override AppSchema getSchema(); @Override boolean isMapped( QName ftName ); @Override FeatureInputStream query( Query query ); @Override FeatureInputStream query( final Query[] queries ); @Override int queryHits( org.deegree.feature.persistence.query.Query query ); @Override int[] queryHits( Query[] queries ); @Override GMLObject getObjectById( String id ); @Override synchronized FeatureStoreTransaction acquireTransaction(); @Override LockManager getLockManager(); @Override Envelope getEnvelope( QName ftName ); @Override Envelope calcEnvelope( QName ftName ); @Override boolean isAvailable(); ICRS getStorageCRS(); @Override ResourceMetadata<? extends Resource> getMetadata(); @Override void init();  }
@Test public void testQueryAllPhilosophers() throws FilterEvaluationException, FeatureStoreException { TypeName[] typeNames = new TypeName[] { new TypeName( QName.valueOf( "{http: null ) }; Query query = new Query( typeNames, null, null, null, null ); FeatureCollection fc = store.query( query ).toCollection(); Assert.assertEquals( typeNames[0].getFeatureTypeName(), fc.iterator().next().getName() ); Assert.assertEquals( 7, fc.size() ); }
@Test public void testQueryAllPlaces() throws FilterEvaluationException, FeatureStoreException { TypeName[] typeNames = new TypeName[] { new TypeName( QName.valueOf( "{http: null ) }; Query query = new Query( typeNames, null, null, null, null ); FeatureCollection fc = store.query( query ).toCollection(); Assert.assertEquals( typeNames[0].getFeatureTypeName(), fc.iterator().next().getName() ); Assert.assertEquals( 7, fc.size() ); }
@Test public void testQueryAllCountries() throws FilterEvaluationException, FeatureStoreException { TypeName[] typeNames = new TypeName[] { new TypeName( QName.valueOf( "{http: null ) }; Query query = new Query( typeNames, null, null, null, null ); FeatureCollection fc = store.query( query ).toCollection(); Assert.assertEquals( typeNames[0].getFeatureTypeName(), fc.iterator().next().getName() ); Assert.assertEquals( 4, fc.size() ); }
@Test public void testQueryPhilosopherById() throws FilterEvaluationException, FeatureStoreException { TypeName[] typeNames = new TypeName[] { new TypeName( QName.valueOf( "{http: null ) }; Filter filter = new IdFilter( "PHILOSOPHER_1", "PHILOSOPHER_2" ); Query query = new Query( typeNames, filter, null, null, null ); FeatureCollection fc = store.query( query ).toCollection(); Assert.assertEquals( typeNames[0].getFeatureTypeName(), fc.iterator().next().getName() ); Assert.assertEquals( 2, fc.size() ); }