420
|
1 package test.mergertest;
|
|
2
|
|
3 import java.util.LinkedList;
|
|
4
|
|
5 import rep.REP;
|
|
6 import rep.REPCommand;
|
|
7
|
|
8 public class UserSimulator extends Thread {
|
|
9
|
|
10 private RemoteEditorSimulator editor;
|
|
11 private LinkedList<REPCommand> userInputList;
|
|
12
|
|
13 public UserSimulator(RemoteEditorSimulator editor){
|
|
14 this.editor = editor;
|
|
15
|
|
16 int eid = editor.getEID();
|
|
17 userInputList = new LinkedList<REPCommand>();
|
|
18 int count = 0;
|
|
19 for(int i = 0; i < 3; i++){
|
|
20 userInputList.add(new REPCommand(REP.REPCMD_INSERT_USER, 0, eid, count, 3, " User:" + eid + ":" + i));
|
|
21 count++;
|
|
22 }
|
|
23 }
|
|
24
|
|
25 public void setUserInput(LinkedList<REPCommand> list){
|
|
26 userInputList = list;
|
|
27 }
|
|
28
|
|
29 @Override
|
|
30 public void run(){
|
|
31 for(REPCommand command : userInputList){
|
|
32 editor.edit(command);
|
|
33 }
|
|
34 }
|
|
35
|
|
36 }
|