diff options
author | Jose <jose@zeroc.com> | 2019-06-07 12:30:36 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-06-07 12:30:36 +0200 |
commit | e2c0bdf28de52eca5da25c2454c3d38ac46fcb52 (patch) | |
tree | ed7b6879ec64a07dc17974a656e05d2a4bfaa308 | |
parent | Merge remote-tracking branch 'origin/3.7' into swift (diff) | |
download | ice-e2c0bdf28de52eca5da25c2454c3d38ac46fcb52.tar.bz2 ice-e2c0bdf28de52eca5da25c2454c3d38ac46fcb52.tar.xz ice-e2c0bdf28de52eca5da25c2454c3d38ac46fcb52.zip |
Sync Ice/operations test with 3.7
-rw-r--r-- | swift/test/Ice/operations/AllTests.swift | 7 | ||||
-rw-r--r-- | swift/test/Ice/operations/Collocated.swift | 1 | ||||
-rw-r--r-- | swift/test/Ice/operations/Server.swift | 1 | ||||
-rw-r--r-- | swift/test/Ice/operations/ServerAMD.swift | 1 | ||||
-rw-r--r-- | swift/test/Ice/operations/Test.ice | 28 | ||||
-rw-r--r-- | swift/test/Ice/operations/TestAMD.ice | 27 | ||||
-rw-r--r-- | swift/test/Ice/operations/TestAMDI.swift | 10 | ||||
-rw-r--r-- | swift/test/Ice/operations/TestI.swift | 5 | ||||
-rw-r--r-- | swift/test/Ice/operations/Twoways.swift | 7 |
9 files changed, 82 insertions, 5 deletions
diff --git a/swift/test/Ice/operations/AllTests.swift b/swift/test/Ice/operations/AllTests.swift index f8db5b63458..884f22ad2cd 100644 --- a/swift/test/Ice/operations/AllTests.swift +++ b/swift/test/Ice/operations/AllTests.swift @@ -17,9 +17,12 @@ func allTests(helper: TestHelper) throws -> MyClassPrx { let cl = try checkedCast(prx: baseProxy, type: MyClassPrx.self)! let derivedProxy = try checkedCast(prx: cl, type: MyDerivedClassPrx.self)! + let bprx = try checkedCast(prx: try communicator.stringToProxy("b:\(helper.getTestEndpoint(num: 0))")!, + type: MBPrx.self)! + output.write("testing twoway operations... ") - try twoways(helper, cl) - try twoways(helper, derivedProxy) + try twoways(helper, cl, bprx) + try twoways(helper, derivedProxy, bprx) try derivedProxy.opDerived() output.writeLine("ok") diff --git a/swift/test/Ice/operations/Collocated.swift b/swift/test/Ice/operations/Collocated.swift index a6d7000f8c5..e5f7d964712 100644 --- a/swift/test/Ice/operations/Collocated.swift +++ b/swift/test/Ice/operations/Collocated.swift @@ -35,6 +35,7 @@ class Collocated: TestHelperI { communicator.getProperties().setProperty(key: "TestAdapter.Endpoints", value: getTestEndpoint(num: 0)) let adapter = try communicator.createObjectAdapter("TestAdapter") try adapter.add(servant: MyDerivedClassI(self), id: Ice.stringToIdentity("test")) + try adapter.add(servant: BI(), id: Ice.stringToIdentity("b")) try adapter.activate() _ = try allTests(helper: self) } diff --git a/swift/test/Ice/operations/Server.swift b/swift/test/Ice/operations/Server.swift index f7493f5f308..6b4085a721d 100644 --- a/swift/test/Ice/operations/Server.swift +++ b/swift/test/Ice/operations/Server.swift @@ -30,6 +30,7 @@ class Server: TestHelperI { communicator.getProperties().setProperty(key: "TestAdapter.Endpoints", value: getTestEndpoint(num: 0)) let adapter = try communicator.createObjectAdapter("TestAdapter") try adapter.add(servant: MyDerivedClassI(self), id: Ice.stringToIdentity("test")) + try adapter.add(servant: BI(), id: Ice.stringToIdentity("b")) try adapter.activate() serverReady() communicator.waitForShutdown() diff --git a/swift/test/Ice/operations/ServerAMD.swift b/swift/test/Ice/operations/ServerAMD.swift index 66cde6f7586..a407d4a6259 100644 --- a/swift/test/Ice/operations/ServerAMD.swift +++ b/swift/test/Ice/operations/ServerAMD.swift @@ -30,6 +30,7 @@ class ServerAMD: TestHelperI { communicator.getProperties().setProperty(key: "TestAdapter.Endpoints", value: getTestEndpoint(num: 0)) let adapter = try communicator.createObjectAdapter("TestAdapter") try adapter.add(servant: MyDerivedClassI(self), id: Ice.stringToIdentity("test")) + try adapter.add(servant: BI(), id: Ice.stringToIdentity("b")) try adapter.activate() serverReady() communicator.waitForShutdown() diff --git a/swift/test/Ice/operations/Test.ice b/swift/test/Ice/operations/Test.ice index b6560887522..3ed647d37fa 100644 --- a/swift/test/Ice/operations/Test.ice +++ b/swift/test/Ice/operations/Test.ice @@ -6,7 +6,9 @@ #include <Ice/Current.ice> -[["swift:class-resolver-prefix:IceOperations"]] +[["swift:class-resolver-prefix:IceOperations", + "suppress-warning:deprecated"]] // For classes with operations + module Test { @@ -427,3 +429,27 @@ interface MyDerivedClass extends Test::MyClass } } + +// +// Test proxy inheritance for class with operations +// see: https://github.com/zeroc-ice/ice/issues/406 +// +["swift:module:Test:M"] +module M +{ + class A + { + int x; + // void opA(); + } + + interface Intf + { + void opIntf(); + } + + class B extends A implements Intf + { + void opB(); + } +} diff --git a/swift/test/Ice/operations/TestAMD.ice b/swift/test/Ice/operations/TestAMD.ice index e1a2936d975..4d125eb11fd 100644 --- a/swift/test/Ice/operations/TestAMD.ice +++ b/swift/test/Ice/operations/TestAMD.ice @@ -6,7 +6,8 @@ #include <Ice/Current.ice> -[["swift:class-resolver-prefix:IceOperationsAMD"]] +[["swift:class-resolver-prefix:IceOperationsAMD", + "suppress-warning:deprecated"]] // For classes with operations module Test { @@ -340,3 +341,27 @@ const string su1 = "\u0128\u0178\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198 const string su2 = "\U00000128\U00000178\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343"; } + +// +// Test proxy inheritance for class with operations +// see: https://github.com/zeroc-ice/ice/issues/406 +// +["swift:module:Test:M"] +module M +{ + class A + { + int x; + // void opA(); + } + + ["amd"] interface Intf + { + void opIntf(); + } + + ["amd"] class B extends A implements Intf + { + void opB(); + } +} diff --git a/swift/test/Ice/operations/TestAMDI.swift b/swift/test/Ice/operations/TestAMDI.swift index 2965b4977e5..9076d9623c2 100644 --- a/swift/test/Ice/operations/TestAMDI.swift +++ b/swift/test/Ice/operations/TestAMDI.swift @@ -7,6 +7,16 @@ import TestCommon import Foundation import PromiseKit +class BI: MBDisp { + func opBAsync(current: Ice.Current) -> Promise<Void> { + return Promise.value(()) + } + + func opIntfAsync(current: Ice.Current) -> Promise<Void> { + return Promise.value(()) + } +} + class MyDerivedClassI: MyDerivedClass { var _helper: TestHelper var _opByteSOnewayCallCount: Int32 = 0 diff --git a/swift/test/Ice/operations/TestI.swift b/swift/test/Ice/operations/TestI.swift index cb4bdd933eb..cfad2b2b8fa 100644 --- a/swift/test/Ice/operations/TestI.swift +++ b/swift/test/Ice/operations/TestI.swift @@ -6,6 +6,11 @@ import Ice import TestCommon import Foundation +class BI: MBDisp { + func opB(current: Ice.Current) throws {} + func opIntf(current: Ice.Current) throws {} +} + class MyDerivedClassI: MyDerivedClass { var _helper: TestHelper diff --git a/swift/test/Ice/operations/Twoways.swift b/swift/test/Ice/operations/Twoways.swift index 286cd6f40c6..7728cd5f94d 100644 --- a/swift/test/Ice/operations/Twoways.swift +++ b/swift/test/Ice/operations/Twoways.swift @@ -5,7 +5,7 @@ import Ice import TestCommon -func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { +func twoways(_ helper: TestHelper, _ p: MyClassPrx, _ bprx: MBPrx) throws { func test(_ value: Bool, file: String = #file, line: Int = #line) throws { try helper.test(value, file: file, line: line) @@ -1219,4 +1219,9 @@ func twoways(_ helper: TestHelper, _ p: MyClassPrx) throws { try test(c.myClass == nil) try test(c.myClass1 == "MyClass1.myClass1") } + + do { + try bprx.opB() + try bprx.opIntf() + } } |