Tag Archives: junit

Writing reflective unit tests to improve code quality

I’ve found that writing JUnit tests that do classpath scanning combined with reflection is a way to write unit tests that cross-cut the entire application. This can be useful to prevent anti-patterns, enforce code standards or just to prevent common … Continue reading

Posted in Java, Software Engineering | Tagged Java, junit, tips, visural-common, warp-persist | 3 Comments

NetBeans 6.7 Broke My Parameterized Tests

If you had some JUnit parameterized tests with code such as: import java.util.Collection; import junit.framework.TestCase; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @RunWith(Parameterized.class) public class MyParamTest extends TestCase { public MyParamTest(String s1, String s2) { // do something with s1 and s2 } … Continue reading

Posted in General, Java, Software Engineering | Tagged Java, junit, netbeans, testing | Leave a comment

Testing Abstract Classes With Mockito and JUnit

Often times in Java, you have an abstract parent class which has some concrete methods which call abstract methods which will be implemented by the child classes. So what’s an easy way to test this sort of pattern? A mock … Continue reading

Posted in General, Java, Software Engineering | Tagged Java, junit, mockito, testing | 1 Comment