When unit testing with JUnit, there are two similar methods, setUp() and setUpBeforeClass(). What is the difference between these methods? Also, wh
From the Javadoc:
Sometimes several tests need to share computationally expensive setup (like logging into a database). While this can compromise the independence of tests, sometimes it is a necessary optimization. Annotating a
public static voidno-arg method with@BeforeClasscauses it to be run once before any of the test methods in the class. The@BeforeClassmethods of superclasses will be run before those the current class.