Ejemplo n.º 1
0
    def test_multiple_flowbuilder(self):
        """Create multiple servers on the same host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt1 = FlowBuilderTransport(host, host)
        fb1 = fbt1.getFlowBuilder()
        fbt2 = FlowBuilderTransport(host, host)
        fb2 = fbt2.getFlowBuilder()
        self.assertEqual(True, fb1.isReady())
        self.assertEqual(True, fb2.isReady())
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb1.shutdown)
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb2.shutdown)
Ejemplo n.º 2
0
    def test_multiple_flowbuilder(self):
        """Create multiple servers on the same host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt1 = FlowBuilderTransport(host, host)
        fb1 = fbt1.getFlowBuilder()
        fbt2 = FlowBuilderTransport(host, host)
        fb2 = fbt2.getFlowBuilder()
        self.assertEqual(True, fb1.isReady())
        self.assertEqual(True, fb2.isReady())
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb1.shutdown)
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb2.shutdown)
Ejemplo n.º 3
0
    def test_multiple_transport_detailed(self):
        """Create multiple servers on the same host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt1 = FlowBuilderTransport(host, host)
        fbt2 = FlowBuilderTransport(host, host)

        # Now test that a message can cross the transports
        host1 = fbt1.getFlowBuilder().hostname()
        host2 = fbt2.getFlowBuilder().hostname()
        self.assertEqual(host1, host2)

        # Shutdown cleanly
        fbt2.shutdown()
        fbt1.shutdown()
Ejemplo n.º 4
0
    def test_multiple_transport_detailed(self):
        """Create multiple servers on the same host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt1 = FlowBuilderTransport(host, host)
        fbt2 = FlowBuilderTransport(host, host)

        # Now test that a message can cross the transports
        host1 = fbt1.getFlowBuilder().hostname()
        host2 = fbt2.getFlowBuilder().hostname()
        self.assertEqual(host1, host2)

        # Shutdown cleanly
        fbt2.shutdown()
        fbt1.shutdown()
Ejemplo n.º 5
0
    def test_single_flowbuilder(self):
        """Create a single server on a host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt = FlowBuilderTransport(host, host)
        fb = fbt.getFlowBuilder()
        self.assertEqual(True, fb.isReady())
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb.shutdown)
Ejemplo n.º 6
0
    def test_single_flowbuilder(self):
        """Create a single server on a host"""

        # Get the hostname
        import platform
        host = platform.node()
        self.assertNotEqual(0, len(host))

        fbt = FlowBuilderTransport(host, host)
        fb = fbt.getFlowBuilder()
        self.assertEqual(True, fb.isReady())
        self.assertRaises(Pyro4.errors.ConnectionClosedError, fb.shutdown)
Ejemplo n.º 7
0
Archivo: factory.py Proyecto: yoyz/xdd
    def buildEndpoint(self, flowSpec):
        """Create an individual endpoint"""
        b = None
        hostIP = flowSpec['ip']
        hostname = flowSpec['hostname']
        if 'localhost' == hostIP:
            b = FlowBuilder()
        else:
            # Build a remote transport
            try:
                trans = FlowBuilderTransport(hostIP, hostname)
                self.remoteTransports.append(trans)
                # Extract the flow builder proxy from the transport
                b = trans.getFlowBuilder()
            except FlowBuilderTransportError:
                raise EndpointCreationError()

        return b