aspose file tools*
The moose likes Testing and the fly likes About JUnit with GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "About JUnit with GUI" Watch "About JUnit with GUI" New topic
Author

About JUnit with GUI

Mikey Chen
Greenhorn

Joined: Jul 12, 2002
Posts: 29
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!


Rome was not built in a day.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Mikey Chen
Greenhorn

Joined: Jul 12, 2002
Posts: 29
Lasse Koskela:
Thanks!
Now I have downloaded the JFCUnit.
I will add it in my work.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Also take a look at http://test.javaranch.com/wiki/view?UnitTestingGuis


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About JUnit with GUI