File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing the application with "public static void main" method

 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it too wrong to test an application with a bunch of classes, each one with its "public static void main" method?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33696
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does each one have a main method?

I don't think it is bad to test a main method if it exists "in the real code." Like when developing a command line utility. But I wouldn't add a main method for the purposes of testing. That's what JUnit is for .
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic