comparison test/sematest/TestInterManagerSession.java @ 373:ab4405cd3351 current-release **INVALID**

looks like we are done. Wait for further test.
author kono
date Wed, 22 Oct 2008 02:53:12 +0900
parents c432755c3555
children c78569ab5fce
comparison
equal deleted inserted replaced
372:e16b6326fdac 373:ab4405cd3351
66 ); 66 );
67 } 67 }
68 68
69 } 69 }
70 }; 70 };
71 private int inscnt=2;
71 72
72 private void startEditor(SessionManager m) { 73 private void startEditor(SessionManager m) {
73 for(TestEditor editor:editors) { 74 for(TestEditor editor:editors) {
74 if(editor.getPort()==m.getPort()) { 75 if(editor.getPort()==m.getPort()) {
75 logger.writeLog("Start client "+editor); 76 logger.writeLog("Start client "+editor);
99 } 100 }
100 for(int i=0;i<e;i++) { 101 for(int i=0;i<e;i++) {
101 int port = editorPort[i%editorPort.length]; 102 int port = editorPort[i%editorPort.length];
102 boolean master = editorMaster[i%editorMaster.length]; 103 boolean master = editorMaster[i%editorMaster.length];
103 // TestEditor extends Thread 104 // TestEditor extends Thread
105 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>();
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"));
104 editors[i] = new TestEditor("Editor"+i,host,port,master); 108 editors[i] = new TestEditor("Editor"+i,host,port,master);
109 editors[i].setCommand(cmds);
105 } 110 }
106 setupEditor0(); 111 setupEditor0();
107 } 112 }
108 113
109 private void setupEditor0() { 114 private void setupEditor0() {
112 * Define pending command and set null command for now. 117 * Define pending command and set null command for now.
113 */ 118 */
114 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>(); 119 LinkedList<REPCommand>cmds = new LinkedList<REPCommand>();
115 //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"));
116 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"));
117 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"));
118 //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"));
119 editorStartCmds = cmds; 124 editorStartCmds = cmds;
120 LinkedList<REPCommand>nullcmds = new LinkedList<REPCommand>(); 125 LinkedList<REPCommand>nullcmds = new LinkedList<REPCommand>();
121 editors[0].setCommand(nullcmds); 126 editors[0].setCommand(nullcmds);
122 } 127 }