Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Test plugins with Java projects
Test plugins with Java projects [message #258241] Sun, 25 January 2009 13:15 Go to next message
Eclipse UserFriend
Hello all,

I'm currently writing a plugin and its associated test plugin. In the test
plugin I need to create a Java project. I've seen that there is a
JavaProjectHelper class in org.eclipse.jdt.ui.tests, which makes it really
easy to setup the tests.

The problem that I'm facing is that I have to include
org.eclipse.jdt.ui.tests in my target platform, and even so I get
"Discouraged access" warnings.

My question is: what is the accepted practice for this situation? Should I:
a) Live with the test plugins in the target platform? (may introduce
errors in production that aren't detected by the tests)
b) Copy and paste the JavaProjectHelper class and its dependencies into my
plugin? (may cause maintenance problems in the future)
c) Request for JavaProjectHelper to be included in the main code for
org.eclipse.jdt.ui? (I assume that there are reasons if it's not already
there)
d) Request for JDT tests plugins to be included in the downloadable JDT
SDK?

Is there some documentation or examples that I can look at?

Thanks in advance,
Tomás
Re: Test plugins with Java projects [message #258245 is a reply to message #258241] Sun, 25 January 2009 19:47 Go to previous messageGo to next message
Eclipse UserFriend
Tomas Pollak wrote:
> Hello all,
>
> I'm currently writing a plugin and its associated test plugin. In the
> test plugin I need to create a Java project. I've seen that there is a
> JavaProjectHelper class in org.eclipse.jdt.ui.tests, which makes it
> really easy to setup the tests.
>
> The problem that I'm facing is that I have to include
> org.eclipse.jdt.ui.tests in my target platform, and even so I get
> "Discouraged access" warnings.
>
> My question is: what is the accepted practice for this situation? Should I:
> a) Live with the test plugins in the target platform? (may introduce
> errors in production that aren't detected by the tests)
> b) Copy and paste the JavaProjectHelper class and its dependencies into
> my plugin? (may cause maintenance problems in the future)
> c) Request for JavaProjectHelper to be included in the main code for
> org.eclipse.jdt.ui? (I assume that there are reasons if it's not already
> there)
> d) Request for JDT tests plugins to be included in the downloadable JDT
> SDK?

In general the Eclipse tests are not part of the shipping product, and
that's for a variety of reasons, not least being that then we would need
tests for the tests. At present there is absolutely no guarantee
whatsoever that any given test method will continue to exist or continue
to behave the way it currently does.

Unless your plug-in is part of the Eclipse project I would strongly
recommend treating the Eclipse test plug-in code as if it were even less
stable than non-API methods in Eclipse product code. That is: if you
can possibly write your code using only API, then do; if you must use
internal methods, do so but be aware that you are liable to be broken by
new versions of Eclipse; if you must depend on test plug-ins then be
aware that you are making both your own life and that of your users harder.

So, in your case I would recommend option B.
Re: Test plugins with Java projects [message #258284 is a reply to message #258245] Mon, 26 January 2009 17:22 Go to previous message
Eclipse UserFriend
Hello Walter,

thank you for your reply. Knowing that about test code is important. I
think I'll go with b) then.

Thanks,
Tomás
Previous Topic:Weird plugin classloading problem (I think)
Next Topic:[Local variables not available] problem with debugger
Goto Forum:
  


Current Time: Wed May 07 08:50:58 EDT 2025

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

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

Back to the top