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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
#!/usr/bin/env python3
#
# Copyright (c) ZeroC, Inc. All rights reserved.
#
from TestHelper import TestHelper
TestHelper.loadSlice("Test.ice")
import Ice
import Test
class InitialI(Test.Initial):
def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
def pingPong(self, o, current=None):
return Ice.Future.completed(o)
def opOptionalException(self, a, b, o, current=None):
f = Ice.Future()
f.set_exception(Test.OptionalException(False, a, b, o))
return f
def opDerivedException(self, a, b, o, current=None):
f = Ice.Future()
f.set_exception(Test.DerivedException(False, a, b, o, "d1", b, o, "d2"))
return f
def opRequiredException(self, a, b, o, current=None):
e = Test.RequiredException()
e.a = a
e.b = b
e.o = o
if b is not Ice.Unset:
e.ss = b
if o is not Ice.Unset:
e.o2 = o
f = Ice.Future()
f.set_exception(e)
return f
def opByte(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opBool(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opShort(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opInt(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opLong(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFloat(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opDouble(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opString(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opMyEnum(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opVarStruct(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opOneOptional(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opOneOptionalProxy(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opByteSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opBoolSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opShortSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opLongSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFloatSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opDoubleSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opStringSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSmallStructList(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opFixedStructList(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opVarStructSeq(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opSerializable(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntIntDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opStringIntDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opIntOneOptionalDict(self, p1, current=None):
return Ice.Future.completed((p1, p1))
def opClassAndUnknownOptional(self, p, current=None):
return Ice.Future.completed(None)
def sendOptionalClass(self, req, o, current=None):
return Ice.Future.completed(None)
def returnOptionalClass(self, req, current=None):
return Ice.Future.completed(Test.OneOptional(53))
def opG(self, g, current=None):
return Ice.Future.completed(g)
def opVoid(self, current=None):
return Ice.Future.completed(None)
def opMStruct1(self, current):
return Ice.Future.completed(Test.Initial.OpMStruct1MarshaledResult(Test.SmallStruct(), current))
def opMStruct2(self, p1, current):
return Ice.Future.completed(Test.Initial.OpMStruct2MarshaledResult((p1, p1), current))
def opMSeq1(self, current):
return Ice.Future.completed(Test.Initial.OpMSeq1MarshaledResult([], current))
def opMSeq2(self, p1, current):
return Ice.Future.completed(Test.Initial.OpMSeq2MarshaledResult((p1, p1), current))
def opMDict1(self, current):
return Ice.Future.completed(Test.Initial.OpMDict1MarshaledResult({}, current))
def opMDict2(self, p1, current):
return Ice.Future.completed(Test.Initial.OpMDict2MarshaledResult((p1, p1), current))
def opMG1(self, current):
return Ice.Future.completed(Test.Initial.OpMG1MarshaledResult(Test.G(), current))
def opMG2(self, p1, current):
return Ice.Future.completed(Test.Initial.OpMG2MarshaledResult((p1, p1), current))
def opRequiredAfterOptional(self, p1, p2, p3, current):
return Ice.Future.completed((p1, p2, p3))
def opOptionalAfterRequired(self, p1, p2, p3, current):
return Ice.Future.completed((p1, p2, p3))
def supportsRequiredParams(self, current=None):
return Ice.Future.completed(False)
def supportsJavaSerializable(self, current=None):
return Ice.Future.completed(True)
def supportsCsharpSerializable(self, current=None):
return Ice.Future.completed(False)
def supportsCppStringView(self, current=None):
return Ice.Future.completed(False)
def supportsNullOptional(self, current=None):
return Ice.Future.completed(True)
class ServerAMD(TestHelper):
def run(self, args):
with self.initialize(args=args) as communicator:
communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("TestAdapter")
initial = InitialI()
adapter.add(initial, Ice.stringToIdentity("initial"))
adapter.activate()
communicator.waitForShutdown()
|