It is Impossible to Comment Empty Lines in Eclipse
Summary
In this example we are going to focus only on the Toggle Comment function and perform some simple tests to make sure that it does what it is supposed to do. If the user positions the caret on an empty line in Eclipse v3.0M7 (Windows version) and then tries to comment it by selecting Source ->Toggle Comment from the menu bar, the application will fail to put a comment. (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)
In this test we will focus on the Toggle Comment function. When editing a java source code file, the user can use the Toggle Comment function to add '//' at the beginning of a line, which makes the rest of the line a comment. It can be used to document a program or to quickly comment out a line of code.
Test Design
This example demonstrates the use of Function Testing.
Eclipse has a huge number of available functions. For this test let's concentrate only on the Toggle Comment function, which is part of the Source functions. We can test this function by creating a new project and adding one java file to it. Then we can type java code and use the Toggle Comment function in different contexts. The expected behavior would be that the application will add "//" at the beginning of the specified line, which will make it a comment. |
Performing the Test
Results/Relevance
The result is that nothing happens. The line is not commented.
The ability to comment empty lines is important, because it allows the users to separate long specifications in paragraphs (inside the source code) and makes text formatting easier.
Similar Tests
There are several other ways in which we can test the same function. For example, we can try to comment out a line of code.
Just as expected the line is commented. It appears that if the function is used in a mainstream way it works fine.
Configuration Notes
Testing Eclipse Foundation's Eclipse v3.0.0 M7: