def testInvalidConfiguration(self):
        """
        Tests the instantiation of the remote shell with invalid port
        """
        import logging
        logging.basicConfig(level=logging.DEBUG)

        with use_ipopo(self.framework.get_bundle_context()) as ipopo:
            # Check invalid ports
            for port in (-1, 100000, '-100', '65536', 'Abc', None):
                remote = ipopo.instantiate(FACTORY_REMOTE_SHELL,
                                           "remoteShell_test",
                                           {'pelix.shell.port': port})

                # Check that the port is in a valid range
                self.assertGreater(remote.get_access()[1], 0)
                self.assertLess(remote.get_access()[1], 65536)
                ipopo.kill("remoteShell_test")

            # Check empty addresses
            for address in (None, ''):
                remote = ipopo.instantiate(FACTORY_REMOTE_SHELL,
                                           "remoteShell_test",
                                           {'pelix.shell.address': address,
                                            'pelix.shell.port': 0})

                # Check that the address has been selected anyway
                self.assertTrue(remote.get_access()[0])
                ipopo.kill("remoteShell_test")