checking what a IViewPart shows [message #52103] |
Wed, 28 May 2003 11:47  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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 :-(.
|
|
|
Powered by
FUDForum. Page generated in 0.05645 seconds