开发者

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 event开发者_StackOverflows which are methods and I need to trigger the events. So, is there a way to test the entire software?


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