KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > web > config > WebClientConfigTest


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.web.config;
18
19 import java.util.ArrayList JavaDoc;
20 import java.util.List JavaDoc;
21 import java.util.Map JavaDoc;
22
23 import org.alfresco.config.Config;
24 import org.alfresco.config.ConfigElement;
25 import org.alfresco.config.ConfigException;
26 import org.alfresco.config.source.FileConfigSource;
27 import org.alfresco.config.xml.XMLConfigService;
28 import org.alfresco.util.BaseTest;
29 import org.alfresco.web.config.AdvancedSearchConfigElement.CustomProperty;
30 import org.alfresco.web.config.PropertySheetConfigElement.ItemConfig;
31
32 /**
33  * JUnit tests to exercise the capabilities added to the web client config
34  * service
35  *
36  * @author gavinc
37  */

38 public class WebClientConfigTest extends BaseTest
39 {
40    /**
41     * @see junit.framework.TestCase#setUp()
42     */

43    protected void setUp() throws Exception JavaDoc
44    {
45       super.setUp();
46    }
47
48    /**
49     * Tests the property sheet configuration classes
50     */

51    public void testPropertySheetConfig()
52    {
53       // setup the config service
54
String JavaDoc configFile = getResourcesDir() + "test-config.xml";
55       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFile));
56       svc.init();
57
58       // get hold of the property sheet config from the global section
59
Config global = svc.getGlobalConfig();
60       ConfigElement globalPropSheet = global.getConfigElement("property-sheet");
61       assertNotNull("global property sheet element should not be null", globalPropSheet);
62       assertTrue("config element should be an instance of PropertySheetConfigElement",
63             (globalPropSheet instanceof PropertySheetConfigElement));
64
65       // get the property names from the global section and make sure it is the
66
// name property
67
List JavaDoc<String JavaDoc> propNames = ((PropertySheetConfigElement) globalPropSheet).getItemNamesToShow();
68       assertTrue("There should only be one property in the list", propNames.size() == 1);
69       assertTrue("The property name should be 'name'", propNames.get(0).equals("name"));
70
71       // get the config section representing a space aspect and make sure we get
72
// 5 properties
73
Config spaceAspectConfig = svc.getConfig("space-aspect");
74       assertNotNull("Space aspect config should not be null", spaceAspectConfig);
75       PropertySheetConfigElement spacePropConfig = (PropertySheetConfigElement) spaceAspectConfig
76             .getConfigElement("property-sheet");
77       assertNotNull("Space aspect property config should not be null", spacePropConfig);
78       propNames = spacePropConfig.getItemNamesToShow();
79       assertTrue("There should be 6 properties in the list", propNames.size() == 6);
80
81       // make sure the property sheet config has come back with the correct data
82
Map JavaDoc<String JavaDoc, ItemConfig> props = spacePropConfig.getItemsMapToShow();
83       ItemConfig descProp = props.get("description");
84       assertNotNull("description property config should not be null", descProp);
85       assertEquals("display label for description should be 'Description'", descProp.getDisplayLabel(),
86             "Description");
87       assertFalse("read only for description should be 'false'", descProp.isReadOnly());
88
89       ItemConfig createdDataProp = props.get("createddate");
90       assertNotNull("createddate property config should not be null", createdDataProp);
91       assertEquals("display label for createddate should be null", null, createdDataProp.getDisplayLabel());
92       assertTrue("read only for createddate should be 'true'", createdDataProp.isReadOnly());
93
94       ItemConfig iconProp = props.get("icon");
95       assertNotNull("icon property config should not be null", iconProp);
96       assertEquals("display label for icon should be null", null, iconProp.getDisplayLabel());
97       assertFalse("read only for icon should be 'false'", iconProp.isReadOnly());
98    }
99    
100    /**
101     * Tests the config service by retrieving property sheet configuration using
102     * the generic interfaces
103     */

