Mercurial > hg > RemoteEditor > REPSessionManager
changeset 236:2abd1dc12453
*** empty log message ***
author | pin |
---|---|
date | Sun, 31 Aug 2008 19:33:23 +0900 |
parents | a8302aa5a495 |
children | c52e0e831d91 |
files | test/sematest/TestSessionManager.java |
diffstat | 1 files changed, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/test/sematest/TestSessionManager.java Sun Aug 31 19:02:56 2008 +0900 +++ b/test/sematest/TestSessionManager.java Sun Aug 31 19:33:23 2008 +0900 @@ -1,6 +1,10 @@ package test.sematest; import java.io.IOException; +import java.util.LinkedList; + +import rep.REP; +import rep.REPCommand; import rep.SessionManager; import rep.channel.REPLogger; import rep.channel.REPServerSocketChannel; @@ -9,6 +13,7 @@ public class TestSessionManager { static public REPLogger logger = REPLogger.singleton(); + protected boolean isStart = false; public TestSessionManager(int sm, int ss, int e) { } @@ -18,7 +23,31 @@ String[] strs ={String.valueOf(masterPort), String.valueOf(masterPort)}; startSessionManager(strs); + while(!isStart){ + try { + Thread.sleep(50); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + logger.writeLog("TestSessionManager.startTest()", 1); + + putTest(); + putTest(); + + } + + private void putTest() { + REPCommand command = new REPCommand(); + command.setCMD(REP.SMCMD_PUT); + command.setString("PutTest.txt"); + LinkedList<REPCommand> commands = new LinkedList<REPCommand>(); + commands.add(command); + + Tester tester = new PutTester("PutTester", "localhost", 8766); + tester.setCommands(commands); + tester.start(); } private void startSessionManager(final String[] strs) { @@ -38,6 +67,7 @@ sm.init(port); logger.writeLog("TestSessionManager.startSessionManager() : start SessionManager"); sm.mainLoop(); + isStart = true; } catch (InterruptedException e) { e.printStackTrace();