1 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 21 public class PreferencesSpecTestCase extends AbstractTestCase 22 { 23 24 public PreferencesSpecTestCase(String name) 25 { 26 super(name); 27 } 28 29 30 33 public void testPreferencesCanBeSetToNull() throws Throwable 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 47 public void testPreferencesMapModificationDoesNotModifyPreferencesValues() throws Throwable 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 60 public void testResetPreferenceHavingNoDefaultValueDeletesIt() throws Throwable 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 75 public void testReadOnlyPreferenceCannotBeModified() throws Throwable 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 88 public void testStoreMustPersistAllChanges() throws Throwable 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 102 public void testStoreMethodMustBeAtomic() 103 { 104 105 } 106 107 110 public void testChangesMadeButNotStoredAreDiscarded() throws Throwable 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 124 public void testStoreCalledDuringRenderThrowsIllegalArgumentException() throws Throwable 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 136 public void testPortletPreferencesObjectMustReflectCurrentValuesOfThePersistentStore() throws Throwable 137 { 138 } 140 141 144 public void testCanModifyNonReadOnlyPreference() throws Throwable 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 158 public void testDynamicPreferenceTreatedLikeModifiablePreference() throws Throwable 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 174 public void testCreateASingleInstanceOfValidator() throws Throwable 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 186 public void testInvokeValidatorValidateBeforeWritingChanges() 187 { 188 } 189 190 193 public void testInvalidationCancelsStore() throws Throwable 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 207 public void testValidationStores() throws Throwable 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 |