当前位置: 首页>>代码示例>>Python>>正文


Python TestHelper.loadSlice方法代码示例

本文整理汇总了Python中TestHelper.TestHelper.loadSlice方法的典型用法代码示例。如果您正苦于以下问题:Python TestHelper.loadSlice方法的具体用法?Python TestHelper.loadSlice怎么用?Python TestHelper.loadSlice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestHelper.TestHelper的用法示例。


在下文中一共展示了TestHelper.loadSlice方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice("Test.ice")
import TestI


class Server(TestHelper):

    def run(self, args):
        with self.initialize(args=args) as communicator:
            communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
            adapter = communicator.createObjectAdapter("TestAdapter")
            locator = TestI.ServantLocatorI()
            adapter.addServantLocator(locator, "")
            adapter.activate()
            adapter.waitForDeactivate()
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:21,代码来源:Server.py

示例2: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice("-I. --all ServerPrivate.ice")
import Ice
import Test


class TestI(Test.TestIntf):
    def shutdown(self, current=None):
        current.adapter.getCommunicator().shutdown()

    def baseAsBase(self, current=None):
        b = Test.Base()
        b.b = "Base.b"
        raise b

    def unknownDerivedAsBase(self, current=None):
        d = Test.UnknownDerived()
        d.b = "UnknownDerived.b"
        d.ud = "UnknownDerived.ud"
        raise d

    def knownDerivedAsBase(self, current=None):
        d = Test.KnownDerived()
        d.b = "KnownDerived.b"
        d.kd = "KnownDerived.kd"
        raise d
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:33,代码来源:Server.py

示例3: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice("Key.ice Clash.ice")
import sys
import Ice
import _and


class delI(_and._del):
    def _elifAsync(self, _else, current=None):
        pass


class execI(_and._exec):
    def _finally(self, current=None):
        assert current.operation == "finally"


class ifI(_and._if):
    def _elifAsync(self, _else, current=None):
        pass

    def _finally(self, current=None):
        pass

    def foo(self, _from, current=None):
        pass
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:33,代码来源:Client.py

示例4: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice('Callback.ice')
import Ice
import Test


class CallbackI(Test.Callback):

    def initiateCallback(self, proxy, current):
        proxy.callback(current.ctx)

    def shutdown(self, current):
        current.adapter.getCommunicator().shutdown()


class Server(TestHelper):

    def run(self, args):
        with self.initialize(args=args) as communicator:
            communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", self.getTestEndpoint(num=1))
            communicator.createObjectAdapter("DeactivatedAdapter")

            communicator.getProperties().setProperty("CallbackAdapter.Endpoints", self.getTestEndpoint())
            adapter = communicator.createObjectAdapter("CallbackAdapter")
            adapter.add(CallbackI(), Ice.stringToIdentity("callback"))
            adapter.activate()
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:33,代码来源:Server.py

示例5: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

import sys
import threading
import Ice
import Glacier2

from TestHelper import TestHelper
TestHelper.loadSlice("Callback.ice")
import Test


def test(b):
    if not b:
        raise RuntimeError('test assertion failed')


class CallbackReceiverI(Test.CallbackReceiver):

    def __init__(self):
        self._received = False
        self._cond = threading.Condition()

    def callback(self, current):
        with self._cond:
            self._received = True
            self._cond.notify()
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:32,代码来源:Client.py

示例6: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice('Test.ice')
import Ice
import TestAMDI
import TestActivationAMDI


class ServerAMD(TestHelper):

    def run(self, args):
        with self.initialize(args=args) as communicator:
            communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
            communicator.getProperties().setProperty("Ice.Warn.Dispatch", "0")

            adapter = communicator.createObjectAdapter("TestAdapter")
            adapter.addServantLocator(TestAMDI.ServantLocatorI("category"), "category")
            adapter.addServantLocator(TestAMDI.ServantLocatorI(""), "")
            adapter.add(TestAMDI.TestI(), Ice.stringToIdentity("asm"))
            adapter.add(TestActivationAMDI.TestActivationAMDI(), Ice.stringToIdentity("test/activation"))

            adapter.activate()
            adapter.waitForDeactivate()
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:29,代码来源:ServerAMD.py

示例7: Copyright

# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import loadSlice [as 别名]
#!/usr/bin/env python
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

from TestHelper import TestHelper
TestHelper.loadSlice("Test.ice ClientPrivate.ice")
import AllTests


class Client(TestHelper):

    def run(self, args):
        with self.initialize(args=args) as communicator:
            initial = AllTests.allTests(self, communicator)
            initial.shutdown()
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:18,代码来源:Client.py


注:本文中的TestHelper.TestHelper.loadSlice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。