Android unit testing: Android testing framework and Robolectric

Problem: There are not many good tutorials on Android unit testing Android applications are written in Java. So you probably think if you know JUnit, you can unit test Android applications. Surprise! JUnit is not sufficient for unit testing Android applications. Junit works when the code runs within a JVM. Android applications interact with the Android OS. So you need […]

NoClassDefFoundError: org/hamcrest/SelfDescribing

I hit the following issue while trying to run a JUnit test in Eclipse: initializationError The Failure Trace displayed a message stating java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing I made sure that I had JUnit 4 and org.hamcrest.core along with the Java library in my project but still faced this issue. After analyzing quite a bit, I noticed that my JRE System Library also […]

JUint Asserts and Matchers

Problem: JUnit tutorials are often written by testers with a reasonable amount of unit checking expertise Why this post? There are plenty of JUnit tutorials available online. They are often written by testers with a reasonable amount of unit checking experience. The problem is that experts and beginners see things differently. I began noticing that beginners often read these JUnit […]

JUnit: For beginners by a beginner

Problem: JUnit tutorials are often written by testers with a reasonable amount of unit checking expertise Why this post? There are plenty of JUnit tutorials available online. They are often written by testers with a reasonable amount of unit checking experience. The problem is that experts and beginners see things differently. I began noticing that beginners often read these JUnit […]