Beispiel #1
0
    def testSetUp(self):
        client = getUtility(IAdminClient)
        if client._state == 'disconnected':
            zr = getUtility(IZopeReactor)
            zr.reactor.callFromThread(client.connect)

        wait_for_client_state(client, 'authenticated')
        setupXMPPEnvironment(client,
            member_jids=[JID('test_user_1_@localhost')],
            member_passwords={JID('test_user_1_@localhost'): 'secret'})
        wait_on_client_deferreds(client)
Beispiel #2
0
def setup_xmpp(context):
    # Setup existing users
    from jarn.xmpp.core.interfaces import IAdminClient
    from jarn.xmpp.core.subscribers.startup import setupAdminClient
    from jarn.xmpp.core.utils.setup import setupXMPPEnvironment
    from jarn.xmpp.twisted.testing import wait_for_client_state
    from jarn.xmpp.twisted.testing import wait_on_client_deferreds
    setupAdminClient(None, None)

    client = getUtility(IAdminClient)
    wait_for_client_state(client, 'authenticated')
    wait_on_client_deferreds(client)
    setupXMPPEnvironment(context)
    wait_on_client_deferreds(client)
Beispiel #3
0
def setup_xmpp(context):
    # Setup existing users
    from jarn.xmpp.core.interfaces import IAdminClient
    from jarn.xmpp.core.subscribers.startup import setupAdminClient
    from jarn.xmpp.core.utils.setup import setupXMPPEnvironment
    from jarn.xmpp.twisted.testing import wait_for_client_state
    from jarn.xmpp.twisted.testing import wait_on_client_deferreds
    setupAdminClient(None, None)

    client = getUtility(IAdminClient)
    wait_for_client_state(client, 'authenticated')
    wait_on_client_deferreds(client)
    setupXMPPEnvironment(context)
    wait_on_client_deferreds(client)
Beispiel #4
0
    def setup_xmpp(self, action):
        data, errors = self.extractData()

        xmpp_users = getUtility(IXMPPUsers)
        pass_storage = getUtility(IXMPPPasswordStorage)
        mt = getToolByName(self.context, 'portal_membership')
        member_ids = mt.listMemberIds()
        member_jids = []
        member_passwords = {}
        pass_storage.clear()
        for member_id in member_ids:
            member_jid = xmpp_users.getUserJID(member_id)
            member_jids.append(member_jid)
            member_passwords[member_jid] = pass_storage.set(member_id)

        admin = getUtility(IAdminClient)

        def initPubSubStorage(result):
            d = populatePubSubStorage()
            return d

        d = setupXMPPEnvironment(admin, member_jids, member_passwords)
        d.addCallback(initPubSubStorage)
        return d
Beispiel #5
0
 def setup_xmpp(self, action):
     data, errors = self.extractData()
     setupXMPPEnvironment(self.context)
Beispiel #6
0
 def setup_xmpp(self, action):
     data, errors = self.extractData()
     setupXMPPEnvironment(self.context)