comparison test/sematest/TestInterManagerSession.java @ 385:1fca50ce3508

first-working-version
author one@firefly.cr.ie.u-ryukyu.ac.jp
date Mon, 10 Nov 2008 22:18:14 +0900
parents 4b87f89b3afd
children 2cf5392b2a9f
comparison
equal deleted inserted replaced
384:bcdf5476b8e4 385:1fca50ce3508
66 ); 66 );
67 } 67 }
68 68
69 } 69 }
70 }; 70 };
71 private int inscnt=2; 71 //private int inscnt=2;
72 72
73 private void startEditor(SessionManager m) { 73 private void startEditor(SessionManager m) {
74 for(TestEditor editor:editors) { 74 for(TestEditor editor:editors) {
75 if(editor.getPort()==m.getPort()) { 75 if(editor.getPort()==m.getPort()) {
76 logger.writeLog("Start client "+editor); 76 logger.writeLog("Start client "+editor);
102 int port = editorPort[i%editorPort.length]; 102 int port = editorPort[i%editorPort.length];
103 boolean master = editorMaster[i%editorMaster.length]; 103 boolean master = editorMaster[i%editorMaster.length];
104 // TestEditor extends Thread 104 // TestEditor extends Thread
105 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>(); 105 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>();
106 cmds.add(new REPCommand(REP.SMCMD_JOIN,0,0,0,0,"")); 106 cmds.add(new REPCommand(REP.SMCMD_JOIN,0,0,0,0,""));
107 if (inscnt-->0) cmds.add(new REPCommand(REP.REPCMD_INSERT,0,0,0,0,"m0")); 107 //if (inscnt-->0) cmds.add(new REPCommand(REP.REPCMD_INSERT,0,0,0,0,"m0"));
108 editors[i] = new TestEditor("Editor"+i,host,port,master); 108 editors[i] = new TestEditor("Editor"+i,host,port,master);
109 editors[i].setCommand(cmds); 109 //editors[i].setCommand(cmds);
110 } 110 }
111 setupEditor0(); 111 setupEditor0();
112 } 112 }
113 113
114 private void setupEditor0() { 114 private void setupEditor0() {
117 * Define pending command and set null command for now. 117 * Define pending command and set null command for now.
118 */ 118 */
119 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>(); 119 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>();
120 //cmds.add(new REPCommand(REP.SMCMD_JOIN,0,0,0,0,"Editor0-file")); 120 //cmds.add(new REPCommand(REP.SMCMD_JOIN,0,0,0,0,"Editor0-file"));
121 cmds.add(new REPCommand(REP.SMCMD_PUT,0,0,0,0,"Editor0-file")); 121 cmds.add(new REPCommand(REP.SMCMD_PUT,0,0,0,0,"Editor0-file"));
122 //cmds.add(new REPCommand(REP.REPCMD_INSERT,0,0,0,0,"m0")); 122 cmds.add(new REPCommand(REP.REPCMD_INSERT,0,0,0,0,"m0"));
123 //cmds.add(new REPCommand(REP.REPCMD_DELETE,0,0,0,0,"m0")); 123 cmds.add(new REPCommand(REP.REPCMD_DELETE,0,0,0,0,"m0"));
124 editorStartCmds = cmds; 124 editorStartCmds = cmds;
125 LinkedList<REPCommand>nullcmds = new LinkedList<REPCommand>(); 125 LinkedList<REPCommand>nullcmds = new LinkedList<REPCommand>();
126 editors[0].setCommand(nullcmds); 126 editors[0].setCommand(nullcmds);
127 } 127 }
128 128