diff options
author | Michi Henning <michi@zeroc.com> | 2004-02-23 02:11:23 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-02-23 02:11:23 +0000 |
commit | e144f79172ef8992b1d498618d50b47ebe8827cf (patch) | |
tree | b9fa234d76a5f9d708503d2285de4700af3d4c3f /cpp | |
parent | fix (diff) | |
download | ice-e144f79172ef8992b1d498618d50b47ebe8827cf.tar.bz2 ice-e144f79172ef8992b1d498618d50b47ebe8827cf.tar.xz ice-e144f79172ef8992b1d498618d50b47ebe8827cf.zip |
Added AMI and AMD tests.
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/.depend | 10 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/AllTests.cpp | 604 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/Makefile | 14 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/ServerAMD.cpp | 65 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/ServerPrivateAMD.ice | 40 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/Test.ice | 4 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/TestAMD.ice | 59 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/TestAMDI.cpp | 155 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/TestAMDI.h | 55 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/TestI.cpp | 2 | ||||
-rw-r--r-- | cpp/test/Ice/slicing/exceptions/TestI.h | 2 | ||||
-rwxr-xr-x | cpp/test/Ice/slicing/exceptions/run.py | 3 |
12 files changed, 991 insertions, 22 deletions
diff --git a/cpp/test/Ice/slicing/exceptions/.depend b/cpp/test/Ice/slicing/exceptions/.depend index 7da53420280..e37c3b430c8 100644 --- a/cpp/test/Ice/slicing/exceptions/.depend +++ b/cpp/test/Ice/slicing/exceptions/.depend @@ -1,9 +1,11 @@ -Test.o: Test.cpp Test.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h +Test.o: Test.cpp Test.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h Client.o: Client.cpp ../../../../include/Ice/Ice.h ../../../../include/Ice/Initialize.h ../../../../include/Ice/CommunicatorF.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/PropertiesF.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/Properties.h ../../../../include/Ice/Logger.h ../../../../include/Ice/LoggerUtil.h ../../../../include/Ice/LoggerF.h ../../../../include/Ice/Stats.h ../../../../include/Ice/Communicator.h ../../../../include/Ice/StatsF.h ../../../../include/Ice/RouterF.h ../../../../include/Ice/LocatorF.h ../../../../include/Ice/PluginF.h ../../../../include/Ice/ObjectFactory.h ../../../../include/Ice/ObjectAdapter.h ../../../../include/Ice/ServantLocator.h ../../../../include/Ice/IdentityUtil.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/IncomingAsync.h ../../../../include/Ice/Application.h ../../../include/TestCommon.h Test.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h AllTests.o: AllTests.cpp ../../../../include/Ice/Ice.h ../../../../include/Ice/Initialize.h ../../../../include/Ice/CommunicatorF.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/PropertiesF.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/Properties.h ../../../../include/Ice/Logger.h ../../../../include/Ice/LoggerUtil.h ../../../../include/Ice/LoggerF.h ../../../../include/Ice/Stats.h ../../../../include/Ice/Communicator.h ../../../../include/Ice/StatsF.h ../../../../include/Ice/RouterF.h ../../../../include/Ice/LocatorF.h ../../../../include/Ice/PluginF.h ../../../../include/Ice/ObjectFactory.h ../../../../include/Ice/ObjectAdapter.h ../../../../include/Ice/ServantLocator.h ../../../../include/Ice/IdentityUtil.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/IncomingAsync.h ../../../../include/Ice/Application.h ../../../include/TestCommon.h Test.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h -Test.o: Test.cpp Test.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h -ServerPrivate.o: ServerPrivate.cpp ServerPrivate.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h Test.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h -TestI.o: TestI.cpp TestI.h ServerPrivate.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h Test.h ../../../../include/Ice/Ice.h ../../../../include/Ice/Initialize.h ../../../../include/Ice/CommunicatorF.h ../../../../include/Ice/PropertiesF.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/Properties.h ../../../../include/Ice/Logger.h ../../../../include/Ice/LoggerUtil.h ../../../../include/Ice/LoggerF.h ../../../../include/Ice/Stats.h ../../../../include/Ice/Communicator.h ../../../../include/Ice/StatsF.h ../../../../include/Ice/RouterF.h ../../../../include/Ice/LocatorF.h ../../../../include/Ice/PluginF.h ../../../../include/Ice/ObjectFactory.h ../../../../include/Ice/ObjectAdapter.h ../../../../include/Ice/ServantLocator.h ../../../../include/Ice/IdentityUtil.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/IncomingAsync.h ../../../../include/Ice/Application.h +Test.o: Test.cpp Test.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h +ServerPrivate.o: ServerPrivate.cpp ServerPrivate.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h Test.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/ObjectFactory.h +TestI.o: TestI.cpp TestI.h ServerPrivate.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h Test.h ../../../../include/Ice/Ice.h ../../../../include/Ice/Initialize.h ../../../../include/Ice/CommunicatorF.h ../../../../include/Ice/PropertiesF.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/Properties.h ../../../../include/Ice/Logger.h ../../../../include/Ice/LoggerUtil.h ../../../../include/Ice/LoggerF.h ../../../../include/Ice/Stats.h ../../../../include/Ice/Communicator.h ../../../../include/Ice/StatsF.h ../../../../include/Ice/RouterF.h ../../../../include/Ice/LocatorF.h ../../../../include/Ice/PluginF.h ../../../../include/Ice/ObjectFactory.h ../../../../include/Ice/ObjectAdapter.h ../../../../include/Ice/ServantLocator.h ../../../../include/Ice/IdentityUtil.h ../../../../include/Ice/IncomingAsync.h ../../../../include/Ice/Application.h Server.o: Server.cpp ../../../../include/Ice/Ice.h ../../../../include/Ice/Initialize.h ../../../../include/Ice/CommunicatorF.h ../../../../include/Ice/LocalObjectF.h ../../../../include/Ice/Handle.h ../../../../include/IceUtil/Handle.h ../../../../include/IceUtil/Exception.h ../../../../include/IceUtil/Config.h ../../../../include/Ice/Config.h ../../../../include/Ice/ProxyF.h ../../../../include/Ice/ProxyHandle.h ../../../../include/Ice/ObjectF.h ../../../../include/Ice/Exception.h ../../../../include/Ice/LocalObject.h ../../../../include/IceUtil/Shared.h ../../../../include/Ice/PropertiesF.h ../../../../include/Ice/InstanceF.h ../../../../include/Ice/BuiltinSequences.h ../../../../include/Ice/Proxy.h ../../../../include/IceUtil/Mutex.h ../../../../include/IceUtil/Lock.h ../../../../include/IceUtil/ThreadException.h ../../../../include/Ice/ProxyFactoryF.h ../../../../include/Ice/ConnectionF.h ../../../../include/Ice/EndpointF.h ../../../../include/Ice/ObjectAdapterF.h ../../../../include/Ice/ReferenceF.h ../../../../include/Ice/OutgoingAsyncF.h ../../../../include/Ice/Current.h ../../../../include/Ice/Identity.h ../../../../include/Ice/Facet.h ../../../../include/Ice/Object.h ../../../../include/IceUtil/GCShared.h ../../../../include/Ice/IncomingAsyncF.h ../../../../include/Ice/Outgoing.h ../../../../include/IceUtil/Monitor.h ../../../../include/IceUtil/Cond.h ../../../../include/IceUtil/Time.h ../../../../include/Ice/BasicStream.h ../../../../include/Ice/ObjectFactoryF.h ../../../../include/Ice/Buffer.h ../../../../include/Ice/Incoming.h ../../../../include/Ice/ServantLocatorF.h ../../../../include/Ice/ServantManagerF.h ../../../../include/Ice/Direct.h ../../../../include/Ice/LocalException.h ../../../../include/Ice/Properties.h ../../../../include/Ice/Logger.h ../../../../include/Ice/LoggerUtil.h ../../../../include/Ice/LoggerF.h ../../../../include/Ice/Stats.h ../../../../include/Ice/Communicator.h ../../../../include/Ice/StatsF.h ../../../../include/Ice/RouterF.h ../../../../include/Ice/LocatorF.h ../../../../include/Ice/PluginF.h ../../../../include/Ice/ObjectFactory.h ../../../../include/Ice/ObjectAdapter.h ../../../../include/Ice/ServantLocator.h ../../../../include/Ice/IdentityUtil.h ../../../../include/Ice/OutgoingAsync.h ../../../../include/Ice/IncomingAsync.h ../../../../include/Ice/Application.h TestI.h ServerPrivate.h ../../../../include/Ice/UserExceptionFactory.h ../../../../include/Ice/FactoryTable.h ../../../../include/Ice/FactoryTableDef.h ../../../../include/IceUtil/StaticMutex.h ../../../../include/Ice/UserExceptionFactoryF.h Test.h Test.cpp: Test.ice +TestAMD.cpp: TestAMD.ice ServerPrivate.cpp: ServerPrivate.ice Test.ice +ServerPrivateAMD.cpp: ServerPrivateAMD.ice TestAMD.ice diff --git a/cpp/test/Ice/slicing/exceptions/AllTests.cpp b/cpp/test/Ice/slicing/exceptions/AllTests.cpp index ff82cde3c60..f73c034c4f6 100644 --- a/cpp/test/Ice/slicing/exceptions/AllTests.cpp +++ b/cpp/test/Ice/slicing/exceptions/AllTests.cpp @@ -18,6 +18,458 @@ using namespace std; +class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex> +{ +public: + + CallbackBase() : + _called(false) + { + } + + virtual ~CallbackBase() + { + } + + bool check() + { + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + while(!_called) + { + if(!timedWait(IceUtil::Time::seconds(5))) + { + return false; + } + } + _called = false; + return true; + } + +protected: + + void called() + { + IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this); + assert(!_called); + _called = true; + notify(); + } + +private: + + bool _called; +}; + +class AMI_Test_baseAsBaseI : public AMI_Test_baseAsBase, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "Base.b"); + test(b.ice_name() == "Base"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_baseAsBaseI> AMI_Test_baseAsBaseIPtr; + +class AMI_Test_unknownDerivedAsBaseI : public AMI_Test_unknownDerivedAsBase, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownDerived.b"); + test(b.ice_name() == "Base"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_unknownDerivedAsBaseI> AMI_Test_unknownDerivedAsBaseIPtr; + +class AMI_Test_knownDerivedAsBaseI : public AMI_Test_knownDerivedAsBase, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() == "KnownDerived"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownDerivedAsBaseI> AMI_Test_knownDerivedAsBaseIPtr; + +class AMI_Test_knownDerivedAsKnownDerivedI : public AMI_Test_knownDerivedAsKnownDerived, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownDerived& k) + { + test(k.b == "KnownDerived.b"); + test(k.kd == "KnownDerived.kd"); + test(k.ice_name() == "KnownDerived"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownDerivedAsKnownDerivedI> AMI_Test_knownDerivedAsKnownDerivedIPtr; + +class AMI_Test_unknownIntermediateAsBaseI : public AMI_Test_unknownIntermediateAsBase, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownIntermediate.b"); + test(b.ice_name() == "Base"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_unknownIntermediateAsBaseI> AMI_Test_unknownIntermediateAsBaseIPtr; + +class AMI_Test_knownIntermediateAsBaseI : public AMI_Test_knownIntermediateAsBase, public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() == "KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownIntermediateAsBaseI> AMI_Test_knownIntermediateAsBaseIPtr; + +class AMI_Test_knownMostDerivedAsBaseI : public AMI_Test_knownMostDerivedAsBase, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() == "KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownMostDerivedAsBaseI> AMI_Test_knownMostDerivedAsBaseIPtr; + +class AMI_Test_knownIntermediateAsKnownIntermediateI : public AMI_Test_knownIntermediateAsKnownIntermediate, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "KnownIntermediate.b"); + test(ki.ki == "KnownIntermediate.ki"); + test(ki.ice_name() == "KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownIntermediateAsKnownIntermediateI> AMI_Test_knownIntermediateAsKnownIntermediateIPtr; + +class AMI_Test_knownMostDerivedAsKnownMostDerivedI : public AMI_Test_knownMostDerivedAsKnownMostDerived, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() == "KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownMostDerivedAsKnownMostDerivedI> AMI_Test_knownMostDerivedAsKnownMostDerivedIPtr; + +class AMI_Test_knownMostDerivedAsKnownIntermediateI : public AMI_Test_knownMostDerivedAsKnownIntermediate, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownMostDerived& kmd) + { + test(kmd.b == "KnownMostDerived.b"); + test(kmd.ki == "KnownMostDerived.ki"); + test(kmd.kmd == "KnownMostDerived.kmd"); + test(kmd.ice_name() == "KnownMostDerived"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_knownMostDerivedAsKnownIntermediateI> AMI_Test_knownMostDerivedAsKnownIntermediateIPtr; + +class AMI_Test_unknownMostDerived1AsBaseI : public AMI_Test_unknownMostDerived1AsBase, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(ki.ice_name() == "KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_unknownMostDerived1AsBaseI> AMI_Test_unknownMostDerived1AsBaseIPtr; + +class AMI_Test_unknownMostDerived1AsKnownIntermediateI : public AMI_Test_unknownMostDerived1AsKnownIntermediate, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const KnownIntermediate& ki) + { + test(ki.b == "UnknownMostDerived1.b"); + test(ki.ki == "UnknownMostDerived1.ki"); + test(ki.ice_name() == "KnownIntermediate"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_unknownMostDerived1AsKnownIntermediateI> + AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr; + +class AMI_Test_unknownMostDerived2AsBaseI : public AMI_Test_unknownMostDerived2AsBase, + public CallbackBase +{ + virtual void + ice_response() + { + test(false); + } + + virtual void + ice_exception(const Ice::Exception& exc) + { + try + { + exc.ice_throw(); + } + catch(const Base& b) + { + test(b.b == "UnknownMostDerived2.b"); + test(b.ice_name() == "Base"); + } + catch(...) + { + test(false); + } + called(); + } +}; + +typedef IceUtil::Handle<AMI_Test_unknownMostDerived2AsBaseI> AMI_Test_unknownMostDerived2AsBaseIPtr; + TestPrx allTests(const Ice::CommunicatorPtr& communicator) { @@ -45,6 +497,14 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; + cout << "testing throwing a base exception with AMI... " << flush; + { + AMI_Test_baseAsBaseIPtr cb = new AMI_Test_baseAsBaseI; + test->baseAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + cout << "testing slicing of unknown derived exception... " << flush; { bool gotException = false; @@ -66,7 +526,16 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing non-slicing of known derived exception thrown as base exception... " << flush; + cout << "testing slicing of unknown derived exception with AMI... " << flush; + { + AMI_Test_unknownDerivedAsBaseIPtr cb = new AMI_Test_unknownDerivedAsBaseI; + test->unknownDerivedAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing non-slicing of known derived exception" << endl; + cout << "\tthrown as base exception... " << flush; { bool gotException = false; try @@ -88,7 +557,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing non-slicing of known derived exception thrown as derived exception... " << flush; + cout << "testing non-slicing of known derived exception" << endl; + cout << "\tthrown as base exception with AMI... " << flush; + { + AMI_Test_knownDerivedAsBaseIPtr cb = new AMI_Test_knownDerivedAsBaseI; + test->knownDerivedAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing non-slicing of known derived exception" << endl; + cout << "\tthrown as derived exception... " << flush; { bool gotException = false; try @@ -110,7 +589,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of unknown intermediate exception thrown as base exception... " << flush; + cout << "testing non-slicing of known derived exception" << endl; + cout << "\tthrown as derived exception with AMI... " << flush; + { + AMI_Test_knownDerivedAsKnownDerivedIPtr cb = new AMI_Test_knownDerivedAsKnownDerivedI; + test->knownDerivedAsKnownDerived_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of unknown intermediate exception" << endl; + cout << "\tthrown as base exception... " << flush; { bool gotException = false; try @@ -131,7 +620,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of known intermediate exception thrown as base exception... " << flush; + cout << "testing slicing of unknown intermediate exception" << endl; + cout << "\tthrown as base exception with AMI... " << flush; + { + AMI_Test_unknownIntermediateAsBaseIPtr cb = new AMI_Test_unknownIntermediateAsBaseI; + test->unknownIntermediateAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of known intermediate exception" << endl; + cout << "\tthrown as base exception... " << flush; { bool gotException = false; try @@ -153,7 +652,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of known most derived exception thrown as base exception... " << flush; + cout << "testing slicing of known intermediate exception" << endl; + cout << "\tthrown as base exception with AMI... " << flush; + { + AMI_Test_knownIntermediateAsBaseIPtr cb = new AMI_Test_knownIntermediateAsBaseI; + test->knownIntermediateAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of known most derived exception" << endl; + cout << "\tthrown as base exception... " << flush; { bool gotException = false; try @@ -176,12 +685,22 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing non-slicing of known intermediate exception thrown as intermediate exception... " << flush; + cout << "testing slicing of known most derived exception" << endl; + cout << "\tthrown as base exception with AMI... " << flush; + { + AMI_Test_knownMostDerivedAsBaseIPtr cb = new AMI_Test_knownMostDerivedAsBaseI; + test->knownMostDerivedAsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing non-slicing of known intermediate exception" << endl; + cout << "\tthrown as intermediate exception... " << flush; { bool gotException = false; try { - test->knownIntermediateAsknownIntermediate(); + test->knownIntermediateAsKnownIntermediate(); } catch(const KnownIntermediate& ki) { @@ -198,7 +717,18 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing non-slicing of known most derived thrown as intermediate exception... " << flush; + cout << "testing non-slicing of known intermediate exception" << endl; + cout << "\tthrown as intermediate exception with AMI... " + << flush; + { + AMI_Test_knownIntermediateAsKnownIntermediateIPtr cb = new AMI_Test_knownIntermediateAsKnownIntermediateI; + test->knownIntermediateAsKnownIntermediate_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing non-slicing of known most derived exception" << endl; + cout << "\tthrown as intermediate exception... " << flush; { bool gotException = false; try @@ -221,7 +751,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing non-slicing of known most derived thrown as most derived exception... " << flush; + cout << "testing non-slicing of known most derived exception" << endl; + cout << "\tthrown as intermediate exception with AMI... " << flush; + { + AMI_Test_knownMostDerivedAsKnownIntermediateIPtr cb = new AMI_Test_knownMostDerivedAsKnownIntermediateI; + test->knownMostDerivedAsKnownIntermediate_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing non-slicing of known most derived exception" << endl; + cout << "\tthrown as most derived exception... " << flush; { bool gotException = false; try @@ -244,7 +784,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of unknown most derived with known intermediate thrown as base exception... " << flush; + cout << "testing non-slicing of known most derived exception" << endl; + cout << "\tthrown as most derived exception with AMI... " << flush; + { + AMI_Test_knownMostDerivedAsKnownMostDerivedIPtr cb = new AMI_Test_knownMostDerivedAsKnownMostDerivedI; + test->knownMostDerivedAsKnownMostDerived_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith known intermediate thrown as base exception... " << flush; { bool gotException = false; try @@ -266,7 +816,17 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of unknown most derived with known intermediate thrown as intermediate exception... " + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith known intermediate thrown as base exception with AMI... " << flush; + { + AMI_Test_unknownMostDerived1AsBaseIPtr cb = new AMI_Test_unknownMostDerived1AsBaseI; + test->unknownMostDerived1AsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith known intermediate thrown as intermediate exception... " << flush; { bool gotException = false; @@ -289,7 +849,18 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; - cout << "testing slicing of unknown most derived with unknown intermediate thrown as base exception... " << flush; + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith known intermediate thrown as intermediate exception with AMI... " + << flush; + { + AMI_Test_unknownMostDerived1AsKnownIntermediateIPtr cb = new AMI_Test_unknownMostDerived1AsKnownIntermediateI; + test->unknownMostDerived1AsKnownIntermediate_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith unknown intermediate thrown as base exception... " << flush; { bool gotException = false; try @@ -310,5 +881,14 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; + cout << "testing slicing of unknown most derived exception" << endl; + cout << "\twith unknown intermediate thrown as base exception with AMI... " << flush; + { + AMI_Test_unknownMostDerived2AsBaseIPtr cb = new AMI_Test_unknownMostDerived2AsBaseI; + test->unknownMostDerived2AsBase_async(cb); + test(cb->check()); + } + cout << "ok" << endl; + return test; } diff --git a/cpp/test/Ice/slicing/exceptions/Makefile b/cpp/test/Ice/slicing/exceptions/Makefile index 592c891bc1f..dc791a5a363 100644 --- a/cpp/test/Ice/slicing/exceptions/Makefile +++ b/cpp/test/Ice/slicing/exceptions/Makefile @@ -16,8 +16,9 @@ top_srcdir = ../../../.. CLIENT = client SERVER = server +SERVERAMD = serveramd -TARGETS = $(CLIENT) $(SERVER) +TARGETS = $(CLIENT) $(SERVER) $(SERVERAMD) COBJS = Test.o \ Client.o \ @@ -28,10 +29,15 @@ SOBJS = Test.o \ TestI.o \ Server.o +SAMDOBJS = TestAMD.o \ + ServerPrivateAMD.o \ + TestAMDI.o \ + ServerAMD.o + SRCS = $(COBJS:.o=.cpp) \ $(SOBJS:.o=.cpp) -SLICE_SRCS = Test.ice ServerPrivate.ice +SLICE_SRCS = Test.ice TestAMD.ice ServerPrivate.ice ServerPrivateAMD.ice include $(top_srcdir)/config/Make.rules @@ -47,4 +53,8 @@ $(SERVER): $(SOBJS) rm -f $@ $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) +$(SERVERAMD): $(SAMDOBJS) + rm -f $@ + $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS) + include .depend diff --git a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp new file mode 100644 index 00000000000..86bc662a2d8 --- /dev/null +++ b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp @@ -0,0 +1,65 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestAMDI.h> + +using namespace std; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + Ice::PropertiesPtr properties = communicator->getProperties(); + properties->setProperty("Ice.Warn.Dispatch", "0"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + Ice::ObjectPtr object = new TestI(adapter); + adapter->add(object, Ice::stringToIdentity("Test")); + adapter->activate(); + communicator->waitForShutdown(); + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + int status; + Ice::CommunicatorPtr communicator; + + try + { + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if(communicator) + { + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} diff --git a/cpp/test/Ice/slicing/exceptions/ServerPrivateAMD.ice b/cpp/test/Ice/slicing/exceptions/ServerPrivateAMD.ice new file mode 100644 index 00000000000..37580eaff70 --- /dev/null +++ b/cpp/test/Ice/slicing/exceptions/ServerPrivateAMD.ice @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#ifndef SERVERPRIVATEAMD_ICE +#define SERVERPRIVATEAMD_ICE + +#include <TestAMD.ice> + +exception UnknownDerived extends Base +{ + string ud; +}; + +exception UnknownIntermediate extends Base +{ + string ui; +}; + +exception UnknownMostDerived1 extends KnownIntermediate +{ + string umd1; +}; + +exception UnknownMostDerived2 extends UnknownIntermediate +{ + string umd2; +}; + +#endif diff --git a/cpp/test/Ice/slicing/exceptions/Test.ice b/cpp/test/Ice/slicing/exceptions/Test.ice index 27b2aa99bd8..cb42aa4d87c 100644 --- a/cpp/test/Ice/slicing/exceptions/Test.ice +++ b/cpp/test/Ice/slicing/exceptions/Test.ice @@ -35,7 +35,7 @@ exception KnownMostDerived extends KnownIntermediate string kmd; }; -interface Test +["ami"] interface Test { void baseAsBase() throws Base; void unknownDerivedAsBase() throws Base; @@ -45,7 +45,7 @@ interface Test void unknownIntermediateAsBase() throws Base; void knownIntermediateAsBase() throws Base; void knownMostDerivedAsBase() throws Base; - void knownIntermediateAsknownIntermediate() throws KnownIntermediate; + void knownIntermediateAsKnownIntermediate() throws KnownIntermediate; void knownMostDerivedAsKnownIntermediate() throws KnownIntermediate; void knownMostDerivedAsKnownMostDerived() throws KnownMostDerived; diff --git a/cpp/test/Ice/slicing/exceptions/TestAMD.ice b/cpp/test/Ice/slicing/exceptions/TestAMD.ice new file mode 100644 index 00000000000..f8dec1fd04e --- /dev/null +++ b/cpp/test/Ice/slicing/exceptions/TestAMD.ice @@ -0,0 +1,59 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#ifndef TEST_AMD_ICE +#define TEST_AMD_ICE + +exception Base +{ + string b; +}; + +exception KnownDerived extends Base +{ + string kd; +}; + +exception KnownIntermediate extends Base +{ + string ki; +}; + +exception KnownMostDerived extends KnownIntermediate +{ + string kmd; +}; + +["ami", "amd"] interface Test +{ + void baseAsBase() throws Base; + void unknownDerivedAsBase() throws Base; + void knownDerivedAsBase() throws Base; + void knownDerivedAsKnownDerived() throws KnownDerived; + + void unknownIntermediateAsBase() throws Base; + void knownIntermediateAsBase() throws Base; + void knownMostDerivedAsBase() throws Base; + void knownIntermediateAsKnownIntermediate() throws KnownIntermediate; + void knownMostDerivedAsKnownIntermediate() throws KnownIntermediate; + void knownMostDerivedAsKnownMostDerived() throws KnownMostDerived; + + void unknownMostDerived1AsBase() throws Base; + void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate; + void unknownMostDerived2AsBase() throws Base; + + void shutdown(); +}; + +#endif diff --git a/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp new file mode 100644 index 00000000000..ea04b7dbeab --- /dev/null +++ b/cpp/test/Ice/slicing/exceptions/TestAMDI.cpp @@ -0,0 +1,155 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#include <TestAMDI.h> +#include <Ice/Ice.h> + +TestI::TestI(const Ice::ObjectAdapterPtr& adapter) : + _adapter(adapter) +{ +} + +void +TestI::baseAsBase_async(const ::AMD_Test_baseAsBasePtr& cb, const ::Ice::Current&) +{ + Base b; + b.b = "Base.b"; + cb->ice_exception(b); +} + +void +TestI::unknownDerivedAsBase_async(const ::AMI_Test_unknownDerivedAsBasePtr& cb, const ::Ice::Current&) +{ + UnknownDerived d; + d.b = "UnknownDerived.b"; + d.ud = "UnknownDerived.ud"; + cb->ice_exception(d); +} + +void +TestI::knownDerivedAsBase_async(const ::AMI_Test_knownDerivedAsBasePtr& cb, const ::Ice::Current&) +{ + KnownDerived d; + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + cb->ice_exception(d); +} + +void +TestI::knownDerivedAsKnownDerived_async(const ::AMI_Test_knownDerivedAsKnownDerivedPtr& cb, const ::Ice::Current&) +{ + KnownDerived d; + d.b = "KnownDerived.b"; + d.kd = "KnownDerived.kd"; + cb->ice_exception(d); +} + +void +TestI::unknownIntermediateAsBase_async(const ::AMI_Test_unknownIntermediateAsBasePtr& cb, const ::Ice::Current&) +{ + UnknownIntermediate ui; + ui.b = "UnknownIntermediate.b"; + ui.ui = "UnknownIntermediate.ui"; + cb->ice_exception(ui); +} + +void +TestI::knownIntermediateAsBase_async(const ::AMI_Test_knownIntermediateAsBasePtr& cb, const ::Ice::Current&) +{ + KnownIntermediate ki; + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + cb->ice_exception(ki); +} + +void +TestI::knownMostDerivedAsBase_async(const ::AMI_Test_knownMostDerivedAsBasePtr& cb, const ::Ice::Current&) +{ + KnownMostDerived kmd; + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb->ice_exception(kmd); +} + +void +TestI::knownIntermediateAsKnownIntermediate_async(const ::AMI_Test_knownIntermediateAsKnownIntermediatePtr& cb, + const ::Ice::Current&) +{ + KnownIntermediate ki; + ki.b = "KnownIntermediate.b"; + ki.ki = "KnownIntermediate.ki"; + cb->ice_exception(ki); +} + +void +TestI::knownMostDerivedAsKnownIntermediate_async(const ::AMI_Test_knownMostDerivedAsKnownIntermediatePtr& cb, + const ::Ice::Current&) +{ + KnownMostDerived kmd; + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb->ice_exception(kmd); +} + +void +TestI:: +knownMostDerivedAsKnownMostDerived_async(const ::AMI_Test_knownMostDerivedAsKnownMostDerivedPtr& cb, + const ::Ice::Current&) +{ + KnownMostDerived kmd; + kmd.b = "KnownMostDerived.b"; + kmd.ki = "KnownMostDerived.ki"; + kmd.kmd = "KnownMostDerived.kmd"; + cb->ice_exception(kmd); +} + +void +TestI::unknownMostDerived1AsBase_async(const ::AMI_Test_unknownMostDerived1AsBasePtr& cb, const ::Ice::Current&) +{ + UnknownMostDerived1 umd1; + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + cb->ice_exception(umd1); +} + +void +TestI::unknownMostDerived1AsKnownIntermediate_async(const ::AMI_Test_unknownMostDerived1AsKnownIntermediatePtr& cb, + const ::Ice::Current&) +{ + UnknownMostDerived1 umd1; + umd1.b = "UnknownMostDerived1.b"; + umd1.ki = "UnknownMostDerived1.ki"; + umd1.umd1 = "UnknownMostDerived1.umd1"; + cb->ice_exception(umd1); +} + +void +TestI::unknownMostDerived2AsBase_async(const ::AMI_Test_unknownMostDerived2AsBasePtr& cb, const ::Ice::Current&) +{ + UnknownMostDerived2 umd2; + umd2.b = "UnknownMostDerived2.b"; + umd2.ui = "UnknownMostDerived2.ui"; + umd2.umd2 = "UnknownMostDerived2.umd2"; + cb->ice_exception(umd2); +} + +void +TestI::shutdown_async(const ::AMI_Test_shutdownPtr& cb, const ::Ice::Current&) +{ + _adapter->getCommunicator()->shutdown(); + cb->ice_response(); +} diff --git a/cpp/test/Ice/slicing/exceptions/TestAMDI.h b/cpp/test/Ice/slicing/exceptions/TestAMDI.h new file mode 100644 index 00000000000..4e8c3ad10a0 --- /dev/null +++ b/cpp/test/Ice/slicing/exceptions/TestAMDI.h @@ -0,0 +1,55 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// ZeroC, Inc. +// Billerica, MA, USA +// +// All Rights Reserved. +// +// Ice is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License version 2 as published by +// the Free Software Foundation. +// +// ********************************************************************** + +#ifndef TESTAMDI_H +#define TESTAMDI_H + +#include <ServerPrivateAMD.h> + +class TestI : virtual public Test +{ +public: + + TestI(const ::Ice::ObjectAdapterPtr&); + virtual void baseAsBase_async(const ::AMD_Test_baseAsBasePtr&, const ::Ice::Current&); + + virtual void unknownDerivedAsBase_async(const ::AMD_Test_unknownDerivedAsBasePtr&, const ::Ice::Current&); + virtual void knownDerivedAsBase_async(const ::AMD_Test_knownDerivedAsBasePtr&, const ::Ice::Current&); + virtual void knownDerivedAsKnownDerived_async(const ::AMD_Test_knownDerivedAsKnownDerivedPtr&, + const ::Ice::Current&); + + virtual void unknownIntermediateAsBase_async(const ::AMD_Test_unknownIntermediateAsBasePtr&, const ::Ice::Current&); + virtual void knownIntermediateAsBase_async(const ::AMD_Test_knownIntermediateAsBasePtr&, const ::Ice::Current&); + virtual void knownMostDerivedAsBase_async(const ::AMD_Test_knownMostDerivedAsBasePtr&, const ::Ice::Current&); + virtual void knownIntermediateAsKnownIntermediate_async(const ::AMD_Test_knownIntermediateAsKnownIntermediatePtr&, + const ::Ice::Current&); + virtual void knownMostDerivedAsKnownIntermediate_async(const ::AMD_Test_knownMostDerivedAsKnownIntermediatePtr&, + const ::Ice::Current&); + virtual void knownMostDerivedAsKnownMostDerived_async(const ::AMD_Test_knownMostDerivedAsKnownMostDerivedPtr&, + const ::Ice::Current&); + + virtual void unknownMostDerived1AsBase_async(const ::AMD_Test_unknownMostDerived1AsBasePtr&, const ::Ice::Current&); + virtual void unknownMostDerived1AsKnownIntermediate_async( + const ::AMD_Test_unknownMostDerived1AsKnownIntermediatePtr&, + const ::Ice::Current&); + virtual void unknownMostDerived2AsBase_async(const ::AMD_Test_unknownMostDerived2AsBasePtr&, const ::Ice::Current&); + + virtual void shutdown_async(const ::AMD_Test_shutdownPtr&, const ::Ice::Current&); + +private: + + const ::Ice::ObjectAdapterPtr& _adapter; +}; + +#endif diff --git a/cpp/test/Ice/slicing/exceptions/TestI.cpp b/cpp/test/Ice/slicing/exceptions/TestI.cpp index c59804f24de..3499713edd3 100644 --- a/cpp/test/Ice/slicing/exceptions/TestI.cpp +++ b/cpp/test/Ice/slicing/exceptions/TestI.cpp @@ -84,7 +84,7 @@ TestI::knownMostDerivedAsBase(const ::Ice::Current&) } void -TestI::knownIntermediateAsknownIntermediate(const ::Ice::Current&) +TestI::knownIntermediateAsKnownIntermediate(const ::Ice::Current&) { KnownIntermediate ki; ki.b = "KnownIntermediate.b"; diff --git a/cpp/test/Ice/slicing/exceptions/TestI.h b/cpp/test/Ice/slicing/exceptions/TestI.h index ace75be59fb..57b165798c6 100644 --- a/cpp/test/Ice/slicing/exceptions/TestI.h +++ b/cpp/test/Ice/slicing/exceptions/TestI.h @@ -30,7 +30,7 @@ public: virtual void unknownIntermediateAsBase(const ::Ice::Current&); virtual void knownIntermediateAsBase(const ::Ice::Current&); virtual void knownMostDerivedAsBase(const ::Ice::Current&); - virtual void knownIntermediateAsknownIntermediate(const ::Ice::Current&); + virtual void knownIntermediateAsKnownIntermediate(const ::Ice::Current&); virtual void knownMostDerivedAsKnownIntermediate(const ::Ice::Current&); virtual void knownMostDerivedAsKnownMostDerived(const ::Ice::Current&); diff --git a/cpp/test/Ice/slicing/exceptions/run.py b/cpp/test/Ice/slicing/exceptions/run.py index d42a594f9c1..688bf10710b 100755 --- a/cpp/test/Ice/slicing/exceptions/run.py +++ b/cpp/test/Ice/slicing/exceptions/run.py @@ -27,5 +27,8 @@ import TestUtil name = os.path.join("Ice", "slicing", "exceptions") +print "tests with regular server." TestUtil.clientServerTest(name) +print "tests with AMD server." +TestUtil.clientServerTestWithOptionsAndNames(name, "", "", "serveramd", "client") sys.exit(0) |