Skip to main content

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 elvisiskingFriend
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?

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
Philipp M. Fischer is currently offline Philipp M. FischerFriend
Messages: 66
Registered: November 2010
Location: Germany
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).


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: Sun Nov 18 10:34:43 GMT 2018

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

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

Back to the top