Mojo_Jojo
Mojo_Jojo

Reputation: 949

JUnit in NetBeans

I've coded a Swing application. Now I've got to test this big application using JUnit testing in NetBeans. I've learned some basics, but I'm unable to figure out how to trigger the events automatically. If someone worked on it, they can help. You can also redirect me to some sources at least. You know, in a Swing application you'll have buttons, etc. which generate events which are methods and I need to trigger the events. So, is there a way to test the entire software?

Upvotes: 1

Views: 426

Answers (2)

idclaar
idclaar

Reputation: 697

A bit after the fact, but hopefully helpful to someone. NB JUnit comes with NetBeans (as long as you opt it in), and using Jemmy along with JUnit (through NetBeans' Jelly) makes for testing Swing UI actually pretty simple. Here are some good links for getting setup:

http://platform.netbeans.org/tutorials/nbm-test.html

http://netbeans.dzone.com/articles/how-use-jemmy-junit-netbeans

Upvotes: 0

Sankozi
Sankozi

Reputation: 588

You should check uispec4j. Open source library licensed under Common Public License. Linked tutorial shows how to easily fire event and check its result.

Upvotes: 1

Related Questions