Skip to content

Commit e638688

Browse files
committed
support new json response style in sendCommands method
Signed-off-by: Leo Ma <[email protected]>
1 parent b7d184f commit e638688

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/cisco/trex/stateless/TRexTransport.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public RPCResponse sendCommand(TRexCommand command) throws IOException {
6262
}
6363

6464
public RPCResponse[] sendCommands(List<TRexCommand> commands) throws IOException {
65+
if (commands.size() ==1) {
66+
return new RPCResponse[] {sendCommand(commands.get(0))};
67+
}
68+
6569
List<Map<String, Object>> commandList = commands.stream().map(TRexCommand::getParameters).collect(Collectors.toList());
6670

6771
if (commandList.isEmpty()) {

0 commit comments

Comments
 (0)