KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > imapserver > TestOtherCommandsInSelectedState


1 /***********************************************************************
2  * Copyright (c) 2000-2004 The Apache Software Foundation. *
3  * All rights reserved. *
4  * ------------------------------------------------------------------- *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you *
6  * may not use this file except in compliance with the License. You *
7  * may obtain a copy of the License at: *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
14  * implied. See the License for the specific language governing *
15  * permissions and limitations under the License. *
16  ***********************************************************************/

17
18 package org.apache.james.imapserver;
19
20 import junit.framework.Test;
21 import junit.framework.TestSuite;
22
23 /**
24  * Tests commands which are valid in AUTHENTICATED and NONAUTHENTICATED by running
25  * them in the SELECTED state. Many commands function identically, while others
26  * are invalid in this state.
27  *
28  *
29  * @version $Revision: 1.1.2.3 $
30  */

31 public class TestOtherCommandsInSelectedState
32         extends TestCommandsInAuthenticatedState
33 {
34     public TestOtherCommandsInSelectedState( String JavaDoc name )
35     {
36         super( name );
37     }
38
39     /**
40      * Superclass sets up welcome message and login session in {@link #preElements}.
41      * A "SELECT INBOX" session is then added to these elements.
42      * @throws Exception
43      */

44     public void setUp() throws Exception JavaDoc
45     {
46         super.setUp();
47         addTestFile( "SelectInbox.test", preElements );
48     }
49
50     /**
51      * Provides all tests which should be run in the selected state. Each test name
52      * corresponds to a protocol session file.
53      */

54     public static Test suite() throws Exception JavaDoc
55     {
56         TestSuite suite = new TestSuite();
57         // Not valid in this state
58
suite.addTest( new TestOtherCommandsInSelectedState( "ValidNonAuthenticated" ) );
59
60         // Valid in all states
61
suite.addTest( new TestOtherCommandsInSelectedState( "Capability" ) );
62         suite.addTest( new TestOtherCommandsInSelectedState( "Noop" ) );
63         suite.addTest( new TestOtherCommandsInSelectedState( "Logout" ) );
64
65         // Valid in authenticated state
66
suite.addTest( new TestOtherCommandsInSelectedState( "Create" ) );
67         suite.addTest( new TestOtherCommandsInSelectedState( "ExamineEmpty" ) );
68         suite.addTest( new TestOtherCommandsInSelectedState( "SelectEmpty" ) );
69         suite.addTest( new TestOtherCommandsInSelectedState( "ListNamespace" ) );
70         suite.addTest( new TestOtherCommandsInSelectedState( "ListMailboxes" ) );
71         suite.addTest( new TestOtherCommandsInSelectedState( "Status" ) );
72         suite.addTest( new TestOtherCommandsInSelectedState( "StringArgs" ) );
73         suite.addTest( new TestOtherCommandsInSelectedState( "Subscribe" ) );
74         suite.addTest( new TestOtherCommandsInSelectedState( "Append" ) );
75         suite.addTest( new TestOtherCommandsInSelectedState( "Delete" ) );
76
77         return suite;
78     }
79 }
80
Popular Tags