| Summary: | SWTBotGefFigureCanvas: abstract from FigureCanvas | ||
|---|---|---|---|
| Product: | [Technology] SWTBot | Reporter: | Tim Kaiser <tim.kaiser> |
| Component: | GEFBot | Assignee: | Mariot Chauvin <mariot.chauvin> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mariot.chauvin, tim.kaiser |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Committed to trunk - Revision 581 Hi, recent changes in SWTBot made it impossible
for Graphiti to run tests -- again since we have
our own FigureCanvas Class which extends only from Canvas
(our shame;-).
I found a solution on the SWTBot side. If you would change
your init method in SWTBotGefViewer as follows we run again!
It would be great if you could bring in the patch, since
at the moment we have to run our tests against an
archived version of SWTBot. Also our customers would have to.
Best, Tim
protected void init() throws WidgetNotFoundException {
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
final Control control = graphicalViewer.getControl();
if (control instanceof FigureCanvas) {
canvas = new SWTBotGefFigureCanvas((FigureCanvas) control);
} else if (control instanceof Canvas) {
if (control instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) control;
Object adapter = adaptable.getAdapter(LightweightSystem.class);
if (adapter != null && adapter instanceof LightweightSystem) {
canvas = new SWTBotGefFigureCanvas((Canvas) control, (LightweightSystem) adapter);
}
}
}
editDomain = graphicalViewer.getEditDomain();
}
});
if (graphicalViewer == null) {
throw new WidgetNotFoundException("Editor does not adapt to a GraphicalViewer");
}
}
Fixed on master. Commit id a60f77bad54e5cbb7dc3e865c34b02fa920b8873. Thanks Mariot, this was really fast! When and where will the improved version be available via an update site such that we can use it in our buckminster build? Best, Tim (In reply to comment #4) > Thanks Mariot, > this was really fast! > > When and where will the improved version be available via an update site > such that we can use it in our buckminster build? > > Best, Tim Have a look to : https://hudson.eclipse.org/hudson/view/SWTBot/ You could find an update site for each build. I do not know when we will promote a build as the new release. Hi Mariot, as far as i can see, the update site sits in a directory on the build server. These directories get wiped from time to time. Are the build results copied to a stable directory? Thanks, Tim (In reply to comment #6) > Hi Mariot, > > as far as i can see, the update site sits > in a directory on the build server. > These directories get wiped from time to time. > > Are the build results copied to a stable directory? > > Thanks, Tim (In reply to comment #6) > Hi Mariot, > > as far as i can see, the update site sits > in a directory on the build server. > These directories get wiped from time to time. > > Are the build results copied to a stable directory? > > Thanks, Tim You are right, I do not think build results are copied to a stable directory, but I understand your need. We probably need an integration update site with a stable URI which link to the last build update site. I will open an issue. (In reply to comment #7) > (In reply to comment #6) > > Hi Mariot, > > > > as far as i can see, the update site sits > > in a directory on the build server. > > These directories get wiped from time to time. > > > > Are the build results copied to a stable directory? > > > > Thanks, Tim > > (In reply to comment #6) > > Hi Mariot, > > > > as far as i can see, the update site sits > > in a directory on the build server. > > These directories get wiped from time to time. > > > > Are the build results copied to a stable directory? > > > > Thanks, Tim > > You are right, I do not think build results are copied to a stable directory, > but I understand your need. > > We probably need an integration update site with a stable URI which link to the > last build update site. I will open an issue. See Bug 335863. |
In Graphiti, we directly extend Canvas. So we cannot supply a FigureCanvas. SWTBotGefFigureCanvas can be made to work with a plain Canvas and an according Lightweightsystem in the following fashion: (1) change public class SWTBotGefFigureCanvas extends AbstractSWTBotControl<FigureCanvas> to public class SWTBotGefFigureCanvas extends AbstractSWTBotControl<Canvas> (2) add the following constructor: public SWTBotGefFigureCanvas(Canvas w, LightweightSystem l) throws WidgetNotFoundException { super(w); eventDispatcher = l.getRootFigure().internalGetEventDispatcher(); } It would be great if we can get the change soon, since it blocks us from developing UI Tests with SWTBot! The change should be API-compatible since it is additive only. Best, Tim