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] Wed, 04 August 2010 22:52 Go to next message
Timothy Minahan is currently offline Timothy Minahan
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 11:10 Go to previous message
Aaron  is currently offline Aaron
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.
Previous Topic:Selection does not contain a main type.
Next Topic:Android
Goto Forum:
  


Current Time: Fri Aug 01 04:00:54 EDT 2014

Powered by FUDForum. Page generated in 0.01683 seconds