I came across a strange issue with manipulating SWTBotTree, and it took me few hours to find a workaround. I found no exact match with my issue during my research, so let's keep a trace here while waiting for a better understanding of the issue and a fix in SWTBot.
In a SWTBot Test, calls to SWTBotTreeItem.contextMenu() or SWTBotTreeItem.select() might lead to the following exception:
Caused by: java.lang.IllegalArgumentException: Argument not valid
Quite an obscure message... what is happening? How can I solve my issue?
Easily applicable - but hard to guess - the workaround consists of simply calling SWTBotTree.setFocus() before manipulating the SWTBotTree.
final SWTBotTree tree = bot.tree();
final SWTBotTreeItem cssNodeFile = tree.expandNode("application", "css", "bonita_form_confirm.css");
I discovered a new issue since my last post about Target Platform migration from Eclipse 4.3 to 4.4.1. It concerns a behavior modification in Datatools API which broke our integration of the Datatools Graphical Designer.
After migrating to Eclipse 4.4, and with the support of Java 8 working well, it is time to launch our full test suite on Java 8! Unfortunately, one test for an EMF Validation was failing. It took me quite some time to figure out what went wrong, but the fix is quite easy and it would have never happened if a simple best practice rule was used.