KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opencms > file > TestGroupOperations


1 /*
2  * File : $Source: /usr/local/cvs/opencms/test/org/opencms/file/TestGroupOperations.java,v $
3  * Date : $Date: 2005/06/27 23:22:09 $
4  * Version: $Revision: 1.6 $
5  *
6  * This library is part of OpenCms -
7  * the Open Source Content Mananagement System
8  *
9  * Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Lesser General Public License for more details.
20  *
21  * For further information about Alkacon Software GmbH, please see the
22  * company website: http://www.alkacon.com
23  *
24  * For further information about OpenCms, please see the
25  * project website: http://www.opencms.org
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this library; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */

31  
32 package org.opencms.file;
33
34 import org.opencms.test.OpenCmsTestCase;
35 import org.opencms.test.OpenCmsTestProperties;
36
37 import java.util.List JavaDoc;
38
39 import junit.extensions.TestSetup;
40 import junit.framework.Test;
41 import junit.framework.TestSuite;
42
43 /**
44  * Unit tests for basic group operations without test import.<p>
45  *
46  * @author Carsten Weinholz
47  *
48  * @version $Revision: 1.6 $
49  */

50 public class TestGroupOperations extends OpenCmsTestCase {
51   
52     /**
53      * Default JUnit constructor.<p>
54      *
55      * @param arg0 JUnit parameters
56      */

57     public TestGroupOperations(String JavaDoc arg0) {
58         super(arg0);
59     }
60     
61     /**
62      * Test suite for this test class.<p>
63      *
64      * @return the test suite
65      */

66     public static Test suite() {
67         OpenCmsTestProperties.initialize(org.opencms.test.AllTests.TEST_PROPERTIES_PATH);
68         
69         TestSuite suite = new TestSuite();
70         suite.setName(TestGroupOperations.class.getName());
71
72         suite.addTest(new TestGroupOperations("testGetUsersOfGroup"));
73         
74         TestSetup wrapper = new TestSetup(suite) {
75             
76             protected void setUp() {
77                 setupOpenCms(null, null, false);
78             }
79             
80             protected void tearDown() {
81                 removeOpenCms();
82             }
83         };
84         
85         return wrapper;
86     }
87     
88     /**
89      * Tests the "getUsersOfGroup" method.<p>
90      *
91      * @throws Throwable if something goes wrong
92      */

93     public void testGetUsersOfGroup() throws Throwable JavaDoc {
94         
95         CmsObject cms = getCmsObject();
96         echo("Testing testGetUsersOfGroup");
97         
98         List JavaDoc users = cms.getUsersOfGroup("Guests");
99         assertEquals("Export", ((CmsUser)users.get(0)).getName());
100         assertEquals("Guest", ((CmsUser)users.get(1)).getName());
101     }
102 }
Popular Tags