Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • 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: 35757
412
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 .
 
Message for you sir! I think it is a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!