Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20D1217E3F for ; Wed, 28 Jan 2015 17:30:34 +0000 (UTC) Received: (qmail 89165 invoked by uid 500); 28 Jan 2015 17:30:34 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 89139 invoked by uid 500); 28 Jan 2015 17:30:34 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 89129 invoked by uid 99); 28 Jan 2015 17:30:34 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2015 17:30:34 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 3203FAC019C; Wed, 28 Jan 2015 17:30:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1655396 - in /qpid/dispatch/trunk: src/python_embedded.c tests/system_tests_management.py Date: Wed, 28 Jan 2015 17:30:33 -0000 To: commits@qpid.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150128173034.3203FAC019C@hades.apache.org> Author: aconway Date: Wed Jan 28 17:30:33 2015 New Revision: 1655396 URL: http://svn.apache.org/r1655396 Log: NO-JIRA: Dispatch incorrectly decodes negative small long values into python. Modified: qpid/dispatch/trunk/src/python_embedded.c qpid/dispatch/trunk/tests/system_tests_management.py Modified: qpid/dispatch/trunk/src/python_embedded.c URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/python_embedded.c?rev=1655396&r1=1655395&r2=1655396&view=diff ============================================================================== --- qpid/dispatch/trunk/src/python_embedded.c (original) +++ qpid/dispatch/trunk/src/python_embedded.c Wed Jan 28 17:30:33 2015 @@ -257,7 +257,7 @@ PyObject *qd_field_to_py(qd_parsed_field case QD_AMQP_LONG: case QD_AMQP_SMALLLONG: - result = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) qd_parse_as_long(field)); + result = PyLong_FromLongLong((PY_LONG_LONG)qd_parse_as_long(field)); break; case QD_AMQP_FLOAT: Modified: qpid/dispatch/trunk/tests/system_tests_management.py URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_management.py?rev=1655396&r1=1655395&r2=1655396&view=diff ============================================================================== --- qpid/dispatch/trunk/tests/system_tests_management.py (original) +++ qpid/dispatch/trunk/tests/system_tests_management.py Wed Jan 28 17:30:33 2015 @@ -19,13 +19,14 @@ """System tests for management of qdrouter""" -import unittest, system_test, re, os +import unittest, system_test, re, os, json, sys from qpid_dispatch.management import Node, ManagementError, Url, BadRequestStatus, NotImplementedStatus, NotFoundStatus, ForbiddenStatus from system_test import Qdrouterd, message, retry, wait_ports, Process from proton import ConnectionException from itertools import chain -PREFIX = 'org.apache.qpid.dispatch.' +PREFIX = u'org.apache.qpid.dispatch.' +MANAGEMENT = PREFIX + 'management' CONFIGURATION = PREFIX + 'configurationEntity' OPERATIONAL = PREFIX + 'operationalEntity' LISTENER = PREFIX + 'listener' @@ -251,7 +252,8 @@ class ManagementTest(system_test.TestCas finally: f.close() - def test_entity(self): + def test_dummy(self): + """Test all operations on the dummy test entity""" entity = self.node.read(type=LISTENER, name='l0') self.assertEqual('l0', entity.name) self.assertEqual(str(self.router.ports[0]), entity.port) @@ -300,8 +302,16 @@ class ManagementTest(system_test.TestCas dummy2 = self.node.read(type=DUMMY, name='MyDummy') self.assertEqual(dummy.attributes, dummy2.attributes) - self.assertEqual({'operation': 'callme', 'foo': 'bar', 'type': DUMMY, 'identity': identity}, - dummy.call('callme', foo='bar')) + integers = [0, 1, 42, (2**63)-1, -1, -42, -(2**63)] + test_data = ["bytes", u"string"] + integers + for data in test_data: + try: + self.assertEqual( + {u'operation': u'callme', u'type': DUMMY, u'identity': identity, u'data': data}, + dummy.call('callme', data=data)) + except TypeError, e: + extype, value, trace = sys.exc_info() + raise extype, "data=%r: %s" % (data, value), trace dummy.badattribute = 'Bad' self.assertRaises(BadRequestStatus, dummy.update) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org