changeset 301:d12aac5ab798

*** empty log message ***
author kono
date Wed, 01 Oct 2008 16:51:01 +0900
parents 8f6b7a1890b2
children 4ee012f19855
files test/sematest/TestSessionManager.java
diffstat 1 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/test/sematest/TestSessionManager.java	Wed Oct 01 16:20:04 2008 +0900
+++ b/test/sematest/TestSessionManager.java	Wed Oct 01 16:51:01 2008 +0900
@@ -17,6 +17,18 @@
 	SessionManager slaveSessionManagers[];
 	TestEditor editors[];
 
+	/*
+	 * All test is performed in localhost, so all session manager
+	 * should have differenct port number each other.
+	 */
+	
+	/*
+	 * Test Pattern List
+	 *    Connect port for each editor
+	 *    Master/client flag for each editor
+	 *    Editor or slave session manager must be started by
+	 *      master session manager using syncExec.
+	 */
 	int editorPort[] = {masterPort,masterPort};
 	boolean editorMaster[] = {true,false};
 	SessionManagerEvent ev1[] = {
@@ -33,6 +45,11 @@
 				}
 			}};
 	
+	/*
+	 * Create all editors, master session managers and slave session 
+	 * managers with specfied port. All instances are not started yet.
+	 */
+	
 	public TestSessionManager(int sm, int ss, int e) {
 		sessionManagers = new SessionManager[sm];
 		slaveSessionManagers = new SessionManager[ss];
@@ -46,10 +63,15 @@
 		for(int i=0;i<e;i++) {
 			int port = editorPort[i%editorPort.length];
 			boolean master = editorMaster[i%editorMaster.length];
+			// TestEditor extends Thread
 			editors[i] = new TestEditor("Editor"+i,host,port,master);
 		}
 	}
 
+	/*
+	 * start session manager. sm.init(port,guit) is a mainloop, so
+	 * we need Thread here. 
+	 */
 	private int startSessionManager(final SessionManager sm,int i,int port) {
 		final SessionManagerGUI gui = new TestGUI(sm);
 		final int port1 = port;
@@ -69,6 +91,11 @@
 	}
 
 	public static void main(String[] args){
+		/*
+		 * set simulation mode
+		 *    isSimulation=true     thread base simulation for PathFinder
+		 *    isSimulation=false    socket based communication mode
+		 */
 		REPServerSocketChannel.isSimulation = true;
 		TestSessionManager test = new TestSessionManager(1, 0, 2);
 		logger.setLogLevel(5);