Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Launching JUNIT ... Variable references empty selection(Variable references empty on "rerun Test" or "rerun Test - Failures First")
icon4.gif  Launching JUNIT ... Variable references empty selection [message #551051] Thu, 05 August 2010 02:52 Go to next message
Timothy Minahan is currently offline Timothy MinahanFriend
Messages: 1
Registered: August 2010
Junior Member
Hi All,

I may have posted this in the wrong spot and if so apologise first.

I am currently using Eclipse 3.2 with a Java 1.4.2 application. The project is a couple of million lines of code and we are migrating it to Java6. We currently have around 22,000 JUnit tests that are executed both in standalone JUnit infrastructure via our cruise control build servers and individually via Eclipse.

Currently a developer opens the class file of the individual tests he/she wants to run and their run configuration passes on the following arguements:

-Xmx512M
 -Duser.client=true
 -Djava.security.policy=${project_loc}\deploy\client\resources\java.policy
 -DtestClass=${java_type_name} 
 -Djava.security.auth.login.config=${project_loc}\deploy\client\resources\login.config
 -Duser.dir=${project_loc}\deploy\client


The first time a test is run in eclipse the JUnit plugin fires and runs the correct test perfectly. If the developer wants to rerun that test and uses the plugins "Rerun Tests" or "Rerun Tests - Failed Tests first" I get the error where the dynamic variables are empty.

The closest thing in bugzilla i could find was https://bugs.eclipse.org/bugs/show_bug.cgi?id=292732 I have changed the {project_loc} references to {project_loc:/ProjectName} however I cannot seem to get the plugin to remember what the value of ${java_type_name} was from its previous execution.

The exact error text is:

Quote:

'Launching JUNIT LaunchableTestCase' has encountered a problem.

Variable references empty selection:
${java_type_name}



Anyone had or seen anything similar? This works for us in 3.2 but is showing the above problems in 3.3, 3.4, 3.5 and 3.6.
Re: Launching JUNIT ... Variable references empty selection [message #552542 is a reply to message #551051] Thu, 12 August 2010 15:10 Go to previous messageGo to next message
Aaron  is currently offline Aaron Friend
Messages: 1
Registered: August 2010
Junior Member
I had a very similar problem.

Sometimes I got

Variable references empty selection:
${project_path}

other times I got
java.lang.NoClassDefFoundError: JUnit

I was trying to run JUnit from a Run Configuration.

The solution was to rename the project so that there were no spaces in the project name.
Re: Launching JUNIT ... Variable references empty selection [message #1746275 is a reply to message #552542] Wed, 26 October 2016 11:04 Go to previous message
Konrad Windszus is currently offline Konrad WindszusFriend
Messages: 40
Registered: July 2009
Member
I opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=506550 for this issue, because I think from the JUnit view there is always a project/workspace bound to a selected test. Therefore it should be feasible to correctly replace those variables even from this view.
Previous Topic:Inherit null annotations not working for external annotations?
Next Topic:How to enable link-recognition in console window?
Goto Forum:
  


Current Time: Mon Oct 14 03:20:11 GMT 2024

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

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

Back to the top