'Create a pb server using L{CachedReturner} protocol and connect a
client to it.'

def setUp(self):

    self.orig = NewStyleCacheCopy()
    self.orig.s = 'value'
    self.server = reactor.listenTCP(0, ConnectionNotifyServerFactory(CachedReturner(self.orig)))
    clientFactory = pb.PBClientFactory()
    reactor.connectTCP('localhost', self.server.getHost().port, clientFactory)
    def gotRoot(ref):
        self.ref = ref
    d1 = clientFactory.getRootObject().addCallback(gotRoot)
    d2 = self.server.factory.connectionMade
    return gatherResults([d1, d2])
