Class AbstractSmackIntegrationTest

    • Field Detail

      • conOne

        protected final org.jivesoftware.smack.XMPPConnection conOne
        The first connection.
      • conTwo

        protected final org.jivesoftware.smack.XMPPConnection conTwo
        The second connection.
      • conThree

        protected final org.jivesoftware.smack.XMPPConnection conThree
        The third connection.
      • connection

        protected final org.jivesoftware.smack.XMPPConnection connection
        An alias for the first connection conOne.
      • connections

        protected final java.util.List<org.jivesoftware.smack.XMPPConnection> connections
    • Method Detail

      • performActionAndWaitForPresence

        protected void performActionAndWaitForPresence​(org.jivesoftware.smack.XMPPConnection conA,
                                                       org.jivesoftware.smack.XMPPConnection conB,
                                                       org.jivesoftware.smack.util.Async.ThrowingRunnable action)
                                                throws java.lang.Exception
        Perform action and wait until conA observes a presence form conB.

        This method is usually used so that 'action' performs an operation that changes one entities features/nodes/capabilities, and we want to check that another connection is able to observe this change, and use that new "thing" that was added to the connection.

        Note that this method is a workaround at best and not reliable. Because it is not guaranteed that any XEP-0030 related manager, e.g. EntityCapsManager, already processed the presence when this method returns.

        TODO: Come up with a better solution.
        conA - the connection to observe the presence on.
        conB - the connection sending the presence
        action - the action to perform.
        java.lang.Exception - in case of an exception.