Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About JUnit with GUI

 
Mikey Chen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am program with swing. But I don't know how to use JUnit with it.
I want to use this way for unit test.
All logical code will be sperate with swing and the swing only to present the data. So use the JUnit to test the logical code, the UI will not be test by JUnit.
Does it a good way?
Do you have any Unit test experience with JUnit, will you share it to me?
Thanks!
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's a good idea to write your code so that testing the logic doesn't require going through Swing components.
However, if you want to (or, for some parts of your application, have to) test your Swing components as well, consider using JFCUnit for the job.
 
Mikey Chen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lasse Koskela:
Thanks!
Now I have downloaded the JFCUnit.
I will add it in my work.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also take a look at http://test.javaranch.com/wiki/view?UnitTestingGuis
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic