Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Access to MessageDialog object
Access to MessageDialog object [message #330271] Thu, 24 July 2008 03:31 Go to next message
Eclipse UserFriend
I want to write a test in JUnit to see that an Error Dialog pops up with
the correct message.

How, in my unit test, do I get at the MessageDialog object my that my
program creates?

I assume I need to do
PlatformUI.getWorkbench().getDisplay().getActiveShell() or
PlatformUI.getWorkbench().getDisplay().getActiveShell().getC hildren(), but
from there I'm lost...
Re: Access to MessageDialog object [message #330273 is a reply to message #330271] Thu, 24 July 2008 04:05 Go to previous message
Eclipse UserFriend
I just subclass it and put a static that points to the current instance
for testing purposes. I don't think there is any other way you can find it.

Nadav wrote:
> I want to write a test in JUnit to see that an Error Dialog pops up with
> the correct message.
>
> How, in my unit test, do I get at the MessageDialog object my that my
> program creates?
>
> I assume I need to do
> PlatformUI.getWorkbench().getDisplay().getActiveShell() or
> PlatformUI.getWorkbench().getDisplay().getActiveShell().getC hildren(),
> but from there I'm lost...
>
>
>
>


--
*new* Common Navigator Framework section in:
3.4RC4 Platform Plugin Developer Guide (Programmer's Guide)
http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/cnf.htm
http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases


You have brains in your head.
You have feet in your shoes.
- Dr Seuss, Oh the Places You'll Go
Previous Topic:Modifying plugin.xml file programmatically
Next Topic:ImportOperation - import project files into custom project
Goto Forum:
  


Current Time: Thu May 08 15:34:38 EDT 2025

Powered by FUDForum. Page generated in 0.03452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top