use of org.apache.qpid.disttest.message.CreateParticipantCommand in project qpid-broker-j by apache.
the class TestInstance method createCommands.
public List<CommandForClient> createCommands() {
List<CommandForClient> commands = _testConfig.createCommands();
List<CommandForClient> newCommands = new ArrayList<CommandForClient>(commands.size());
double ratePerProducer = calculateRatePerProducer(_producerRate, commands);
for (CommandForClient commandForClient : commands) {
String clientName = commandForClient.getClientName();
Command command = commandForClient.getCommand();
_iterationValue.applyToCommand(command);
if (command instanceof CreateProducerCommand) {
CreateProducerCommand producerCommand = (CreateProducerCommand) command;
producerCommand.setRate(ratePerProducer);
}
if (command instanceof CreateParticipantCommand) {
CreateParticipantCommand participantCommand = (CreateParticipantCommand) command;
if ((participantCommand.getNumberOfMessages() <= 0 && participantCommand.getMaximumDuration() <= 0)) {
throw new DistributedTestException("Test '" + getName() + "' must specify a positive integer value for numberOfMessages or maximumDuration");
}
}
newCommands.add(new CommandForClient(clientName, command));
}
return newCommands;
}
Aggregations