KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > portlet > preferences > spec > PreferencesSpecTestCase


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Forums JBoss Portlet *
6  * *
7  * Distributable under LGPL license. *
8  * See terms of license at gnu.org. *
9  * *
10  *****************************************/

11 package org.jboss.portal.test.portlet.preferences.spec;
12
13 import org.jboss.portal.junit.AbstractTestCase;
14 import org.jboss.portal.junit.Result;
15 import org.jboss.portal.junit.ClientSession;
16
17 /**
18  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
19  * @version $Revision: 1.2 $
20  */

21 public class PreferencesSpecTestCase extends AbstractTestCase
22 {
23
24    public PreferencesSpecTestCase(String JavaDoc name)
25    {
26       super(name);
27    }
28
29
30    /**
31     * PLT.14.1 XC
32     */

33    public void testPreferencesCanBeSetToNull() throws Throwable JavaDoc
34    {
35       ClientSession session = createSession();
36       session.deploy("test-preferences");
37       Result result = start(session, "PreferencesCanBeSetToNullPortlet");
38       result = doGet(session, result, "PreferencesCanBeSetToNullPortlet");
39       result = doGet(session, result, "PreferencesCanBeSetToNullPortlet");
40       check(result, 2);
41       session.close();
42    }
43
44    /**
45     * PLT.14.1 XCI
46     */

47    public void testPreferencesMapModificationDoesNotModifyPreferencesValues() throws Throwable JavaDoc
48    {
49       ClientSession session = createSession();
50       session.deploy("test-preferences");
51       Result result = start(session, "PreferencesMapModificationDoesNotModifyPreferencesValuesPortlet");
52       result = doGet(session, result, "PreferencesMapModificationDoesNotModifyPreferencesValuesPortlet");
53       check(result, 1);
54       session.close();
55    }
56
57    /**
58     * PLT.14.1 XCII
59     */

60    public void testResetPreferenceHavingNoDefaultValueDeletesIt() throws Throwable JavaDoc
61    {
62       ClientSession session = createSession();
63       session.deploy("test-preferences");
64       Result result = start(session, "ResetPreferenceHavingNoDefaultValueDeletesItPortlet");
65       result = doGet(session, result, "ResetPreferenceHavingNoDefaultValueDeletesItPortlet");
66       result = doGet(session, result, "ResetPreferenceHavingNoDefaultValueDeletesItPortlet");
67       result = doGet(session, result, "ResetPreferenceHavingNoDefaultValueDeletesItPortlet");
68       check(result, 3);
69       session.close();
70    }
71
72    /**
73     * PLT.14.1 XCIII
74     */

75    public void testReadOnlyPreferenceCannotBeModified() throws Throwable JavaDoc
76    {
77       ClientSession session = createSession();
78       session.deploy("test-preferences");
79       Result result = start(session, "ReadOnlyPreferenceCannotBeModifiedPortlet");
80       result = doGet(session, result, "ReadOnlyPreferenceCannotBeModifiedPortlet");
81       check(result, 1);
82       session.close();
83    }
84
85    /**
86     * PLT.14.1 XCIV
87     */

88    public void testStoreMustPersistAllChanges() throws Throwable JavaDoc
89    {
90       ClientSession session = createSession();
91       session.deploy("test-preferences");
92       Result result = start(session, "StoreMustPersistAllChangesPortlet");
93       result = doGet(session, result, "StoreMustPersistAllChangesPortlet");
94       result = doGet(session, result, "StoreMustPersistAllChangesPortlet");
95       check(result, 2);
96       session.close();
97    }
98
99    /**
100     * PLT.14.1 XCV
101     */

102    public void testStoreMethodMustBeAtomic()
103    {
104
105    }
106
107    /**
108     * PLT.14.1 XCVI
109     */

110    public void testChangesMadeButNotStoredAreDiscarded() throws Throwable JavaDoc
111    {
112       ClientSession session = createSession();
113       session.deploy("test-preferences");
114       Result result = start(session, "ChangesMadeButNotStoredAreDiscardedPortlet");
115       result = doGet(session, result, "ChangesMadeButNotStoredAreDiscardedPortlet");
116       result = doGet(session, result, "ChangesMadeButNotStoredAreDiscardedPortlet");
117       check(result, 2);
118       session.close();
119    }
120
121    /**
122     * PLT.14.1 XCVII
123     */

124    public void testStoreCalledDuringRenderThrowsIllegalArgumentException() throws Throwable JavaDoc
125    {
126       ClientSession session = createSession();
127       session.deploy("test-preferences");
128       Result result = start(session, "StoreCalledDuringRenderThrowsIllegalArgumentExceptionPortlet");
129       check(result, 1);
130       session.close();
131    }
132
133    /**
134     * PLT.14.1 XCVIII
135     */

136    public void testPortletPreferencesObjectMustReflectCurrentValuesOfThePersistentStore() throws Throwable JavaDoc
137    {
138       // ???
139
}
140
141    /**
142     * PLT.14.1 XCIX
143     */

144    public void testCanModifyNonReadOnlyPreference() throws Throwable JavaDoc
145    {
146       ClientSession session = createSession();
147       session.deploy("test-preferences");
148       Result result = start(session, "CanModifyNonReadOnlyPreferencePortlet");
149       result = doGet(session, result, "CanModifyNonReadOnlyPreferencePortlet");
150       result = doGet(session, result, "CanModifyNonReadOnlyPreferencePortlet");
151       check(result, 2);
152       session.close();
153    }
154
155    /**
156     * PLT.14.1 C
157     */

158    public void testDynamicPreferenceTreatedLikeModifiablePreference() throws Throwable JavaDoc
159    {
160       ClientSession session = createSession();
161       session.deploy("test-preferences");
162       Result result = start(session, "DynamicPreferenceTreatedLikeModifiablePreferencePortlet");
163       result = doGet(session, result, "DynamicPreferenceTreatedLikeModifiablePreferencePortlet");
164       result = doGet(session, result, "DynamicPreferenceTreatedLikeModifiablePreferencePortlet");
165       result = doGet(session, result, "DynamicPreferenceTreatedLikeModifiablePreferencePortlet");
166       check(result, 3);
167       session.close();
168    }
169
170    /**
171     * PLT.14.1 CI
172     * PLT.14.1 CII
173     */

174    public void testCreateASingleInstanceOfValidator() throws Throwable JavaDoc
175    {
176       ClientSession session = createSession();
177       session.deploy("test-preferences");
178       Result result = start(session, "CreateASingleInstanceOfValidatorPortlet");
179       check(result, 1);
180       session.close();
181    }
182
183    /**
184     * PLT.14.1 CIII
185     */

186    public void testInvokeValidatorValidateBeforeWritingChanges()
187    {
188    }
189
190    /**
191     * PLT.14.1 CIV
192     */

193    public void testInvalidationCancelsStore() throws Throwable JavaDoc
194    {
195       ClientSession session = createSession();
196       session.deploy("test-preferences");
197       Result result = start(session, "InvalidationCancelsStorePortlet");
198       result = doGet(session, result, "InvalidationCancelsStorePortlet");
199       result = doGet(session, result, "InvalidationCancelsStorePortlet");
200       check(result, 2);
201       session.close();
202    }
203
204    /**
205     * PLT.14.1 CV
206     */

207    public void testValidationStores() throws Throwable JavaDoc
208    {
209       ClientSession session = createSession();
210       session.deploy("test-preferences");
211       Result result = start(session, "ValidationStoresPortlet");
212       result = doGet(session, result, "ValidationStoresPortlet");
213       result = doGet(session, result, "ValidationStoresPortlet");
214       check(result, 2);
215       session.close();
216    }
217 }
218
Popular Tags