Skip to main content



      Home
Home » Archived » Tycho » IllegalAccessErrors Running JUnit Tests During Build(Tests pass using JUnit Runner but fail when doing maven/tycho/surefire build.)
IllegalAccessErrors Running JUnit Tests During Build [message #634068] Wed, 20 October 2010 08:56 Go to next message
Eclipse UserFriend
I have a plugin (org.a.test) that is used to test another plugin (org.a). Both plugins have the same Java packages defined. The classes being tested in org.a have "protected" and package private methods. When I do a build using Tycho both jars (org.a, org.a.test) build fine.

However, during the build when the JUnit tests are run I get a runtime java.lang.IllegalAccessError whenever a test plugin class calls one of these protected methods. All the tests run successfully within Eclipse using the JUnit runner. I have Eclipse's compiler setting for "forbidden reference access rules" set to be an error.

Any ideas?

Thanks!
Re: IllegalAccessErrors Running JUnit Tests During Build [message #638690 is a reply to message #634068] Fri, 12 November 2010 03:33 Go to previous message
Eclipse UserFriend
Hi there,

I was having such an issue with "JUnit Plugin Tests" in Eclipse not in Maven-Tycho. But i got exactly the same error message. I was able to resolve this by adding "org.junit" to my plugin dependencies in the manifest. I suspect something like maven-tycho cannot get the right dependency while your eclipse can (getting it from somewhere elese).

Cheers

Phil
Previous Topic:Multiple Targets in Target.definition
Next Topic:Where are the JDT Core compiler logs or how do I have them created?
Goto Forum:
  


Current Time: Tue Jul 22 21:15:57 EDT 2025

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

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

Back to the top