Kyle
Kyle

Reputation: 22045

Built-in Unit testing in Eclipse?

I'm moving my java project from Netbeans to Eclipse. I'm new to Eclipse and I can't figure out how to create or run unit tests. In Netbeans I could just right click a source file to generate test stubs. And to run tests I just chose a "Run Tests" menu option.

How do I do this in Eclipse?

Upvotes: 4

Views: 627

Answers (2)

z00bs
z00bs

Reputation: 7498

create: right click on class you wanna test, new/junit test case.

to run: right click on test class, run as/junit test case

Upvotes: 5

user147373
user147373

Reputation:

Right click on the class that you want to run the test for in the explorer window and select "Run as.." and than "Junit test" from the context menu. You can also right click on the method in the source window and select "Run as" and than "Junit test" from the context menu to run just that single test method.

Upvotes: 1

Related Questions