218
|
1 package test.sematest;
|
|
2
|
231
|
3 import java.nio.ByteBuffer;
|
229
|
4 import java.util.LinkedList;
|
218
|
5
|
|
6 import rep.REP;
|
|
7 import rep.REPCommand;
|
|
8
|
|
9 public class PutTester extends Tester {
|
|
10
|
|
11 public PutTester(String name, String _host, int _port) {
|
|
12 super(name, _host, _port);
|
|
13 }
|
229
|
14
|
231
|
15 @Override
|
|
16 public void sendCommands(){
|
|
17 if(commandList == null) return;
|
|
18 if(channel == null) return;
|
|
19
|
|
20 REPCommand command = commandList.get(0);
|
|
21 for(int i = 0; i < 5; i++){
|
|
22 channel.write(command);
|
|
23 ns.writeLog("send command : "+command, 1);
|
|
24 }
|
|
25 }
|
|
26
|
229
|
27 public static void main(String[] args){
|
|
28
|
218
|
29 REPCommand command = new REPCommand();
|
|
30 command.setCMD(REP.SMCMD_PUT);
|
227
|
31 command.setString("PutTest.txt");
|
231
|
32 LinkedList<REPCommand> commands = new LinkedList<REPCommand>();
|
|
33 commands.add(command);
|
218
|
34
|
229
|
35 Tester tester = new PutTester("PutTester", "localhost", 8766);
|
231
|
36 tester.setCommands(commands);
|
218
|
37 tester.start();
|
|
38 }
|
|
39
|
|
40 }
|