JUnit Eclipse plugin?

I feel stupid because I can’t find it, but where is the JUnit plugin for Eclipse? I included the last .jar in my build path, but I still have no way to create a new test case, run test cases with a green / red bar, etc. I need a plugin for this, right?

EDIT: I am using Eclipse for PHP Developers. Therefore, perhaps this will not enable JUnit automatically. Do I need to download Eclipse again, or can I somehow get this functionality?

+44
java eclipse plugins junit ide
Dec 26 '09 at 3:48
source share
8 answers

JUnit is part of the Eclipse Java Development Tools (JDT). Thus, either install JDT via Software Updates, or download and install the Eclipse IDE for Java developers (in fact, I would recommend installing the Eclipse IDE for Java EE developers if you want to create a complete embedded development environment on the server side).

You add it to the project by right-clicking the project in the Package Explorer and selecting "Build Path" → "Add Libraries" ... Then just select "JUnit" and click "Next">.

+64
Dec 26 '09 at 4:07
source share

It is built at Eclipse with age. What version of Eclipse are you using? How did you try to create a new JUnit test case? It should be File> New> Other> Java - JUnit - JUnit Test Case (you can eventually enter the filter text "junit").

+31
Dec 26 '09 at 3:56
source share

You must add Java development tools by choosing Help → “Install New Software”, there you will select the Juno update site, then “Programming Languages” → “Java Eclipse Development Tools”.

After that, you will be able to run JUnit tests using "Right Click" → "Run as" → "JUnit test".

+14
Dec 26 '09 at 4:00
source share

You do not need to install or update any software for JUnit. it is part of the Java development tools and comes with almost most recent versions in Eclipse.

Go to your project. Right click on it -> Select buildpath-> add library-> select JUnit from the list -> select the version you want to work with, → done

re-create the project to see the errors :)

+11
Feb 15 '13 at 17:10
source share

Junit is enabled by default with Eclipse (at least the Java EE version, I'm sure). You just need to add the idea to your point of view.

+4
Dec 26 '09 at 3:55
source share

Eclipse has built-in JUnit functionality. Open Configuration Launch Manager to create a test to run. You can also create JUnit Test Cases / Suites from New-> Other.

+1
Dec 26 '09 at 4:00
source share



Perhaps you were mistaken?

Eclipse has a construct called "perspective"; it is a task-oriented arrangement of windows, toolbar buttons and menus. There is a Java perspective, a debugging perspective, perhaps a PHP perspective, etc. If you are not in the Java perspective, you will not see some of the expected buttons (for example, New Class).

To switch perspectives, see the long-ish buttons on the right side of the toolbar or use the Window menu.

0
Dec 29 '09 at 18:15
source share

You might want to try Quick JUnit: https://marketplace.eclipse.org/content/quick-junit

The plugin is stable and allows you to switch between production and test code. I am currently using Eclipse Mars 4.5 and the plugin is supported for this version, as well as for the following:

Luna (4.4), Kepler (4.3), Juno (4.2, 3.8), Previous to Juno (<= 4.1)

0
Nov 20 '15 at 11:40
source share



All Articles