@Ignore
@Test
public void testRefreshLayer() throws Exception {
final RenderExecutor renderExecutor = map.getRenderManagerInternal().getRenderExecutor();
renderExecutor.setState(IRenderer.NEVER);
final CompositeRendererImpl impl=(CompositeRendererImpl) renderExecutor.getRenderer();
impl.setState(IRenderer.NEVER);
for( Renderer renderer: impl.children() ) {
renderer.setState(IRenderer.NEVER);
}
for( Renderer renderer: impl.children() ) {
renderer.setState(IRenderer.NEVER);
assertEquals(IRenderer.NEVER, renderer.getState());
}
final ILayer refreshLayer = map.getMapLayers().get(0);
map.getRenderManagerInternal().refresh(refreshLayer, null);
UDIGTestUtil.inDisplayThreadWait(3000000, new WaitCondition(){
public boolean isTrue() {
for( Renderer renderer: impl.children() ) {
ILayer currentLayer = renderer.getContext().getLayer();
if( currentLayer==refreshLayer ){
if( IRenderer.DONE!=renderer.getState() )
return false;
} else if( currentLayer instanceof SelectionLayer
&& ((SelectionLayer)currentLayer).getWrappedLayer()==refreshLayer ){
if( IRenderer.DONE!=renderer.getState() )
return false;
} else {
assertEquals(currentLayer+" is supposed to be NEVER", IRenderer.NEVER, renderer.getState()); //$NON-NLS-1$
}
}
return true;
}
}, false);
for( Renderer renderer: impl.children() ) {
ILayer currentLayer = renderer.getContext().getLayer();
if( currentLayer==refreshLayer)
assertEquals(IRenderer.DONE, renderer.getState());
else if( currentLayer instanceof SelectionLayer && ((SelectionLayer)currentLayer).getWrappedLayer()==refreshLayer){
assertEquals(IRenderer.DONE, renderer.getState());