Everyone wants to reuse their test code. Reusing test code for functional tests is harder, as tests navigate through many pages in an application. This also means that parts of the tests are similar. This article talks about how you can abstract screens in your application using the Screen Object Pattern.
Short and fast introduction to JUnit 4 new features. It shows "annotation based testing", "new exception handling mechanism", "usage of @ignore and timeouts", "new assertion statements" and "usage of JUnit4TestAdapter class" in JUnit 4. It takes only 60 seconds to have a look at. Enjoy it.
JUnit in 60 Seconds
To someone who is new to unit testing, the idea of mock objects can be confusing to say the least. However in this tutorial, we will focus on the concept of mocking in general. What is a mock object? What is it used for? Why can't I mock object XYZ? Let's look into these questions and maybe clear a bit of the air on the use of mock objects.
The Concept of Mocking
Ok...Ok...I get it, I should write unit tests. What exactly is a unit test? How do you write a unit test? How do I handle dependencies? And how is writing more code going to make my existing code better? This tutorial will show you how.
Unit testing with JUnit and EasyMock
JUnit is increasingly being used in scientific case studies. That's because it is comparatively small, well-known, and self-contained. For anyone who is interested in a detailed design documentation of how JUnit 3.8 works, I have documented its design. I chose JUnit 3.8 because the move to annotations in 4.0 may have made JUnit more convenient to use, but the design less clear (in object-oriented terms). JUnit is not the only common case study, JHotDraw is another.
JUnit 4 is a completely different API from the versions that came before it and depends on new features of Java 5.0 (annotations, static import...). As you'll see, JUnit 4 is simpler, richer, and easier to use and introduces more flexible initialization and cleanup, timeouts, and parameterized test cases. [Article Text]
This is a breif look at JUnit 4. [Article Text]
Everyone knows what a mock is, just from the name, but as with many seemingly simple ideas, there is more to them than first meets the eye. This article explores the two types of mocks that exist and covers some of the problems inherent in their use. Finally, it considers the reason why a developer might chose to use mocks. After all, common understanding holds that mocks are used for unit testing, a key part of Test Driven Design [Article Text]
This article is going to introduce you to JUnit, a tool for project testing and debugging. After introducing the theory of test-driven development, we'll move on to a step-by-step explanation of how you can create your JUnit tests with the help of the popular Eclipse IDE. We'll show how something as simple as a Hello World program can be exposed to a JUnit test. [Article Text]
Chapter 12 from Kent Beck and Erich Gamma's book Contributing to Eclipse: Principles, Patterns, and Plugins about Test-Driven Plug-In Development. [Article Text]