use of org.jivesoftware.smack.util.Async.ThrowingRunnable in project Smack by igniterealtime.
the class SoftwareInfoIntegrationTest method test.
@SmackIntegrationTest
public void test() throws Exception {
SoftwareInfoForm softwareInfoSent = createSoftwareInfoForm();
performActionAndWaitForPresence(conTwo, conOne, new ThrowingRunnable() {
@Override
public void runOrThrow() throws Exception {
sim1.publishSoftwareInformationForm(softwareInfoSent);
}
});
SoftwareInfoForm softwareInfoFormReceived = sim2.fromJid(conOne.getUser());
assertEquals(softwareInfoSent, softwareInfoFormReceived);
}
use of org.jivesoftware.smack.util.Async.ThrowingRunnable in project Smack by igniterealtime.
the class EntityCapsTest method addFeatureAndWaitForPresence.
/**
* Adds 'feature' to conB and waits until conA observes a presence form conB.
*
* @param conA the connection to observe the presence on.
* @param conB the connection to add the feature to.
* @param feature the feature to add.
* @throws Exception in case of an exception.
*/
private void addFeatureAndWaitForPresence(XMPPConnection conA, XMPPConnection conB, String feature) throws Exception {
final ServiceDiscoveryManager sdmB = ServiceDiscoveryManager.getInstanceFor(conB);
ThrowingRunnable action = new ThrowingRunnable() {
@Override
public void runOrThrow() throws Exception {
sdmB.addFeature(feature);
}
};
performActionAndWaitForPresence(conA, conB, action);
}
Aggregations