Jan 29
I finally sat down and spent two hours on using SWTbot. It is a automatic GUI testing tool for RCP/SWT programs. If you are writing AWT/Swing programs, it’s not for you. For AWT/Swing, you may want abbot.
I experienced several problems with setting it up. Finally I installed SWTbot 1.2, configured the launch settings, eliminated a NullPointerException error, and finally got it running. Feeling pretty good now.
SWTbot is being proposed to become an eclipse subproject. The latest version is 2.0. However, you might want to try 1.2 before getting more familiar.
Dec 19
Normally a RCP prodcut configuration is plug-in based when we create it. But sometimes a feature-based is necessary, if you want to leverage the software update or automatic update functions. Mostly we may run into errors such as:
No application id has been found ….
Application “org.abc.xyz.application” could not be found in the registry.
There are several causes to the errors. You can search in the eclipse.paltform.rcp newsgroup for help. Based on experience, here some troubleshooting steps:
1. Export a build with Product Export wizard. We use the build for troubleshooting.
2. Go to the build folder, and launch the executable.
3. Of course it won’t run. It’s fine. We need the log it generates.
4. Go to the configuration folder, and find the latest log.
5. In the log, look for the message:
“One or more bundles are not resolved because the following root constraints are not resolved:”
6. Below it, we can search for the message “Missing required bundle”, and then now what’s missing in our feature configuration. An example is:
Missing required bundle org.eclipse.emf.common_[2.4.0,3.0.0).
7. Add the missing bundle to your configuration. Repeat the above steps until the RCP program can run.
A problem with the steps: There might be a huge list of missing bundles. They could be from some feature bundles. It will relieve you if we know the feature names and add features to the product configuration.
The above is my troubleshooting experience. Not sure if there is any official documentaion that makes better explanation. But hope it helps.
Dec 17
Remember that we can view a installed feature list with the About dialog. Hence the best way is to read the eclipse source code directly. We can browse to the source code in Hierachy view, and trace it down. Below is the related source code in the AboutDialog constructor:
-
// create a descriptive object for each BundleGroup
-
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
-
-
if (providers != null) {
-
for (int i = 0; i < providers.length; ++i) {
-
IBundleGroup[] bundleGroups = providers[i].getBundleGroups();
-
for (int j = 0; j < bundleGroups.length; ++j) {
-
groups.add(new AboutBundleGroupData(bundleGroups[j]));
-
}
-
}
-
}
-
Well, as we can see, the installed feature information can be extracted from each bundleGroup array element. We don’t need to instantiate any AboutBundleGroupData unless you need it. Hope the code helps.