------ Myfaces Test Framework ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. Using The Test Framework The most common scenario for using the Test Framework is to construct test cases for <<>> implementation classes. Because the runtime environment of a <<>> is quite constrained, it is easy to construct isolated unit tests that exercise the methods exposed by a <<>> class. [[1]] Create a new Java class <<>>, in a package directory (typically under <<>> in your project) that is the same as the package directory for the class you will be testing. This allows your test case to access package private and protected variables and methods in the class being tested. [[2]] Make sure that the package declaration matches that of the class to be tested (in this case, <<>>. Declare your class to extend <<>> (or, if you are not testing a <<>> implementation, extend <<>>): +-------------------------------+ public class SelectTestCase extends AbstractViewControllerTestCase { ... } +-------------------------------+ [[3]] Create a constructor that takes a <<>> parameter, and passes it to the superclass constructor: +-------------------------------+ public SelectTestCase(String name) { super(name); } +-------------------------------+ [[4]] Create a <<>> method and to call <<>> at the beginning. This method will be called by JUnit immediately before it executes each test method. +-------------------------------+ public void setUp() { super.setUp(); // Customization will go here } +-------------------------------+ [[5]] After the call to the superclass <<>> method, perform any other initialization required to execute the tests in this test case. In our example case, a configuration method on the <<>> instance will be used to define the default and supported <<>>s for this set of tests. This corresponds to what would happen at runtime, when the JavaServer Faces initialization process used the contents of the <<>> resource to initialize these values. In addition, we will create a new instance of the <<