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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def test_call(self): with self._create_client() as client: msg = dummyTextGenerator(1024) res = client.Test.echo(text=msg) self.assertEqual(msg, res)