1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Introduce StanzaBuilder

As first step to immutable Stanza types.
This commit is contained in:
Florian Schmaus 2019-10-24 15:45:08 +02:00
parent 926c5892ad
commit 5db6191110
134 changed files with 2576 additions and 764 deletions

View file

@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicReference;
import org.jivesoftware.smack.AbstractXMPPConnection;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.StanzaBuilder;
import org.jivesoftware.smack.tcp.XMPPTCPConnection.PacketWriter;
import org.jivesoftware.smack.util.ExceptionUtil;
@ -80,7 +80,7 @@ public class PacketWriterTest {
// full capacity. The +1 is because the writer thread will dequeue one stanza and try to write it into the
// blocking writer.
for (int i = 0; i < XMPPTCPConnection.PacketWriter.QUEUE_SIZE + 1; i++) {
pw.sendStreamElement(new Message());
pw.sendStreamElement(StanzaBuilder.buildMessage().build());
}
final CyclicBarrier barrier = new CyclicBarrier(2);
@ -93,7 +93,7 @@ public class PacketWriterTest {
public void run() {
try {
barrier.await();
pw.sendStreamElement(new Message());
pw.sendStreamElement(StanzaBuilder.buildMessage().build());
// should only return after the pw was interrupted
if (!shutdown) {
prematureUnblocked = true;