[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Re: Run As JUnit Plug-in Test
|
- From: Marco Maccaferri <macca@xxxxxxxxxxxxx>
- Date: Wed, 21 May 2008 16:34:21 +0200
- Newsgroups: eclipse.platform
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.14 (X11/20080501)
On 21/05/2008 15:23 Manuel Selva ha scritto:
Thanks for your answer. The problem is that the method throwing the
exception is an Eclipse mathod and not my method. More accurately it's the
IWorkbenchPage.showView method throwing a PartInitException (because I
forgot to set the AllowMutiple field in my extension description) ...
You can test that method too, something like:
testCanOpenMultipleViews() {
activePage.showView("primary", "secondary", VIEW_ACTIVATE);
}
Or, if showView is called from a more complex method, you can move the
commands to a method that passes the exceptions upstream. For example,
if it is contained in a Action.run method that catches the exception and
display a dialog to the user, move the code inside the try/catch block
to a method with the throws clause and test that method. The run method
simply calls the new method inside the try/catch block.
Regards,
Marco.