Package org.jivesoftware.smackx.mood
Class MoodIntegrationTest
- java.lang.Object
-
- org.igniterealtime.smack.inttest.AbstractSmackIntTest
-
- org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
-
- org.jivesoftware.smackx.mood.MoodIntegrationTest
-
@SpecificationReference(document="XEP-0107") public class MoodIntegrationTest 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
Constructors Constructor Description MoodIntegrationTest(SmackIntegrationTestEnvironment environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
publishAndWait(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.mood.Mood data)
Publish data using PEP, and block until the server has echoed the publication back to the publishing user.void
registerListenerAndWait(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.mood.element.MoodElement> listener)
Registers a listener for User Tune data.void
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.void
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.void
unregisterListener(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.mood.element.MoodElement> listener)
The functionally reverse ofregisterListenerAndWait(MoodManager, ServiceDiscoveryManager, PepEventListener)
with the difference of not being a blocking operation.void
unsubscribe()
-
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest
performActionAndWaitForPresence
-
Methods inherited from class org.igniterealtime.smack.inttest.AbstractSmackIntTest
assertResult, assertResult, createNewTempFile, getHttpUrlConnectionFor, performActionAndWaitUntilStanzaReceived, waitUntilTrue
-
-
-
-
Constructor Detail
-
MoodIntegrationTest
public MoodIntegrationTest(SmackIntegrationTestEnvironment environment)
-
-
Method Detail
-
unsubscribe
@AfterClass public void unsubscribe() throws org.jivesoftware.smack.SmackException.NotLoggedInException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException
- Throws:
org.jivesoftware.smack.SmackException.NotLoggedInException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
org.jivesoftware.smack.SmackException.NoResponseException
-
testNotification
@SmackIntegrationTest public void testNotification() throws java.lang.Exception
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:
java.lang.Exception
- if the test fails
-
testNotificationAfterFilterChange
@SmackIntegrationTest public void testNotificationAfterFilterChange() throws java.lang.Exception
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:
java.lang.Exception
- if the test fails
-
registerListenerAndWait
public void registerListenerAndWait(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.mood.element.MoodElement> listener) throws java.lang.Exception
Registers a listener for User Tune data. This implicitly publishes a CAPS update to include a notification filter for the mood node. This method blocks until the server has indicated that this update has been received.- Parameters:
moodManager
- The MoodManager 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 Mood data that is to be registered.- Throws:
java.lang.Exception
- if the test fails
-
unregisterListener
public void unregisterListener(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.mood.element.MoodElement> listener)
The functionally reverse ofregisterListenerAndWait(MoodManager, ServiceDiscoveryManager, PepEventListener)
with the difference of not being a blocking operation.- Parameters:
moodManager
- The MoodManager instance for the connection that was expected to receive data.listener
- A listener instance for Mood data that is to be removed.
-
publishAndWait
public void publishAndWait(org.jivesoftware.smackx.mood.MoodManager moodManager, org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager, org.jivesoftware.smackx.mood.Mood data) throws java.lang.Exception
Publish data using PEP, and block until the server has echoed the publication back to the publishing user.- Parameters:
moodManager
- The MoodManager 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:
java.lang.Exception
- if the test fails
-
-