[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[News.eclipse.test-and-performance] testing plugin actions that may open an error dialog
|
I am trying to find an effectove strategy for testing actions that
invoked interactively would open a dialog on error.
My current ideas are listed below.
I am doing 1) at the moment, would like to do 3) which would even allow
me to test that effectively a dialog opens...
any suggestions ?
-----------------------------------------------
1) all the run() methods must be templated as
public void run() {
try {
runWithException();
} catch (Exception exc) {
//log, open dialog, etc
}
}
and the test would only invoke runWithException();
2)
use a utility method for openDialog that would check if we are running
under the junit plugin runner
(how can I do that ???)
and if so, rethrow exception as runtimeException.
test invokes run().
3)
leave as is, but in test setup add some sort of window listener to the
workbench window that if an error dialog opens
(how do I detect that?)
closes the dialog (tehrefore unblocking the test method) and fails the test.
-------------