View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.trinidad.component.core.output;
20  
21  import java.io.IOException;
22  
23  import org.apache.myfaces.trinidad.component.UIComponentTestCase;
24  import org.apache.myfaces.trinidad.component.UIXObject;
25  
26  /**
27   * Unit tests for UIXObject components
28   *
29   */
30  public abstract class UIXObjectTestCase extends UIComponentTestCase
31  {
32    /**
33     * Creates a new UIXObjectTest
34     *
35     * @param testName  the unit test name
36     */
37    protected UIXObjectTestCase(
38      String testName)
39    {
40      super(testName);
41    }
42  
43    protected abstract UIXObject createTestComponent();
44  
45    /**
46     * Tests the apply-request-values lifecycle phase.
47     */
48    public void testApplyRequestValues()
49    {
50      // for decode we don't use renderers:
51      // =-=AEW But now, we do... see ADFFACES-42
52      //    setRendererUsed(false);
53      UIXObject component = createTestComponent();
54      doTestApplyRequestValues(component);
55      //    setRendererUsed(true);
56  
57      component = createTestComponent();
58      component.setRendered(false);
59      doTestApplyRequestValues(component);
60    }
61  
62    /**
63     * Tests the process-validations lifecycle phase.
64     */
65    public void testProcessValidations()
66    {
67      UIXObject component = createTestComponent();
68      doTestProcessValidations(component);
69    }
70  
71    /**
72     * Tests the update-model-values lifecycle phase.
73     */
74    public void testUpdateModelValues()
75    {
76      UIXObject component = createTestComponent();
77      doTestUpdateModelValues(component);
78    }
79  
80    /**
81     * Tests the invoke-application lifecycle phase.
82     */
83    public void testInvokeApplication()
84    {
85      UIXObject component = createTestComponent();
86      doTestInvokeApplication(component, null);
87    }
88  
89    /**
90     * Tests the render-response lifecycle phase.
91     *
92     * @throws IOException  when test fails
93     */
94    public void testRenderResponse() throws IOException
95    {
96      UIXObject component = createTestComponent();
97      doTestRenderResponse(component);
98    }
99  }