1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.trinidad.component;
20
21 import java.io.IOException;
22
23 import javax.faces.component.UIComponentBase;
24
25 import junit.framework.Test;
26 import junit.framework.TestSuite;
27 import junit.textui.TestRunner;
28
29 import org.apache.myfaces.trinidad.component.UIComponentTestCase;
30
31 import org.jmock.Mock;
32
33
34
35
36
37 public class UIXProcessTest extends UIComponentTestCase
38 {
39
40
41
42
43
44 public UIXProcessTest(
45 String testName)
46 {
47 super(testName);
48 }
49
50 @Override
51 protected void setUp() throws Exception
52 {
53 super.setUp();
54 }
55
56 @Override
57 protected void tearDown() throws Exception
58 {
59 super.tearDown();
60 }
61
62 public static Test suite()
63 {
64 return new TestSuite(UIXProcessTest.class);
65 }
66
67 public static void main(String[] args)
68 {
69 TestRunner.run(UIXProcessTest.class);
70 }
71
72
73
74
75 public void testInitialAttributeValues()
76 {
77 UIXProcess component = new UIXProcess();
78 assertEquals(true, component.isRendered());
79 }
80
81
82
83
84
85
86 public void testAttributeTransparency()
87 {
88 UIXProcess component = new UIXProcess();
89
90 doTestAttributeTransparency(component, "rendered",
91 Boolean.TRUE, Boolean.FALSE);
92
93 }
94
95
96
97
98
99
100
101 public void testProcessValidations()
102 {
103 UIXProcess component = new UIXProcess();
104 doTestProcessValidations(component);
105 }
106
107
108
109
110 public void testApplyRequestValues()
111 {
112 UIXProcess component = new UIXProcess();
113 doTestApplyRequestValues(component);
114
115 component = new UIXProcess();
116 component.setRendered(false);
117 doTestApplyRequestValues(component);
118 }
119
120
121
122
123 public void testUpdateModelValues()
124 {
125 UIXProcess component = new UIXProcess();
126 doTestUpdateModelValues(component);
127 }
128
129
130
131
132
133
134
135 public void testRenderResponse() throws IOException
136 {
137 UIXProcess component = new UIXProcess();
138 doTestRenderResponse(component);
139 }
140
141 protected Mock createMockUIComponent()
142 {
143
144 Mock mock = super.createMockUIComponent();
145
146 mock.stubs().method("getId");
147 mock.stubs().method("setId");
148
149 return mock;
150 }
151
152 }