mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-07 11:31:10 +01:00
Make StanzaCollector final
This commit is contained in:
parent
f4ee7dd541
commit
d20a2675a8
2 changed files with 7 additions and 9 deletions
|
|
@ -30,7 +30,7 @@ public class StanzaCollectorTest {
|
|||
|
||||
@Test
|
||||
public void verifyRollover() throws InterruptedException {
|
||||
TestStanzaCollector collector = new TestStanzaCollector(null, new OKEverything(), 5);
|
||||
StanzaCollector collector = createTestStanzaCollector(null, new OKEverything(), 5);
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
Stanza testPacket = new TestPacket(i);
|
||||
|
|
@ -70,7 +70,7 @@ public class StanzaCollectorTest {
|
|||
@Test
|
||||
public void verifyThreadSafety() throws InterruptedException {
|
||||
final int insertCount = 500;
|
||||
final TestStanzaCollector collector = new TestStanzaCollector(null, new OKEverything(), insertCount);
|
||||
final StanzaCollector collector = createTestStanzaCollector(null, new OKEverything(), insertCount);
|
||||
|
||||
final AtomicInteger consumer1Dequeued = new AtomicInteger();
|
||||
final AtomicInteger consumer2Dequeued = new AtomicInteger();
|
||||
|
|
@ -170,10 +170,8 @@ public class StanzaCollectorTest {
|
|||
|
||||
}
|
||||
|
||||
static class TestStanzaCollector extends StanzaCollector {
|
||||
protected TestStanzaCollector(XMPPConnection conection, StanzaFilter packetFilter, int size) {
|
||||
super(conection, StanzaCollector.newConfiguration().setStanzaFilter(packetFilter).setSize(size));
|
||||
}
|
||||
private static StanzaCollector createTestStanzaCollector(XMPPConnection connection, StanzaFilter packetFilter, int size) {
|
||||
return new StanzaCollector(connection, StanzaCollector.newConfiguration().setStanzaFilter(packetFilter).setSize(size));
|
||||
}
|
||||
|
||||
static class TestPacket extends Stanza {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue