Class UserTuneIntegrationTest

    • Constructor Detail

      • UserTuneIntegrationTest

        public UserTuneIntegrationTest​(SmackIntegrationTestEnvironment environment)
                                throws org.jivesoftware.smack.SmackException.NotLoggedInException
        Throws:
        org.jivesoftware.smack.SmackException.NotLoggedInException
    • 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.usertune.UserTuneManager userTuneManager,
                                            org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager,
                                            org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.usertune.element.UserTuneElement> 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 usertune node. This method blocks until the server has indicated that this update has been received.
        Parameters:
        userTuneManager - The UserTuneManager 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 UserTune data that is to be registered.
        Throws:
        java.lang.Exception - if the test fails
      • unregisterListener

        public void unregisterListener​(org.jivesoftware.smackx.usertune.UserTuneManager userTuneManager,
                                       org.jivesoftware.smackx.pep.PepEventListener<org.jivesoftware.smackx.usertune.element.UserTuneElement> listener)
        The functionally reverse of registerListenerAndWait(UserTuneManager, ServiceDiscoveryManager, PepEventListener) with the difference of not being a blocking operation.
        Parameters:
        userTuneManager - The UserTuneManager instance for the connection that was expected to receive data.
        listener - A listener instance for UserTune data that is to be removed.
      • publishAndWait

        public void publishAndWait​(org.jivesoftware.smackx.usertune.UserTuneManager userTuneManager,
                                   org.jivesoftware.smackx.disco.ServiceDiscoveryManager discoManager,
                                   org.jivesoftware.smackx.usertune.element.UserTuneElement data)
                            throws java.lang.Exception
        Publish data using PEP, and block until the server has echoed the publication back to the publishing user.
        Parameters:
        userTuneManager - The UserTuneManager 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