KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > org > quickserver > net > server > QuickServerTest


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package test.org.quickserver.net.server;
16
17 import org.quickserver.net.server.*;
18 import junit.framework.TestCase;
19 import junit.framework.AssertionFailedError;
20 import java.util.logging.*;
21
22 /**
23  * JUnit test cases for QuickServer
24  */

25
26 public class QuickServerTest extends TestCase {
27     private QuickServer server;
28
29     public QuickServerTest(String JavaDoc name) {
30         super(name);
31     }
32
33     public void setUp(){
34         server = new QuickServer("Test");
35     }
36
37     public void tearDown(){
38         server = null;
39     }
40
41     public static void main(String JavaDoc args[]) {
42         junit.textui.TestRunner.run(QuickServerTest.class);
43     }
44
45     public void testQuickServerStatics() {
46         assertEquals("1.47", ""+QuickServer.getVersionNo() );
47         assertEquals("1.4.7", QuickServer.getVersion() );
48     }
49
50     public void testQuickServerBasic() {
51         assertNotNull(server);
52     }
53
54     public void testQuickServerTimeout() {
55         server.setTimeout(5);
56         assertEquals(5, server.getTimeout() );
57     }
58
59     public void testQuickServerClientCount() {
60         assertEquals(0, server.getClientCount() );
61         assertEquals(true, server.isClosed() );
62     }
63
64     public void testQuickServerBindAddr() {
65         assertNotNull(server.getBindAddr());
66     }
67
68     public void testQuickServerStore() {
69         Object JavaDoc[] store = new Object JavaDoc[]{"test123"};
70         server.setStoreObjects(store);
71         assertEquals(store, server.getStoreObjects() );
72     }
73
74     //v1.2
75
public void testQuickServerAppLogger() {
76         assertNotNull(server.getAppLogger());
77     }
78 }
79
Popular Tags