diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-02-01 17:16:04 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-02-01 17:16:04 +0100 |
commit | 46bfaab25c7c52112babf9321fcb8954f34f4010 (patch) | |
tree | 32fa30091ae0c61a5731dc026877744763c210e3 /cpp | |
parent | Fixed JS proxy test failure (diff) | |
download | ice-46bfaab25c7c52112babf9321fcb8954f34f4010.tar.bz2 ice-46bfaab25c7c52112babf9321fcb8954f34f4010.tar.xz ice-46bfaab25c7c52112babf9321fcb8954f34f4010.zip |
Added ice_fixed to generated Java proxy class, added test to check proxy return type from ice_fixed
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 12 | ||||
-rw-r--r-- | cpp/test/Ice/proxy/AllTests.cpp | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 01d3e752ccb..d6039c28691 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -4852,6 +4852,18 @@ Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p) out << eb; out << sp; + writeDocComment(out, + "Returns a proxy that is identical to this proxy, except it's a fixed proxy bound\n" + "the given connection." + "@param connection The fixed proxy connection.\n" + "@return A fixed proxy bound to the given connection."); + out << nl << "@Override"; + out << nl << "default " << p->name() << "Prx ice_fixed(com.zeroc.Ice.Connection connection)"; + out << sb; + out << nl << "return (" << p->name() << "Prx)_ice_fixed(connection);"; + out << eb; + + out << sp; out << nl << "static String ice_staticId()"; out << sb; out << nl << "return \"" << p->scoped() << "\";"; diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index 9a23982ccc0..f3f09e9b9d4 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -1151,7 +1151,8 @@ allTests(const Ice::CommunicatorPtr& communicator) Ice::ConnectionPtr connection = cl->ice_getConnection(); if(connection) { - cl->ice_fixed(connection)->ice_ping(); + Test::MyClassPrxPtr prx = cl->ice_fixed(connection); // Test factory method return type + prx->ice_ping(); test(cl->ice_secure(true)->ice_fixed(connection)->ice_isSecure()); test(cl->ice_facet("facet")->ice_fixed(connection)->ice_getFacet() == "facet"); test(cl->ice_oneway()->ice_fixed(connection)->ice_isOneway()); |