• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing the application with "public static void main" method

 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • 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: 34863
369
Eclipse IDE Java VI Editor
  • 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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic