@Ignore
@Test
public void testEditReRender() throws Exception {
ApplicationGIS.openMap(map, true);
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return map.getRenderManagerInternal().getRenderExecutor().getState()==IRenderer.DONE;
}
}, true);
final RenderListener listener=new RenderListener();
map.getRenderManagerInternal().getRenderExecutor().eAdapters().add(listener);
listener.rendered=false;
FeatureStore<SimpleFeatureType, SimpleFeature> store=map.getLayersInternal().get(0).getResource(FeatureStore.class, new NullProgressMonitor());
FilterFactory fac=CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
store.removeFeatures(fac.id(FeatureUtils.stringToId(fac, features[0].getID())));
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return listener.rendered;
}
}, true);
assertTrue(listener.rendered);
listener.rendered=false;
store.modifyFeatures(features[0].getFeatureType().getDescriptor("name"),"changed", //$NON-NLS-1$ //$NON-NLS-2$
fac.id( FeatureUtils.stringToId(fac, features[1].getID() )));
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return listener.rendered;
}
}, true);
assertTrue(listener.rendered);
listener.rendered=false;
map.getEditManagerInternal().rollbackTransaction();
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return listener.rendered;
}
}, true);
assertTrue(listener.rendered);
listener.rendered=false;
store.modifyFeatures(features[0].getFeatureType().getDescriptor("name"),"changed", //$NON-NLS-1$//$NON-NLS-2$
fac.id( FeatureUtils.stringToId(fac, features[1].getID() )));
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return listener.rendered;
}
}, true);
assertTrue(listener.rendered);
listener.rendered=false;
map.getEditManagerInternal().rollbackTransaction();
UDIGTestUtil.inDisplayThreadWait(5000, new WaitCondition(){
public boolean isTrue() {
return listener.rendered;
}