'Set up XmlStream and several observers.'

def setUp(self):

    self.gotStreamStart = False
    self.gotStreamEnd = False
    self.gotStreamError = False
    xs = xmlstream.XmlStream(xmlstream.Authenticator())
    xs.addObserver('//event/stream/start', self.onStreamStart)
    xs.addObserver('//event/stream/end', self.onStreamEnd)
    xs.addObserver('//event/stream/error', self.onStreamError)
    xs.makeConnection(proto_helpers.StringTransportWithDisconnection())
    xs.transport.protocol = xs
    xs.namespace = 'testns'
    xs.version = (1, 0)
    self.xmlstream = xs
