コード例 #1
0
ファイル: jsonRpcTests.py プロジェクト: nirs/vdsm
    def testMethodCallArgDict(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.assertEqual(self._callTimeout(client, "echo",
                                 {'text': data}, CALL_ID), data)
コード例 #2
0
ファイル: jsonRpcTests.py プロジェクト: xiaojiongming/vdsm
    def testMethodCallArgDict(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.assertEqual(
                    self._callTimeout(client, "echo", {'text': data}, CALL_ID),
                    data)
コード例 #3
0
ファイル: jsonRpcTests.py プロジェクト: xiaojiongming/vdsm
    def testMethodCallArgList(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                self.assertEqual(
                    self._callTimeout(client, "echo", (data, ), CALL_ID), data)
コード例 #4
0
ファイル: jsonRpcTests.py プロジェクト: nirs/vdsm
    def testMethodCallArgList(self, ssl):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                self.assertEqual(self._callTimeout(client, "echo",
                                                   (data,), CALL_ID), data)
コード例 #5
0
ファイル: stompTests.py プロジェクト: yingyun001/vdsm
    def test_echo(self, size, use_ssl):
        data = dummyTextGenerator(size)

        with constructAcceptor(self.log, use_ssl, _SampleBridge()) as acceptor:
            sslctx = DEAFAULT_SSL_CONTEXT if use_ssl else None

            with utils.running(
                StandAloneRpcClient(acceptor._host, acceptor._port, "jms.topic.vdsm_requests", str(uuid4()), sslctx)
            ) as client:
                self.assertEquals(client.callMethod("echo", (data,), str(uuid4())), data)
コード例 #6
0
ファイル: jsonRpcTests.py プロジェクト: fancyKai/vdsm
    def testMethodCallArgDict(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                if type == "xml":
                    response = client.send("echo", (data,))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo", {"text": data}, CALL_ID), data)
コード例 #7
0
ファイル: jsonRpcTests.py プロジェクト: fancyKai/vdsm
    def testMethodCallArgDict(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                if type == "xml":
                        response = client.send("echo", (data,))
                        self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo",
                                      {'text': data}, CALL_ID), data)
コード例 #8
0
    def test_echo(self, size, use_ssl):
        data = dummyTextGenerator(size)
        ssl_ctx = self.ssl_ctx if use_ssl else None

        with constructAcceptor(self.log, ssl_ctx, _SampleBridge()) as acceptor:
            with utils.closing(
                    StandAloneRpcClient(acceptor._host, acceptor._port,
                                        'jms.topic.vdsm_requests',
                                        str(uuid4()), ssl_ctx,
                                        False)) as client:
                self.assertEqual(
                    client.callMethod('echo', (data, ), str(uuid4())), data)
コード例 #9
0
ファイル: stompTests.py プロジェクト: rexhsu/vdsm-debian
    def test_echo(self, use_ssl):
        data = dummyTextGenerator(1024)

        with constructAcceptor(self.log, use_ssl, _SampleBridge()) as acceptor:
            sslctx = DEAFAULT_SSL_CONTEXT if use_ssl else None

            with utils.running(
                    StandAloneRpcClient(acceptor._host, acceptor._port,
                                        'jms.topic.vdsm_requests',
                                        str(uuid4()), sslctx)) as client:
                self.assertEquals(
                    client.callMethod('echo', (data, ), str(uuid4())), data)
コード例 #10
0
ファイル: jsonRpcTests.py プロジェクト: oVirtorg/vdsm
    def testMethodCallArgList(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                if type == "xml":
                    response = client.send("echo", (data, ))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(
                        self._callTimeout(client, "echo", (data, ), CALL_ID,
                                          CALL_TIMEOUT), data)
コード例 #11
0
ファイル: jsonRpcTests.py プロジェクト: Caez83/vdsm
    def testMethodCallArgList(self, ssl, type):
        data = dummyTextGenerator(1024)

        bridge = _DummyBridge()
        with constructClient(self.log, bridge, ssl, type) as clientFactory:
            with self._client(clientFactory) as client:
                self.log.info("Calling 'echo'")
                if type == "xml":
                    response = client.send("echo", (data,))
                    self.assertEquals(response, data)
                else:
                    self.assertEquals(self._callTimeout(client, "echo",
                                      (data,), CALL_ID,
                                      CALL_TIMEOUT), data)
コード例 #12
0
    def test_call(self):
        with self._create_client() as client:
            msg = dummyTextGenerator(1024)
            res = client.Test.echo(text=msg)

            self.assertEqual(msg, res)
コード例 #13
0
ファイル: client_test.py プロジェクト: nirs/vdsm
    def test_call(self):
        with self._create_client() as client:
            msg = dummyTextGenerator(1024)
            res = client.Test.echo(text=msg)

            self.assertEqual(msg, res)