Use EasyMock.expectLastCall() method to set expectation on void methods. eg. mock.documentChanged(“Document”); expectLastCall().times(3);
Read more »
Use EasyMock.expectLastCall() method to set expectation on void methods. eg. mock.documentChanged(“Document”); expectLastCall().times(3);
Read more »
By design, the tree of Test instances is built in one pass, then the tests are executed in a second pass. The test runner holds strong references to all Test instances for the duration of the test execution. This means that for a very long test run with many Test instances, none of the...
Read more »
No. It is a convention to start with one test class per class under test, but it is not necessary. Test classes only provide a way to organize tests, nothing more. Generally you will start with one test class per class under test, but then you may find that a small group of tests...
Read more »
Refactoring J2EE components to delegate functionality to other objects that don’t have to be run in a J2EE container will improve the design and testability of the software. Cactus is an open source JUnit extension that can be used to test J2EE components in their natural environment.
Read more »
Reporting multiple failures in a single test is generally a sign that the test does too much, compared to what a unit test ought to do. Usually this means either that the test is really a functional/acceptance/customer test or, if it is a unit test, then it is too big a unit test. JUnit...
Read more »