104    public void testGenericConfigElement()
105    {
106       // setup the config service
107
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
108       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
109       svc.init();
110
111       // get the space aspect configuration
112
Config configProps = svc.getConfig("space-aspect");
113       ConfigElement propsToDisplay = configProps.getConfigElement("property-sheet");
114       assertNotNull("property sheet config should not be null", propsToDisplay);
115
116       // get all the property names using the ConfigElement interface methods
117
List JavaDoc<ConfigElement> kids = propsToDisplay.getChildren();
118       List JavaDoc<String JavaDoc> propNames = new ArrayList JavaDoc<String JavaDoc>();
119       for (ConfigElement propElement : propsToDisplay.getChildren())
120       {
121          String JavaDoc value = propElement.getValue();
122          assertNull("property value should be null", value);
123          String JavaDoc propName = propElement.getAttribute("name");
124          propNames.add(propName);
125       }
126
127       assertTrue("There should be 6 properties", propNames.size() == 6);
128       assertFalse("The id attribute should not be present", propsToDisplay.hasAttribute("id"));
129       
130       // make sure the inEditMode and readOnly flags are set correctly on the last property
131
assertEquals("showInEditMode", "false", kids.get(5).getAttribute("showInEditMode"));
132       assertEquals("readOnly", "true", kids.get(5).getAttribute("readOnly"));
133    }
134
135    /**
136     * Tests the config service by retrieving property sheet configuration using
137     * the custom config objects
138     */

139    public void testGetProperties()
140    {
141       // setup the config service
142
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
143       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
144       svc.init();
145       
146       // get the space aspect configuration
147
Config configProps = svc.getConfig("space-aspect");
148       PropertySheetConfigElement propsToDisplay = (PropertySheetConfigElement)configProps.
149             getConfigElement("property-sheet");
150       assertNotNull("property sheet config should not be null", propsToDisplay);
151       
152       // get all the property names using the PropertySheetConfigElement implementation
153
List JavaDoc<String JavaDoc> propNames = propsToDisplay.getItemNamesToShow();
154               
155       // make sure the generic interfaces are also returning the correct data
156
List JavaDoc<ConfigElement> kids = propsToDisplay.getChildren();
157       assertNotNull("kids should not be null", kids);
158       assertTrue("There should be more than one child", kids.size() > 1);
159       
160       assertEquals("There should be 6 properties", propNames.size() == 6, true);
161       assertFalse("The id attribute should not be present", propsToDisplay.hasAttribute("id"));
162    }
163    
164    public void testPropertyEditing()
165    {
166       // setup the config service
167
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
168       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
169       svc.init();
170       
171       Config propEditConfig = svc.getConfig("Property Editing");
172       assertNotNull("Property Editing section should not be null", propEditConfig);
173       
174       PropertySheetConfigElement propSheet = (PropertySheetConfigElement)propEditConfig.
175             getConfigElement("property-sheet");
176       assertNotNull("property-sheet config should not be null", propSheet);
177       
178       // make sure the list of names method works correctly
179
List JavaDoc<String JavaDoc> itemNamesToEdit = propSheet.getEditableItemNamesToShow();
180       assertNotNull("itemNamesToEdit should not be null", itemNamesToEdit);
181       assertEquals("Number of properties", 3, itemNamesToEdit.size());
182       
183       // make sure the property names are correct
184
assertEquals("first property name", "name", itemNamesToEdit.get(0));
185       assertEquals("second property name", "description", itemNamesToEdit.get(1));
186       assertEquals("third property name", "icon", itemNamesToEdit.get(2));
187       
188       // make sure the map has the correct number of items
189
Map JavaDoc<String JavaDoc, ItemConfig> itemsToEditMap = propSheet.getEditableItemsMapToShow();
190       assertNotNull("itemsToEditMap should not be null", itemsToEditMap);
191       assertEquals("Number of properties", 3, itemsToEditMap.size());
192       
193       // make sure the icon property is set as read only
194
ItemConfig item = itemsToEditMap.get("icon");
195       assertNotNull("icon should not be null", item);
196       assertTrue("icon property readOnly status should be true", item.isReadOnly());
197       
198       // make the size property is unavailable
199
item = itemsToEditMap.get("size");
200       assertNull("size should be null", item);
201       
202       // make sure the list has the correct numbe of items
203
List JavaDoc<ItemConfig> itemsToEdit = propSheet.getEditableItemsToShow();
204       assertNotNull("itemsToEdit should not be null", itemsToEdit);
205       assertEquals("Number of properties", 3, itemsToEdit.size());
206    }
207    
208    /**
209     * Tests the custom client configuration objects
210     */

