I am program with swing. But I don't know how to use JUnit with it. I want to use this way for unittest. 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!
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.
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