1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

[sinttest] Allow maxPayloadChunks == 0

This commit is contained in:
Florian Schmaus 2021-03-15 19:21:55 +01:00
parent d75cd2acb8
commit ad8eeebc0d

View file

@ -90,7 +90,13 @@ public class XmppConnectionStressTest {
MessageBuilder messageBuilder = fromConnection.getStanzaFactory().buildMessageStanza(); MessageBuilder messageBuilder = fromConnection.getStanzaFactory().buildMessageStanza();
messageBuilder.to(toConnection.getUser()); messageBuilder.to(toConnection.getUser());
int payloadChunkCount = random.nextInt(configuration.maxPayloadChunks) + 1; final int payloadChunkCount;
if (configuration.maxPayloadChunks == 0) {
payloadChunkCount = 0;
} else {
payloadChunkCount = random.nextInt(configuration.maxPayloadChunks) + 1;
}
for (int c = 0; c < payloadChunkCount; c++) { for (int c = 0; c < payloadChunkCount; c++) {
int payloadChunkSize = random.nextInt(configuration.maxPayloadChunkSize) + 1; int payloadChunkSize = random.nextInt(configuration.maxPayloadChunkSize) + 1;
String payloadCunk = StringUtils.randomString(payloadChunkSize, random); String payloadCunk = StringUtils.randomString(payloadChunkSize, random);