Mercurial > hg > RemoteEditor > Eclipse
diff src/pathfinder/mergetest/TestMerger.java @ 125:34b15dfcb83e
UsersSimulator
author | kent |
---|---|
date | Tue, 25 Dec 2007 20:07:37 +0900 |
parents | f18510fc40e2 |
children | b56b5950cb18 |
line wrap: on
line diff
--- a/src/pathfinder/mergetest/TestMerger.java Tue Dec 25 16:21:30 2007 +0900 +++ b/src/pathfinder/mergetest/TestMerger.java Tue Dec 25 20:07:37 2007 +0900 @@ -9,6 +9,7 @@ private NetworkSimulator<REPCommand> ns=null; private LinkedList<EditorSimulator> editors; private SeMaSimulator<REPCommand> sema; + private UsersSimulator users; public TestMerger(){ editors = new LinkedList<EditorSimulator>(); @@ -25,10 +26,10 @@ /* create, initialize and start test. */ tm = new TestMerger(); - tm.init(false, i, j); + tm.init(true, i, j); tm.startTest(); - tm.printAllTexts(); + //tm.printAllTexts(); //if (!tm.checkCS()) // System.out.println("Error!! :some ChannelSimulator still have packet!"); if (!tm.checkEquality()) @@ -42,7 +43,10 @@ ee.start(); } /* start SessionManager if it exist. */ + if (sema!=null) sema.init(); if (sema!=null) sema.start(); + users.init(); + users.start(); /* wait Editors finish. */ for (EditorSimulator ee: editors){ @@ -66,12 +70,16 @@ sema = null; } + /* create UsersSimulator. */ + users = new UsersSimulator(ns, ne, np*ne); + /* create ne Editors and np commands. */ for (int i=0; i<ne; i++){ LinkedList<REPCommand> cmds = new LinkedList<REPCommand>(); // 各エディタが送信するコマンド列を生成 /* create command list. */ + /* for (int j=0; j<np; j++){ String str = "created by Editor"+i+":"+j; REPCommand cmd = new REPCommand(REP.REPCMD_INSERT, @@ -80,6 +88,7 @@ str.length(), str); cmds.add( cmd); } + */ /* create a Editor, and pass command list to it. */ EditorSimulator ee = new EditorSimulator(i, ns, cmds, "Editor"+i);