Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Myfaces Test Framework Project

...

One of the advantages of unit testing is that a test case should focus only on the methods of the class under test, in isolation from
related application classes, or APIs provided by any container that the class under test might be installed into at runtime. But, how do you test an application class that has dependencies on such APIs (such as depending on the Servlet API to provide an HttpServletRequest object representing an incoming HTTP request)?

A popular answer to this dilemma is to utilize a library of mock objects – classes that implement and emulate the container APIs, but still run in the isolated environment of a JUnit test case. Myfaces provides mock object implementations for its own features, as well as features of the underlying container (Servlet and JavaServer Faces) environment. In addition, convenient base classes are provided to make it very easy to build your own test cases utilizing these mock objects. This library is used to create unit tests for Myfaces components itself, but it is primarily focused on making it easy to build unit tests for application classes such as {{ViewController}}s ViewControllers.

Provided Services

The Myfaces Test Framework provides mock object libraries, plus base classes for creating your own JUnit {{TestCase}}s TestCases.

Mock objects are provided in package org.apache.myfaces.test.mock for the following container APIs:

...