I have a set of JUnit tests which call the main method on a Java program, passes in args and checks the output. That\'s fine.
However, if the program I am testing ha
You should explicitly initialize any static state within your test classes, usually this is done in methods annotated @Before or @BeforeClass
This is a reason, among others, why having a lot of static dependencies in an application is a bad idea for testing. That's why many people encourage stateless programming.