Composite c = new Composite();
MockPaintable r = new MockPaintable();
c.addChild(r);
PainterVisitor pv = new PainterVisitor(new MapContext(){
public MenuContext getMenuContext() {
return null;
}
public ImageContext getRasterContext() {
return null;
}
public GraphicsContext getVectorContext() {
return null;
}
public boolean isReady() {
return true;
}
public HandlerRegistration addGraphicsReadyHandler(GraphicsReadyHandler handler) {
return null;
}
public void fireEvent(GwtEvent<?> event) {
}});
pv.registerPainter(new MockPainter());
c.accept(pv, null, null, false);
Assert.assertTrue("should have accepted visitor", r.visitorAccepted);
}