'Test basic operations.
Setup an XMPPClientFactory, which sets up an XMPPAuthenticator, and let
it produce a protocol instance. Then inspect the instance variables of
the authenticator and XML stream objects.'

def testBasic(self):

    self.client_jid = jid.JID('user@example.com/resource')
    xs = client.XMPPClientFactory(self.client_jid, 'secret').buildProtocol(None)
    self.assertEqual('example.com', xs.authenticator.otherHost)
    self.assertEqual(self.client_jid, xs.authenticator.jid)
    self.assertEqual('secret', xs.authenticator.password)
    (version, tls, sasl, bind, session) = xs.initializers
    self.assertIsInstance(tls, xmlstream.TLSInitiatingInitializer)
    self.assertIsInstance(sasl, SASLInitiatingInitializer)
    self.assertIsInstance(bind, client.BindInitializer)
    self.assertIsInstance(session, client.SessionInitializer)
    self.assertFalse(tls.required)
    self.assertTrue(sasl.required)
    self.assertFalse(bind.required)
    self.assertFalse(session.required)
