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.layout;
20
21 import java.io.IOException;
22
23 import org.apache.myfaces.trinidad.component.UIComponentTestCase;
24 import org.apache.myfaces.trinidad.component.UIXPanel;
25
26 /**
27 * Unit tests for UIXPanel Components
28 *
29 */
30 public abstract class UIXPanelTestCase extends UIComponentTestCase
31 {
32 /**
33 * Creates a new UIXPanelTestCase.
34 *
35 * @param testName the unit test name
36 */
37 protected UIXPanelTestCase(
38 String testName)
39 {
40 super(testName);
41 }
42
43 protected abstract UIXPanel createTestComponent();
44
45 /**
46 * Tests the apply-request-values lifecycle phase.
47 */
48 public void testApplyRequestValues()
49 {
50 UIXPanel component = createTestComponent();
51 doTestApplyRequestValues(component);
52
53 component = createTestComponent();
54 component.setRendered(false);
55 doTestApplyRequestValues(component);
56 }
57
58 /**
59 * Tests the process-validations lifecycle phase.
60 */
61 public void testProcessValidations()
62 {
63 UIXPanel component = createTestComponent();
64 doTestProcessValidations(component);
65 }
66
67 /**
68 * Tests the update-model-values lifecycle phase.
69 */
70 public void testUpdateModelValues()
71 {
72 UIXPanel component = createTestComponent();
73 doTestUpdateModelValues(component);
74 }
75
76 /**
77 * Tests the invoke-application lifecycle phase.
78 */
79 public void testInvokeApplication()
80 {
81 UIXPanel component = createTestComponent();
82 doTestInvokeApplication(component, null);
83 }
84
85 /**
86 * Tests the render-response lifecycle phase.
87 *
88 * @throws IOException when test fails
89 */
90 public void testRenderResponse() throws IOException
91 {
92 UIXPanel component = createTestComponent();
93 doTestRenderResponse(component);
94 }
95
96 }