Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:56 Go to next message
elvisisking is currently offline elvisisking
Messages: 8
Registered: October 2010
Junior Member
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 08:33 Go to previous message
Phil M. Fischer is currently offline Phil M. Fischer
Messages: 60
Registered: November 2010
Location: Germany
Member
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: Sat Sep 20 04:00:31 GMT 2014

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

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