summaryrefslogtreecommitdiff
path: root/python/test/Ice/operations/Collocated.py
blob: 407900b42eab83ff2b31ec6ec335b19658c1dc78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#

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


class Collocated(TestHelper):

    def run(self, args):
        properties = self.createTestProperties(args)
        properties.setProperty("Ice.BatchAutoFlushSize", "100")
        with self.initialize(properties=properties) as communicator:
            communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
            adapter = communicator.createObjectAdapter("TestAdapter")
            prx = adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test"))
            adapter.add(TestI.BI(), Ice.stringToIdentity("b"))
            # adapter.activate() // Don't activate OA to ensure collocation is used.
            if prx.ice_getConnection():
                raise RuntimeError("collocation doesn't work")
            AllTests.allTests(self, communicator)