本文整理汇总了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()
示例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
示例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
示例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()
示例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()
示例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()
示例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()