211    public void testClientConfig()
212    {
213       // setup the config service
214
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
215       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
216       svc.init();
217       
218       // get the global config and from that the client config
219
ClientConfigElement clientConfig = (ClientConfigElement)svc.getGlobalConfig().
220          getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
221       assertNotNull("client config", clientConfig);
222       
223       assertEquals("error page", "/jsp/error.jsp", clientConfig.getErrorPage());
224       assertEquals("login page", "/jsp/login.jsp", clientConfig.getLoginPage());
225       assertEquals("home space permission", "Consumer", clientConfig.getHomeSpacePermission());
226       assertEquals("help url", "http://www.alfresco.org/help/webclient", clientConfig.getHelpUrl());
227       assertEquals("edit link type", "http", clientConfig.getEditLinkType());
228       assertEquals("from address", "alfresco@alfresco.org", clientConfig.getFromEmailAddress());
229       assertEquals("recent spaces", 6, clientConfig.getRecentSpacesItems());
230       assertEquals("search minimum", 3, clientConfig.getSearchMinimum());
231       assertTrue("shelf visible", clientConfig.isShelfVisible());
232    }
233    
234    public void testClientOverride()
235    {
236       // setup the config service
237
List JavaDoc<String JavaDoc> configFiles = new ArrayList JavaDoc<String JavaDoc>(2);
238       configFiles.add(getResourcesDir() + "test-config.xml");
239       configFiles.add(getResourcesDir() + "test-config-override.xml");
240       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
241       svc.init();
242         
243       // try and get the global config section
244
Config globalSection = svc.getGlobalConfig();
245       assertNotNull("global section", globalSection);
246       
247       // get the client config
248
ClientConfigElement clientConfig = (ClientConfigElement)globalSection.
249             getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
250       assertNotNull("client config", clientConfig);
251       
252       // make sure the error page is still set as the default
253
assertEquals("error page", "/jsp/error.jsp", clientConfig.getErrorPage());
254       assertEquals("login page", "/jsp/login-override.jsp", clientConfig.getLoginPage());
255       assertEquals("home space permission", "Editor", clientConfig.getHomeSpacePermission());
256       assertEquals("help url", "http://www.somewhere.com/help", clientConfig.getHelpUrl());
257       assertEquals("edit link type", "webdav", clientConfig.getEditLinkType());
258       assertEquals("from address", "me@somewhere.com", clientConfig.getFromEmailAddress());
259       assertEquals("recent spaces", 1, clientConfig.getRecentSpacesItems());
260       assertEquals("search minimum", 10, clientConfig.getSearchMinimum());
261       assertFalse("shelf visible", clientConfig.isShelfVisible());
262    }
263    
264    /**
265     * Tests the navigation config i.e. the custom element reader and config element
266     */

