Class GeolocationIntegrationTest
java.lang.Object
org.igniterealtime.smack.inttest.AbstractSmackIntTest
org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
org.jivesoftware.smackx.geolocation.GeolocationIntegrationTest
@SpecificationReference(document="XEP-0080",
version="1.9")
public class GeolocationIntegrationTest
extends AbstractSmackIntegrationTest
-
Nested Class Summary
Nested classes/interfaces inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
AbstractSmackIntTest.Condition
-
Field Summary
Fields inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
connection, connections, conOne, conThree, conTwo
Fields inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
INSECURE_RANDOM, LOGGER, sinttestConfiguration, testRunId, timeout
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
publishAndWait
(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.geoloc.packet.GeoLocation data) Publish data using PEP, and block until the server has echoed the publication back to the publishing user.void
registerListenerAndWait
(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.geoloc.packet.GeoLocation> listener) Registers a listener for GeoLocation data.void
Verifies that a notification is sent when a publication is received, assuming that notification filtering has been adjusted to allow for the notification to be delivered.void
Verifies that a notification for a previously sent publication is received as soon as notification filtering has been adjusted to allow for the notification to be delivered.void
unregisterListener
(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.geoloc.packet.GeoLocation> listener) The functionally reverse ofregisterListenerAndWait(GeoLocationManager, ServiceDiscoveryManager, PepEventListener)
with the difference of not being a blocking operation.void
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
performActionAndWaitForPresence
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
assertResult, assertResult, assertResult, assertResult, createNewTempFile, getHttpUrlConnectionFor, performActionAndWaitUntilStanzaReceived, waitUntilTrue
-
Constructor Details
-
GeolocationIntegrationTest
-
-
Method Details
-
unsubscribe
@AfterClass public void unsubscribe() throws org.jivesoftware.smack.SmackException.NotLoggedInException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException- Throws:
org.jivesoftware.smack.SmackException.NotLoggedInException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
InterruptedException
-
testNotification
Verifies that a notification is sent when a publication is received, assuming that notification filtering has been adjusted to allow for the notification to be delivered.- Throws:
Exception
- if the test fails
-
testNotificationAfterFilterChange
Verifies that a notification for a previously sent publication is received as soon as notification filtering has been adjusted to allow for the notification to be delivered.- Throws:
Exception
- if the test fails
-
registerListenerAndWait
public void registerListenerAndWait(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.geoloc.packet.GeoLocation> listener) throws Exception Registers a listener for GeoLocation data. This implicitly publishes a CAPS update to include a notification filter for the geolocation node. This method blocks until the server has indicated that this update has been received.- Parameters:
geoManager
- The GeoLocationManager instance for the connection that is expected to receive data.discoManager
- The ServiceDiscoveryManager instance for the connection that is expected to publish data.listener
- A listener instance for GeoLocation data that is to be registered.- Throws:
Exception
- if the test fails
-
unregisterListener
public void unregisterListener(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.geoloc.packet.GeoLocation> listener) The functionally reverse ofregisterListenerAndWait(GeoLocationManager, ServiceDiscoveryManager, PepEventListener)
with the difference of not being a blocking operation.- Parameters:
geoManager
- The GeoLocationManager instance for the connection that was expected to receive data.listener
- A listener instance for GeoLocation data that is to be removed.
-
publishAndWait
public void publishAndWait(org.jivesoftware.smackx.geoloc.GeoLocationManager geoManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.geoloc.packet.GeoLocation data) throws Exception Publish data using PEP, and block until the server has echoed the publication back to the publishing user.- Parameters:
geoManager
- The GeoLocationManager instance for the connection that is expected to publish data.discoManager
- The ServiceDiscoveryManager instance for the connection that is expected to publish data.data
- The data to be published.- Throws:
Exception
- if the test fails
-