Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
Expand All @@ -46,6 +50,17 @@ public AdHocCommandIntegrationTest(SmackIntegrationTestEnvironment environment)
super(environment);
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe() throws SmackException.NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}

@SmackIntegrationTest
public void singleStageAdHocCommandTest() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
AdHocCommandManager manOne = AdHocCommandManager.getInstance(conOne);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
import java.nio.charset.StandardCharsets;
import java.util.Arrays;

import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smack.util.StringUtils;
Expand Down Expand Up @@ -55,6 +58,17 @@ public FileTransferIntegrationTest(SmackIntegrationTestEnvironment environment)
dataToSend = StringUtils.insecureRandomString(1024 * 4 * 5).getBytes(StandardCharsets.UTF_8);
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe() throws SmackException.NotLoggedInException, SmackException.NoResponseException, XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}

@SmackIntegrationTest
public void fileTransferTest() throws Exception {
genericfileTransferTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.net.URI;

import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.SmackException.NotLoggedInException;
Expand Down Expand Up @@ -51,6 +52,12 @@ public GeolocationIntegrationTest(SmackIntegrationTestEnvironment environment) {
glm2 = GeoLocationManager.getInstanceFor(conTwo);
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe() throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
Expand All @@ -37,11 +41,21 @@ public VersionIntegrationTest(SmackIntegrationTestEnvironment environment) {
super(environment);
}

@SmackIntegrationTest
public void testVersion() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// TODO put into @BeforeClass method
@BeforeClass
public void subscribe() throws Exception {
VersionManager.setAutoAppendSmackVersion(false);

// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe() throws SmackException.NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}

@SmackIntegrationTest
public void testVersion() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
VersionManager versionManagerOne = VersionManager.getInstanceFor(conOne);
VersionManager versionManagerTwo = VersionManager.getInstanceFor(conTwo);
final String versionName = "Smack Integration Test " + testRunId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.jivesoftware.smackx.mood;

import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.XMPPException;

Expand Down Expand Up @@ -44,10 +45,14 @@ public MoodIntegrationTest(SmackIntegrationTestEnvironment environment) {
mm2 = MoodManager.getInstanceFor(conTwo);
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe()
throws SmackException.NotLoggedInException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException {
public void unsubscribe() throws SmackException.NotLoggedInException, SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import org.igniterealtime.smack.inttest.annotations.AfterClass;
import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection;

Expand All @@ -37,6 +41,7 @@
import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest;
import org.igniterealtime.smack.inttest.annotations.SpecificationReference;

import org.jivesoftware.smack.XMPPException;
import org.jxmpp.jid.Jid;

@SpecificationReference(document = "XEP-0199", version = "2.0.1")
Expand All @@ -52,6 +57,21 @@ public void pingServer() throws NotConnectedException, InterruptedException {
assertTrue(pingManager.pingMyServer());
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conThree, timeout);
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conTwo, conThree, timeout);
}

@AfterClass
public void unsubscribe() throws SmackException.NotLoggedInException, SmackException.NoResponseException, XMPPException.XMPPErrorException, NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conThree);
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conTwo, conThree);
}

private static final class Pinger implements Runnable {
private final List<Jid> toPing;
private final Collection<Future<Boolean>> pongFutures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public SoftwareInfoIntegrationTest(SmackIntegrationTestEnvironment environment)

@BeforeClass
public void setUp() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.net.URI;

import org.igniterealtime.smack.inttest.annotations.BeforeClass;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.SmackException.NotLoggedInException;
import org.jivesoftware.smack.XMPPException;
Expand Down Expand Up @@ -49,10 +50,14 @@ public UserTuneIntegrationTest(SmackIntegrationTestEnvironment environment) thro
utm2 = UserTuneManager.getInstanceFor(conTwo);
}

@BeforeClass
public void subscribe() throws Exception {
// RFC6120 10.5.4 and RFC 6121 8.5.3.1 are at odds with each-other in regard to full-JID IQ delivery. Best possible chance of that happening is with mutual subscription.
IntegrationTestRosterUtil.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout);
}

@AfterClass
public void unsubscribe()
throws SmackException.NotLoggedInException, XMPPException.XMPPErrorException,
SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException {
public void unsubscribe() throws SmackException.NotLoggedInException, SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException {
IntegrationTestRosterUtil.ensureBothAccountsAreNotInEachOthersRoster(conOne, conTwo);
}

Expand Down
Loading