diff --git a/python/test/Ice/exceptions/AllTests.py b/python/test/Ice/exceptions/AllTests.py index b5004595ad8..36b875d1829 100644 --- a/python/test/Ice/exceptions/AllTests.py +++ b/python/test/Ice/exceptions/AllTests.py @@ -839,4 +839,44 @@ def allTests(helper, communicator): pass print("ok") + sys.stdout.write("testing exceptions in request failed exception... ") + sys.stdout.flush() + try: + thrower.throwRequestFailedException( + "Ice.ObjectNotExistException", + Ice.Identity("name", "category"), + "facet", + "operation") + test(False) + except Ice.ObjectNotExistException as ex: + test(ex.id == Ice.Identity("name", "category")) + test(ex.facet == "facet") + test(ex.operation == "operation") + + try: + thrower.throwRequestFailedException( + "Ice.OperationNotExistException", + Ice.Identity("name", "category"), + "facet", + "operation") + test(False) + except Ice.OperationNotExistException as ex: + test(ex.id == Ice.Identity("name", "category")) + test(ex.facet == "facet") + test(ex.operation == "operation") + + try: + thrower.throwRequestFailedException( + "Ice.FacetNotExistException", + Ice.Identity("name", "category"), + "facet", + "operation") + test(False) + except Ice.FacetNotExistException as ex: + test(ex.id == Ice.Identity("name", "category")) + test(ex.facet == "facet") + test(ex.operation == "operation") + + + print("ok") return thrower diff --git a/python/test/Ice/exceptions/ServerAMD.py b/python/test/Ice/exceptions/ServerAMD.py index d9d2a9815de..c7799ecdadb 100755 --- a/python/test/Ice/exceptions/ServerAMD.py +++ b/python/test/Ice/exceptions/ServerAMD.py @@ -144,6 +144,14 @@ def throwMarshalException(self, current): return Ice.Future.completed((0, "")) return Ice.Future.completed(None) + def throwRequestFailedException(self, typeName, id, facet, operation, current): + if typeName == "Ice.ObjectNotExistException": + raise Ice.ObjectNotExistException(id, facet, operation) + elif typeName == "Ice.FacetNotExistException": + raise Ice.FacetNotExistException(id, facet, operation) + elif typeName == "Ice.OperationNotExistException": + raise Ice.OperationNotExistException(id, facet, operation) + class ServerAMD(TestHelper): def run(self, args): diff --git a/python/test/Ice/exceptions/Test.ice b/python/test/Ice/exceptions/Test.ice index f194d3f139c..be1d718f222 100644 --- a/python/test/Ice/exceptions/Test.ice +++ b/python/test/Ice/exceptions/Test.ice @@ -5,6 +5,7 @@ #pragma once #include "Ice/BuiltinSequences.ice" +#include "Ice/Identity.ice" module Test { @@ -73,6 +74,8 @@ interface Thrower void throwAfterException() throws A; int throwMarshalException(out int p); + + void throwRequestFailedException(string type, Ice::Identity id, string facet, string operation); } interface WrongOperation diff --git a/python/test/Ice/exceptions/TestI.py b/python/test/Ice/exceptions/TestI.py index 86240305ed9..056afa943d8 100644 --- a/python/test/Ice/exceptions/TestI.py +++ b/python/test/Ice/exceptions/TestI.py @@ -109,3 +109,11 @@ def throwMarshalException(self, current): return ("", 0) if "param" in current.ctx: return (0, "") + + def throwRequestFailedException(self, typeName, id, facet, operation, current): + if typeName == "Ice.ObjectNotExistException": + raise Ice.ObjectNotExistException(id, facet, operation) + elif typeName == "Ice.FacetNotExistException": + raise Ice.FacetNotExistException(id, facet, operation) + elif typeName == "Ice.OperationNotExistException": + raise Ice.OperationNotExistException(id, facet, operation)