Misleading Error Message in Eclipse

 


Summary

To perform Scenario Testing on Eclipse we are going to imagine a situation where the user changes the behavior of the application by adding command line arguments. If the user specifies the location of the JRE directory using the –vm argument, Eclipse v2.1.2 (Windows version) will issue an error message saying that it searched the directory and couldn’t find JRE, when in fact it didn’t search. (Source: bugs.eclipse.org)


Application Description

The Eclipse Platform is designed for building integrated development environments (IDEs) that can be used to create applications as diverse as web sites, Java programs, C++ programs, and Enterprise JavaBeans. (Source: www.eclipse.org)

Eclipse accepts many different command line arguments, which can be supplied either by starting the application from command prompt and adding the arguments, or by using a shortcut.

For our test we will use shortcut to eclipse.exe

We will add the command line argument -vm in the target area of the shortcut.

Setting the java VM using -vm
It is recommended that you explicitly specify which Java VM to use when running Eclipse. This is achieved with the -vm command line argument (for example, -vm c:\jre\bin\javaw.exe). If you don't use -vm, Eclipse will use the first Java VM found on the O/S path. When you install other products, they may change your path, resulting in a different Java VM being used when you next launch Eclipse.
(taken from the Eclipse manual)


Test Design

This example demonstrates the use of Scenario Testing. To perform this type of testing we have to imagine a real world situation, which involves a complex use of Eclipse. Let’s imagine that a user of Eclipse is developing a Java application and wants to test it with different versions of Java Run Time Environment (JRE).

One way to do that is to have the different versions in different directories and just specify which one Eclipse should use by adding the –vm argument, followed by the desired directory.

The goal is to make sure that changes of the command line argument result in the application using the correct Java Run Time Environment.


Performing the Test

  1. The user will first create a shortcut to eclipse.exe, because this is the easiest way to add command line arguments. Then the user will add the –vm argument pointing to the directory of the JRE that he/she wants to use.

  2. The next step would be to run Eclipse.

Results/Relevance

Surprisingly Eclipse will complain that it searched the directory and couldn’t find JRE or JDK. But in the same time the user is looking at the directory and it is obvious that JRE is right there.

More experienced users will not have problems finding the workaround (see below) because they will know that error messages can be misleading. Unfortunately, there will be many users who will read the error message and think that if it says that Eclipse searched the directory and couldn’t find the needed file, it must be true. This will confuse the users and decrease the credibility of the application.


Additional Notes

It turns out that if the user adds the filename (javaw.exe) at the end of the path so that Eclipse doesn't have to search for it, everything will work fine.


Configuration Notes

Testing Eclipse Foundation's Eclipse v2.1.2:


Created 14 June 2004 for the CSTER

All images and written material ©Copyright Georgi Nikolov 2004

This work is licensed under the Creative Commons Attribution-ShareAlike License.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/2.0/
or send a letter to
Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305,
USA.