wood burning stoves 2.0*
The moose likes Testing and the fly likes Testing the application with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Testing the application with "public static void main" method" Watch "Testing the application with "public static void main" method" New topic
Author

Testing the application with "public static void main" method

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
Is it too wrong to test an application with a bunch of classes, each one with its "public static void main" method?


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

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 .


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Testing the application with "public static void main" method
 
Similar Threads
a question in Chapter One of RHE's book
Startup
Programmer's Certification
valid syntax
signature of main() method....