1 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 25 26 public class QuickServerTest extends TestCase { 27 private QuickServer server; 28 29 public QuickServerTest(String 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 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 [] store = new Object []{"test123"}; 70 server.setStoreObjects(store); 71 assertEquals(store, server.getStoreObjects() ); 72 } 73 74 public void testQuickServerAppLogger() { 76 assertNotNull(server.getAppLogger()); 77 } 78 } 79 | Popular Tags |