~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-05 10:27:33 UTC
  • mto: (5008.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5009.
  • Revision ID: v.ladeuil+lp@free.fr-20100205102733-8wpjnqz6g4nvrbfu
All Conflict action method names start with 'action_' to avoid potential namespace collisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
251
251
        """Get a backing transport from a server we are decorating."""
252
252
        return transport.get_transport(backing_transport_server.get_url())
253
253
 
254
 
    def setUp(self, backing_transport_server=None,
 
254
    def start_server(self, backing_transport_server=None,
255
255
              client_path_extra='/extra/'):
256
256
        """Set up server for testing.
257
257
 
273
273
            backing_transport_server = LocalURLServer()
274
274
        self.chroot_server = ChrootServer(
275
275
            self.get_backing_transport(backing_transport_server))
276
 
        self.chroot_server.setUp()
 
276
        self.chroot_server.start_server()
277
277
        self.backing_transport = transport.get_transport(
278
278
            self.chroot_server.get_url())
279
279
        self.root_client_path = self.client_path_extra = client_path_extra
280
280
        self.start_background_thread(self.thread_name_suffix)
281
281
 
282
 
    def tearDown(self):
 
282
    def stop_server(self):
283
283
        self.stop_background_thread()
284
 
        self.chroot_server.tearDown()
 
284
        self.chroot_server.stop_server()
285
285
 
286
286
    def get_url(self):
287
287
        url = super(SmartTCPServer_for_testing, self).get_url()
386
386
        """Chroot transport, and decorate with userdir expander."""
387
387
        self.base_path = self.get_base_path(transport)
388
388
        chroot_server = chroot.ChrootServer(transport)
389
 
        chroot_server.setUp()
390
 
        self.cleanups.append(chroot_server.tearDown)
 
389
        chroot_server.start_server()
 
390
        self.cleanups.append(chroot_server.stop_server)
391
391
        transport = get_transport(chroot_server.get_url())
392
392
        if self.base_path is not None:
393
393
            # Decorate the server's backing transport with a filter that can
394
394
            # expand homedirs.
395
395
            expand_userdirs = self._make_expand_userdirs_filter(transport)
396
 
            expand_userdirs.setUp()
397
 
            self.cleanups.append(expand_userdirs.tearDown)
 
396
            expand_userdirs.start_server()
 
397
            self.cleanups.append(expand_userdirs.stop_server)
398
398
            transport = get_transport(expand_userdirs.get_url())
399
399
        self.transport = transport
400
400