Mercurial > hg > RemoteEditor > REPSessionManager
comparison test/sematest/TestSessionManager.java @ 281:c3969dd625b2
GUIless test routine.
author | kono |
---|---|
date | Sat, 27 Sep 2008 22:55:13 +0900 |
parents | a549bd4dadb8 |
children | c410eda661e8 |
comparison
equal
deleted
inserted
replaced
280:a549bd4dadb8 | 281:c3969dd625b2 |
---|---|
4 import java.util.LinkedList; | 4 import java.util.LinkedList; |
5 | 5 |
6 import rep.REP; | 6 import rep.REP; |
7 import rep.REPCommand; | 7 import rep.REPCommand; |
8 import rep.SessionManager; | 8 import rep.SessionManager; |
9 import rep.SessionManagerEvent; | |
10 import rep.SessionManagerGUI; | |
9 import rep.channel.REPLogger; | 11 import rep.channel.REPLogger; |
10 import rep.channel.REPServerSocketChannel; | 12 import rep.channel.REPServerSocketChannel; |
11 | 13 |
12 | 14 |
13 public class TestSessionManager { | 15 public class TestSessionManager { |
23 String[] strs ={String.valueOf(masterPort), String.valueOf(masterPort)}; | 25 String[] strs ={String.valueOf(masterPort), String.valueOf(masterPort)}; |
24 startSessionManager(strs); | 26 startSessionManager(strs); |
25 | 27 |
26 while(!isStart){ | 28 while(!isStart){ |
27 try { | 29 try { |
28 Thread.sleep(50); | 30 Thread.sleep(5); |
29 } catch (InterruptedException e) { | 31 } catch (InterruptedException e) { |
30 e.printStackTrace(); | 32 e.printStackTrace(); |
31 } | 33 } |
32 } | 34 } |
33 | 35 |
72 | 74 |
73 if(strs.length > 0){ | 75 if(strs.length > 0){ |
74 port = Integer.parseInt(strs[0]); | 76 port = Integer.parseInt(strs[0]); |
75 } | 77 } |
76 | 78 |
77 SessionManager sm = new SessionManager(port); | 79 SessionManager sm = new SessionManager(); |
78 sm.openSelector(); | 80 SessionManagerGUI gui = new testGUI(sm); |
79 sm.init(port,new testGUI(sm)); | |
80 logger.writeLog("TestSessionManager.startSessionManager() : start SessionManager"); | 81 logger.writeLog("TestSessionManager.startSessionManager() : start SessionManager"); |
81 isStart = true; | 82 sm.syncExec(new SessionManagerEvent() { |
82 sm.mainLoop(); | 83 // executed before first select(); |
83 | 84 public void exec() { isStart = true; } |
85 }); | |
86 sm.init(port,gui); | |
84 } catch (InterruptedException e) { | 87 } catch (InterruptedException e) { |
85 e.printStackTrace(); | 88 e.printStackTrace(); |
86 } catch (IOException e) { | 89 } catch (IOException e) { |
87 e.printStackTrace(); | 90 e.printStackTrace(); |
88 } | 91 } |