267    public void testNavigation()
268    {
269       // setup the config service
270
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
271       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
272       svc.init();
273
274       // *** Test the returning of a view id override
275
Config testCfg = svc.getConfig("viewid-navigation-result");
276       assertNotNull("viewid-navigation-result config should not be null", testCfg);
277       
278       NavigationConfigElement navCfg = (NavigationConfigElement)testCfg.getConfigElement("navigation");
279       assertNotNull("navigation config should not be null", navCfg);
280       
281       // get the result for the browse view id
282
NavigationResult navResult = navCfg.getOverride("/jsp/browse/browse.jsp", null);
283       assertEquals("result should be '/jsp/forums/forums.jsp'", "/jsp/forums/forums.jsp",
284             navResult.getResult());
285       assertFalse("isOutcome test should be false", navResult.isOutcome());
286       
287       // get the result for the browse outcome
288
navResult = navCfg.getOverride(null, "browse");
289       assertEquals("result should be '/jsp/forums/topics.jsp'", "/jsp/forums/topics.jsp",
290             navResult.getResult());
291       assertFalse("isOutcome test should be false", navResult.isOutcome());
292       
293       // get the result when passing both the browse view id and outcome, make
294
// sure we get the result for the outcome as it should take precedence
295
navResult = navCfg.getOverride("/jsp/browse/browse.jsp", "browse");
296       assertEquals("result should be '/jsp/forums/topics.jsp'", "/jsp/forums/topics.jsp",
297             navResult.getResult());
298       assertFalse("isOutcome test should be false", navResult.isOutcome());
299       
300       // *** Test the returning of an outcome override
301
testCfg = svc.getConfig("outcome-navigation-result");
302       assertNotNull("outcome-navigation-result config should not be null", testCfg);
303       
304       navCfg = (NavigationConfigElement)testCfg.getConfigElement("navigation");
305       assertNotNull("navigation config should not be null", navCfg);
306       
307       // get the result for the browse view id
308
navResult = navCfg.getOverride("/jsp/browse/browse.jsp", null);
309       assertEquals("result should be 'showSomethingElse'", "showSomethingElse",
310             navResult.getResult());
311       assertTrue("isOutcome test should be true", navResult.isOutcome());
312       
313       // get the result for the browse outcome
314
navResult = navCfg.getOverride(null, "browse");
315       assertEquals("result should be 'showSomethingElse'", "showSomethingElse",
316             navResult.getResult());
317       assertTrue("isOutcome test should be true", navResult.isOutcome());
318       
319       // get the result when passing both the browse view id and outcome, make
320
// sure we get the result for the outcome as it should take precedence
321
navResult = navCfg.getOverride("/jsp/browse/browse.jsp", "browse");
322       assertEquals("result should be 'showSomethingElse'", "showSomethingElse",
323             navResult.getResult());
324       assertTrue("isOutcome test should be true", navResult.isOutcome());
325       
326       // *** Test the duplicate result config
327
testCfg = svc.getConfig("duplicate-navigation-overrides");
328       assertNotNull("duplicate-navigation-overrides config should not be null", testCfg);
329       
330       navCfg = (NavigationConfigElement)testCfg.getConfigElement("navigation");
331       assertNotNull("navigation config should not be null", navCfg);
332       
333       // make sure the outcome result is 'newOutcome'
334
navResult = navCfg.getOverride(null, "browse");
335       assertEquals("result should be 'newOutcome'", "newOutcome",
336             navResult.getResult());
337       assertTrue("isOutcome test should be true", navResult.isOutcome());
338       
339       // call getOverride passing a valid view id but an invalid outcome
340
// and make sure the result is null
341
navResult = navCfg.getOverride("/jsp/browse/browse.jsp", "nonExistentOutcome");
342       assertNull("result should be null", navResult);
343    }
344    
345    public void testNavigationGenericConfig()
346    {
347       // setup the config service
348
String JavaDoc configFiles = getResourcesDir() + "test-config.xml";
349       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
350       svc.init();
351       
352       // do a lookup using the generic config elements and make sure the correct
353
// info comes out
354
Config testCfg = svc.getConfig("duplicate-navigation-overrides");
355       assertNotNull("duplicate-navigation-overrides config should not be null", testCfg);
356       
357       ConfigElement ce = testCfg.getConfigElement("navigation");
358       assertNotNull("navigation config should not be null", ce);
359       
360       List JavaDoc<ConfigElement> children = ce.getChildren();
361       assertNotNull(children);
362       
363       // make sure there are 2 children
364
assertEquals("There should be 2 children", 2, children.size());
365       
366       // get the first child and make sure the attributes are correct,
367
// from-view-id should be '/jsp/browse/browse.jsp' and to-view-id
368
// should be '/jsp/forums/forums.jsp'
369
ConfigElement child = children.get(0);
370       String JavaDoc fromViewId = child.getAttribute("from-view-id");
371       String JavaDoc fromOutcome = child.getAttribute("from-outcome");
372       String JavaDoc toViewId = child.getAttribute("to-view-id");
373       String JavaDoc toOutcome = child.getAttribute("to-outcome");
374       
375       assertNull("fromOutcome", fromOutcome);
376       assertNull("toOutcome", toOutcome);
377       assertEquals("fromViewId", "/jsp/browse/browse.jsp", fromViewId);
378       assertEquals("toViewId", "/jsp/forums/forums.jsp", toViewId);
379       
380       // get the second child and make sure the attributes are correct,
381
// from-outcome should be 'browse' and to-outcome should be 'newOutcome'
382
child = children.get(1);
383       fromViewId = child.getAttribute("from-view-id");
384       fromOutcome = child.getAttribute("from-outcome");
385       toViewId = child.getAttribute("to-view-id");
386       toOutcome = child.getAttribute("to-outcome");
387       
388       assertNull("fromViewId", fromViewId);
389       assertNull("toViewId", toViewId);
390       assertEquals("fromOutcome", "browse", fromOutcome);
391       assertEquals("toOutcome", "newOutcome", toOutcome);
392    }
393    
394    public void testLanguages()
395    {
396       // setup the config service
397
List JavaDoc<String JavaDoc> configFiles = new ArrayList JavaDoc<String JavaDoc>(2);
398       configFiles.add(getResourcesDir() + "test-config.xml");
399       configFiles.add(getResourcesDir() + "test-config-override.xml");
400       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
401       svc.init();
402       
403       LanguagesConfigElement config = (LanguagesConfigElement)svc.getConfig("Languages").
404             getConfigElement(LanguagesConfigElement.CONFIG_ELEMENT_ID);
405       assertNotNull("languages config", config);
406       
407       // make sure there are 3 languages returned
408
assertEquals("number of languages", 4, config.getLanguages().size());
409       
410       // make sure they are returned in order
411
assertEquals("first language", "en_US", config.getLanguages().get(0));
412       assertEquals("second language", "fr_FR", config.getLanguages().get(1));
413       assertEquals("third language", "de_DE", config.getLanguages().get(2));
414       assertEquals("fourth language", "ja_JP", config.getLanguages().get(3));
415       
416       // make sure the labels are correct too
417
assertEquals("en_US", "English", config.getLabelForLanguage("en_US"));
418       assertEquals("fr_FR", "French", config.getLabelForLanguage("fr_FR"));
419       assertEquals("de_DE", "German", config.getLabelForLanguage("de_DE"));
420       assertEquals("ja_JP", "Japanese", config.getLabelForLanguage("ja_JP"));
421       
422       // make sure the getChildren method throws an exception
423
try
424       {
425          config.getChildren();
426          fail("getChildren() did not throw an excpetion");
427       }
428       catch (ConfigException ce)
429       {
430          // expected
431
}
432    }
433    
434    public void testAdvancedSearch()
435    {
436       // setup the config service
437
List JavaDoc<String JavaDoc> configFiles = new ArrayList JavaDoc<String JavaDoc>(2);
438       configFiles.add(getResourcesDir() + "test-config.xml");
439       configFiles.add(getResourcesDir() + "test-config-override.xml");
440       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
441       svc.init();
442       
443       AdvancedSearchConfigElement config = (AdvancedSearchConfigElement)svc.getConfig("Advanced Search").
444             getConfigElement(AdvancedSearchConfigElement.CONFIG_ELEMENT_ID);
445       assertNotNull("advanced search config", config);
446       
447       // make sure there are 2 custom types
448
assertEquals("number of content types", 2, config.getContentTypes().size());
449       
450       // make sure they are correct
451
assertEquals("first type", "cm:dictionaryModel", config.getContentTypes().get(0));
452       assertEquals("second type", "fm:post", config.getContentTypes().get(1));
453       
454       // make sure there are 3 custom properties
455
assertEquals("number of content properties", 3, config.getCustomProperties().size());
456       
457       CustomProperty property = config.getCustomProperties().get(0);
458       assertTrue("first property is type", property.Type != null);
459       
460       property = config.getCustomProperties().get(1);
461       assertTrue("second property is aspect", property.Type == null);
462       assertTrue("second property is aspect", property.Aspect != null);
463       assertEquals("second property aspect", "app:simpleworkflow", property.Aspect);
464       assertEquals("second property name", "app:approveStep", property.Property);
465       
466       property = config.getCustomProperties().get(2);
467       assertEquals("third property name", "app:rejectStep", property.Property);
468       assertEquals("third property display id", "reject_step", property.LabelId);
469       
470       // make sure the getChildren method throws an exception
471
try
472       {
473          config.getChildren();
474          fail("getChildren() did not throw an excpetion");
475       }
476       catch (ConfigException ce)
477       {
478          // expected
479
}
480    }
481    
482    public void testViews()
483    {
484       // setup the config service
485
List JavaDoc<String JavaDoc> configFiles = new ArrayList JavaDoc<String JavaDoc>(2);
486       configFiles.add(getResourcesDir() + "test-config.xml");
487       configFiles.add(getResourcesDir() + "test-config-override.xml");
488       XMLConfigService svc = new XMLConfigService(new FileConfigSource(configFiles));
489       svc.init();
490       
491       ViewsConfigElement config = (ViewsConfigElement)svc.getConfig("Views").
492             getConfigElement(ViewsConfigElement.CONFIG_ELEMENT_ID);
493       assertNotNull("views config", config);
494       
495       // make sure there are 4 views
496
List JavaDoc<String JavaDoc> views = config.getViews();
497       assertEquals("configured views", 4, views.size());
498       
499       // make sure the views are correct
500
assertEquals("details view renderer",
501             "org.alfresco.web.ui.common.renderer.data.RichListRenderer$DetailsViewRenderer",
502             views.get(0));
503       assertEquals("icons view renderer",
504             "org.alfresco.web.ui.common.renderer.data.RichListRenderer$IconViewRenderer",
505             views.get(1));
506       assertEquals("list view renderer",
507             "org.alfresco.web.ui.common.renderer.data.RichListRenderer$ListViewRenderer",
508             views.get(2));
509       assertEquals("bubble view renderer",
510             "org.alfresco.web.bean.ForumsBean$TopicBubbleViewRenderer", views.get(3));
511
512       // test default views
513
assertEquals("default view", "details", config.getDefaultView("not-there"));
514       assertEquals("default view for topic", "bubble", config.getDefaultView("topic"));
515       
516       // test page sizes
517
assertEquals("default page size", 10, config.getDefaultPageSize("not", "there"));
518       assertEquals("forums icons page size", 20, config.getDefaultPageSize("forums", "icons"));
519       assertEquals("forum details page size", 50, config.getDefaultPageSize("forum", "details"));
520       assertEquals("icons view page size", 9, config.getDefaultPageSize("not-there", "icons"));
521       
522       // test the sort columns
523
assertEquals("default sort column", "name", config.getDefaultSortColumn("not-there"));
524       assertEquals("browse page sort column", "name", config.getDefaultSortColumn("browse"));
525       assertEquals("forum page sort column", "modified", config.getDefaultSortColumn("forum"));
526       assertEquals("topic page sort column", "created", config.getDefaultSortColumn("topic"));
527       
528       // test the sorting direction
529
assertFalse("default sort direction should be ascending", config.hasDescendingSort("not-there"));
530       assertFalse("browse screen should use an ascending sort", config.hasDescendingSort("browse"));
531       assertTrue("topic screen should use a descending sort", config.hasDescendingSort("forum"));
532       assertFalse("topic screen should use an ascending sort", config.hasDescendingSort("topic"));
533       
534       // make sure the getChildren method throws an exception
535
try
536       {
537          config.getChildren();
538          fail("getChildren() did not throw an excpetion");
539       }
540       catch (ConfigException ce)
541       {
542          // expected
543
}
544    }
545 }
546
Popular Tags