Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » checking what a IViewPart shows
checking what a IViewPart shows [message #52103] Wed, 28 May 2003 11:47 Go to next message
Eclipse UserFriend
Originally posted by: nczempin.printcom.deutschepost.de

Hello,

I have created a plug-in that includes a class inheriting from
org.eclipse.ui.IViewPart. I would like to unit test this programmatically.
I have found the excellent pde.junit package from Kent Beck and Erich
Gamma. However, to see what's inside the view I have to downcast on my
class and get the Tree via the TreeViewer. I want to avoid downcasting,
because it
a) violates the Eclipse API rules of engagement
b) leads to numerous problems (with ClassLoaders) when using a separate
Test plug-in to test my plug-in
c) should generally be avoided.

As a first step, I would simply like to be able to check what the tree is
displaying. Looking through the API, I haven't found the way to do this.
Is there a way or will I have to stick with downcasting?

Of course later, my View will be based on actions and events entirely, and
it's easy to send them and receive them without breaking encapsulation (i.
e. without downcasting).

But how do I look at what the View is displaying. This is very easy for a
human :-)

regards,
Nicolai Czempin
Re: checking what a IViewPart shows [message #53354 is a reply to message #52103] Thu, 29 May 2003 03:42 Go to previous message
Eclipse UserFriend
Originally posted by: boris.litvak.lycos.com

Partial solution for downcasting:
I usually create singleton proxy classes to access my real objects from
testing code. However, value assignment to their contents has to come from
a real code :-(.
Previous Topic:Accessing LaunchingConfiguration
Next Topic:How to make the different-version-plugin pickup transparent to the user?
Goto Forum:
  


Current Time: Sat Jul 12 18:38:17 EDT 2025

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

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

Back to the top