Example #1
0
    def testSetUp(cls):
        import Products

        zope.component.testing.setUp(cls)
        zope.component.provideAdapter(DefaultTraversable, (None,))
        zcml.load_config('testing.zcml', Products.ZenTestCase)
        import Products.ZenMessaging.queuemessaging
        load_config_override('nopublisher.zcml', Products.ZenMessaging.queuemessaging)

        # Have to force registering these as they are torn down between tests
        from zenoss.protocols.adapters import registerAdapters
        registerAdapters()

        from twisted.python.runtime import platform
        platform.supportsThreads_orig = platform.supportsThreads
        platform.supportsThreads = lambda : None
Example #2
0
    def testSetUp(cls):
        import Products

        zope.component.testing.setUp(cls)
        zope.component.provideAdapter(DefaultTraversable, (None,))
        zcml.load_config('testing.zcml', Products.ZenTestCase)
        import Products.ZenMessaging.queuemessaging
        load_config_override('nopublisher.zcml', Products.ZenMessaging.queuemessaging)

        # Have to force registering these as they are torn down between tests
        from zenoss.protocols.adapters import registerAdapters
        registerAdapters()

        # Register Model Catalog related stuff
        init_model_catalog_for_tests()

        from twisted.python.runtime import platform
        platform.supportsThreads_orig = platform.supportsThreads
        platform.supportsThreads = lambda : None
Example #3
0
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2010, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################


__import__("pkg_resources").declare_namespace(__name__)

from zenoss.protocols.adapters import registerAdapters

registerAdapters()


class InvalidQueueMessage(Exception):
    """
    Signals that the queue message received something other
    than a protobuf, which we currently do not support.
    """

    def __init__(self, value):
        self.reason = value
        super(InvalidQueueMessage, self).__init__(value)


def hydrateQueueMessage(message, queueSchema):
    """
    Process a queue message and return a fully hydrated protobuf class.
Example #4
0
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2010, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################

__import__('pkg_resources').declare_namespace(__name__)

from zenoss.protocols.adapters import registerAdapters
registerAdapters()


class InvalidQueueMessage(Exception):
    """
    Signals that the queue message received something other
    than a protobuf, which we currently do not support.
    """
    def __init__(self, value):
        self.reason = value
        super(InvalidQueueMessage, self).__init__(value)


def hydrateQueueMessage(message, queueSchema):
    """
    Process a queue message and return a fully hydrated protobuf class.
    @throws InvalidQueueMessage

    This method is designed to hydrate both messages from twisted and from eventlet.