[hydra-commits] kpfleming: branch techdemo/kpfleming/slicing r563 - in /techdemo/team/kpflemi...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Thu Apr 1 17:10:51 CDT 2010


Author: kpfleming
Date: Thu Apr  1 17:10:50 2010
New Revision: 563

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=563
Log:
import the rest of the standard slicing test

Added:
    techdemo/team/kpfleming/slicing/exceptions/
    techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/Client.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/Makefile   (with props)
    techdemo/team/kpfleming/slicing/exceptions/Server.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice   (with props)
    techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice   (with props)
    techdemo/team/kpfleming/slicing/exceptions/Test.ice   (with props)
    techdemo/team/kpfleming/slicing/exceptions/TestAMD.ice   (with props)
    techdemo/team/kpfleming/slicing/exceptions/TestAMDI.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/TestAMDI.h   (with props)
    techdemo/team/kpfleming/slicing/exceptions/TestI.cpp   (with props)
    techdemo/team/kpfleming/slicing/exceptions/TestI.h   (with props)
    techdemo/team/kpfleming/slicing/exceptions/run.py   (with props)
    techdemo/team/kpfleming/slicing/objects/
    techdemo/team/kpfleming/slicing/objects/AllTests.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/Client.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/ClientPrivate.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/Forward.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/Makefile   (with props)
    techdemo/team/kpfleming/slicing/objects/Server.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/ServerPrivate.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/ServerPrivateAMD.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/Test.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/TestAMD.ice   (with props)
    techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/TestAMDI.h   (with props)
    techdemo/team/kpfleming/slicing/objects/TestI.cpp   (with props)
    techdemo/team/kpfleming/slicing/objects/TestI.h   (with props)
    techdemo/team/kpfleming/slicing/objects/run.py   (with props)

Added: techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp (added)
+++ techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp Thu Apr  1 17:10:50 2010
@@ -1,0 +1,722 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+using namespace Test;
+
+class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
+{
+public:
+
+    CallbackBase() :
+        _called(false)
+    {
+    }
+
+    virtual ~CallbackBase()
+    {
+    }
+
+    void check()
+    {
+        IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+        while(!_called)
+        {
+            wait();
+        }
+        _called = false;
+    }
+
+protected:
+
+    void called()
+    {
+        IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+        assert(!_called);
+        _called = true;
+        notify();
+    }
+
+private:
+
+    bool _called;
+};
+
+
+class Callback : public CallbackBase, public IceUtil::Shared
+{
+public:
+
+    void
+    response()
+    {
+        test(false);
+    }
+
+    void
+    exception_baseAsBase(const Ice::Exception& exc)
+    {
+        try
+        {
+            exc.ice_throw();
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "Base.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_unknownDerivedAsBase(const Ice::Exception& exc)
+    {
+        try
+        {
+            exc.ice_throw();
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownDerived.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownDerivedAsBase(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() =="Test::KnownDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownDerivedAsKnownDerived(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() =="Test::KnownDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_unknownIntermediateAsBase(const Ice::Exception& exc)
+    {
+        try
+        {
+            exc.ice_throw();
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownIntermediate.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownIntermediateAsBase(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() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownMostDerivedAsBase(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() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownIntermediateAsKnownIntermediate(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() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownMostDerivedAsKnownMostDerived(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() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_knownMostDerivedAsKnownIntermediate(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() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_unknownMostDerived1AsBase(const Ice::Exception& exc)
+    {
+        try
+        {
+            exc.ice_throw();
+        }
+        catch(const KnownIntermediate& ki)
+        {
+            test(ki.b == "UnknownMostDerived1.b");
+            test(ki.ki == "UnknownMostDerived1.ki");
+            test(string(ki.ice_name()) =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_unknownMostDerived1AsKnownIntermediate(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() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+
+    void
+    exception_unknownMostDerived2AsBase(const Ice::Exception& exc)
+    {
+        try
+        {
+            exc.ice_throw();
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownMostDerived2.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+        called();
+    }
+};
+
+typedef IceUtil::Handle<Callback> CallbackPtr;
+
+TestIntfPrx
+allTests(const Ice::CommunicatorPtr& communicator)
+{
+    Ice::ObjectPrx obj = communicator->stringToProxy("Test:default -p 12010");
+    TestIntfPrx test = TestIntfPrx::checkedCast(obj);
+
+    cout << "base... " << flush;
+    {
+        try
+        {
+            test->baseAsBase();
+            test(false);
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "Base.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_baseAsBase(
+            newCallback_TestIntf_baseAsBase(cb, &Callback::response, &Callback::exception_baseAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown derived... " << flush;
+    {
+        try
+        {
+            test->unknownDerivedAsBase();
+            test(false);
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownDerived.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown derived (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_unknownDerivedAsBase(
+            newCallback_TestIntf_unknownDerivedAsBase(cb, &Callback::response,
+                                                      &Callback::exception_unknownDerivedAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known derived as base... " << flush;
+    {
+        try
+        {
+            test->knownDerivedAsBase();
+            test(false);
+        }
+        catch(const KnownDerived& k)
+        {
+            test(k.b == "KnownDerived.b");
+            test(k.kd == "KnownDerived.kd");
+            test(k.ice_name() =="Test::KnownDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known derived as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownDerivedAsBase(
+            newCallback_TestIntf_knownDerivedAsBase(cb, &Callback::response, &Callback::exception_knownDerivedAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known derived as derived... " << flush;
+    {
+        try
+        {
+            test->knownDerivedAsKnownDerived();
+            test(false);
+        }
+        catch(const KnownDerived& k)
+        {
+            test(k.b == "KnownDerived.b");
+            test(k.kd == "KnownDerived.kd");
+            test(k.ice_name() =="Test::KnownDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known derived as derived (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownDerivedAsKnownDerived(
+            newCallback_TestIntf_knownDerivedAsKnownDerived(cb, &Callback::response, 
+                                                            &Callback::exception_knownDerivedAsKnownDerived));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown intermediate as base... " << flush;
+    {
+        try
+        {
+            test->unknownIntermediateAsBase();
+            test(false);
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownIntermediate.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown intermediate as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_unknownIntermediateAsBase(
+            newCallback_TestIntf_unknownIntermediateAsBase(cb, &Callback::response, 
+                                                           &Callback::exception_unknownIntermediateAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of known intermediate as base... " << flush;
+    {
+        try
+        {
+            test->knownIntermediateAsBase();
+            test(false);
+        }
+        catch(const KnownIntermediate& ki)
+        {
+            test(ki.b == "KnownIntermediate.b");
+            test(ki.ki == "KnownIntermediate.ki");
+            test(ki.ice_name() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of known intermediate as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownIntermediateAsBase(
+            newCallback_TestIntf_knownIntermediateAsBase(cb, &Callback::response, 
+                                                         &Callback::exception_knownIntermediateAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of known most derived as base... " << flush;
+    {
+        try
+        {
+            test->knownMostDerivedAsBase();
+            test(false);
+        }
+        catch(const KnownMostDerived& kmd)
+        {
+            test(kmd.b == "KnownMostDerived.b");
+            test(kmd.ki == "KnownMostDerived.ki");
+            test(kmd.kmd == "KnownMostDerived.kmd");
+            test(kmd.ice_name() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of known most derived as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownMostDerivedAsBase(
+            newCallback_TestIntf_knownMostDerivedAsBase(cb, &Callback::response, 
+                                                        &Callback::exception_knownMostDerivedAsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known intermediate as intermediate... " << flush;
+    {
+        try
+        {
+            test->knownIntermediateAsKnownIntermediate();
+            test(false);
+        }
+        catch(const KnownIntermediate& ki)
+        {
+            test(ki.b == "KnownIntermediate.b");
+            test(ki.ki == "KnownIntermediate.ki");
+            test(ki.ice_name() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known intermediate as intermediate (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownIntermediateAsKnownIntermediate(
+            newCallback_TestIntf_knownIntermediateAsKnownIntermediate(cb, &Callback::response, 
+                                                        &Callback::exception_knownIntermediateAsKnownIntermediate));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known most derived exception as intermediate... " << flush;
+    {
+        try
+        {
+            test->knownMostDerivedAsKnownIntermediate();
+            test(false);
+        }
+        catch(const KnownMostDerived& kmd)
+        {
+            test(kmd.b == "KnownMostDerived.b");
+            test(kmd.ki == "KnownMostDerived.ki");
+            test(kmd.kmd == "KnownMostDerived.kmd");
+            test(kmd.ice_name() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known most derived as intermediate (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownMostDerivedAsKnownIntermediate(
+            newCallback_TestIntf_knownMostDerivedAsKnownIntermediate(cb, &Callback::response, 
+                                                        &Callback::exception_knownMostDerivedAsKnownIntermediate));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known most derived as most derived... " << flush;
+    {
+        try
+        {
+            test->knownMostDerivedAsKnownMostDerived();
+            test(false);
+        }
+        catch(const KnownMostDerived& kmd)
+        {
+            test(kmd.b == "KnownMostDerived.b");
+            test(kmd.ki == "KnownMostDerived.ki");
+            test(kmd.kmd == "KnownMostDerived.kmd");
+            test(kmd.ice_name() =="Test::KnownMostDerived");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "non-slicing of known most derived as most derived (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_knownMostDerivedAsKnownMostDerived(
+            newCallback_TestIntf_knownMostDerivedAsKnownMostDerived(cb, &Callback::response, 
+                                                        &Callback::exception_knownMostDerivedAsKnownMostDerived));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, known intermediate as base... " << flush;
+    {
+        try
+        {
+            test->unknownMostDerived1AsBase();
+            test(false);
+        }
+        catch(const KnownIntermediate& ki)
+        {
+            test(ki.b == "UnknownMostDerived1.b");
+            test(ki.ki == "UnknownMostDerived1.ki");
+            test(ki.ice_name() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, known intermediate as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_unknownMostDerived1AsBase(
+            newCallback_TestIntf_unknownMostDerived1AsBase(cb, &Callback::response, 
+                                                           &Callback::exception_unknownMostDerived1AsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, known intermediate as intermediate... " << flush;
+    {
+        try
+        {
+            test->unknownMostDerived1AsKnownIntermediate();
+            test(false);
+        }
+        catch(const KnownIntermediate& ki)
+        {
+            test(ki.b == "UnknownMostDerived1.b");
+            test(ki.ki == "UnknownMostDerived1.ki");
+            test(ki.ice_name() =="Test::KnownIntermediate");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, known intermediate as intermediate (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_unknownMostDerived1AsKnownIntermediate(
+            newCallback_TestIntf_unknownMostDerived1AsKnownIntermediate(cb, &Callback::response, 
+                                                         &Callback::exception_unknownMostDerived1AsKnownIntermediate));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, unknown intermediate as base... " << flush;
+    {
+        try
+        {
+            test->unknownMostDerived2AsBase();
+            test(false);
+        }
+        catch(const Base& b)
+        {
+            test(b.b == "UnknownMostDerived2.b");
+            test(b.ice_name() =="Test::Base");
+        }
+        catch(...)
+        {
+            test(false);
+        }
+    }
+    cout << "ok" << endl;
+
+    cout << "slicing of unknown most derived, unknown intermediate as base (AMI)... " << flush;
+    {
+        CallbackPtr cb = new Callback;
+        test->begin_unknownMostDerived2AsBase(
+            newCallback_TestIntf_unknownMostDerived2AsBase(cb, &Callback::response, 
+                                                         &Callback::exception_unknownMostDerived2AsBase));
+        cb->check();
+    }
+    cout << "ok" << endl;
+
+    return test;
+}

Propchange: techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/AllTests.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/Client.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Client.cpp?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Client.cpp (added)
+++ techdemo/team/kpfleming/slicing/exceptions/Client.cpp Thu Apr  1 17:10:50 2010
@@ -1,0 +1,57 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+using namespace Test;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+    TestIntfPrx allTests(const Ice::CommunicatorPtr&);
+    TestIntfPrx Test = allTests(communicator);
+    Test->shutdown();
+    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;
+}

Propchange: techdemo/team/kpfleming/slicing/exceptions/Client.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/Client.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/Client.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/Makefile
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Makefile?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Makefile (added)
+++ techdemo/team/kpfleming/slicing/exceptions/Makefile Thu Apr  1 17:10:50 2010
@@ -1,0 +1,56 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir	= ../../../..
+
+CLIENT		= client
+SERVER		= server
+SERVERAMD	= serveramd
+
+TARGETS		= $(CLIENT) $(SERVER) $(SERVERAMD)
+
+COBJS		= Test.o \
+		  Client.o \
+		  AllTests.o
+
+SOBJS		= Test.o \
+    		  ServerPrivate.o \
+		  TestI.o \
+		  Server.o
+
+SAMDOBJS	= TestAMD.o \
+    		  ServerPrivateAMD.o \
+		  TestAMDI.o \
+		  ServerAMD.o
+
+SRCS		= $(COBJS:.o=.cpp) \
+		  $(SOBJS:.o=.cpp) \
+		  $(SAMDOBJS:.o=.cpp)
+
+SLICE_SRCS	= Test.ice TestAMD.ice ServerPrivate.ice ServerPrivateAMD.ice
+
+include $(top_srcdir)/config/Make.rules
+
+ICECPPFLAGS	:= -I. $(ICECPPFLAGS)
+
+CPPFLAGS	:= -I. -I../../../include $(CPPFLAGS)
+
+$(CLIENT): $(COBJS)
+	rm -f $@
+	$(CXX) $(LDFLAGS) -o $@ $(COBJS) $(LIBS)
+
+$(SERVER): $(SOBJS)
+	rm -f $@
+	$(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS)
+
+$(SERVERAMD): $(SAMDOBJS)
+	rm -f $@
+	$(CXX) $(LDFLAGS) -o $@ $(SAMDOBJS) $(LIBS)
+
+include .depend

Propchange: techdemo/team/kpfleming/slicing/exceptions/Makefile
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/Makefile
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/Makefile
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/Server.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Server.cpp?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Server.cpp (added)
+++ techdemo/team/kpfleming/slicing/exceptions/Server.cpp Thu Apr  1 17:10:50 2010
@@ -1,0 +1,60 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestI.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 12010 -t 2000");
+    Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+    Ice::ObjectPtr object = new TestI();
+    adapter->add(object, communicator->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;
+}

Propchange: techdemo/team/kpfleming/slicing/exceptions/Server.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/Server.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/Server.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp (added)
+++ techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp Thu Apr  1 17:10:50 2010
@@ -1,0 +1,60 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#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 12010 -t 2000");
+    Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+    Ice::ObjectPtr object = new TestI();
+    adapter->add(object, communicator->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;
+}

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerAMD.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice (added)
+++ techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice Thu Apr  1 17:10:50 2010
@@ -1,0 +1,40 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef SERVERPRIVATE_ICE
+#define SERVERPRIVATE_ICE
+
+#include <Test.ice>
+
+module Test
+{
+
+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

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivate.ice
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice (added)
+++ techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice Thu Apr  1 17:10:50 2010
@@ -1,0 +1,40 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef SERVERPRIVATEAMD_ICE
+#define SERVERPRIVATEAMD_ICE
+
+#include <TestAMD.ice>
+
+module Test
+{
+
+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

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/ServerPrivateAMD.ice
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/Test.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Test.ice?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Test.ice (added)
+++ techdemo/team/kpfleming/slicing/exceptions/Test.ice Thu Apr  1 17:10:50 2010
@@ -1,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+module Test
+{
+
+exception Base
+{
+    string b;
+};
+
+exception KnownDerived extends Base
+{
+    string kd;
+};
+
+exception KnownIntermediate extends Base
+{
+    string ki;
+};
+
+exception KnownMostDerived extends KnownIntermediate
+{
+    string kmd;
+};
+
+["ami"] interface TestIntf
+{
+    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

Propchange: techdemo/team/kpfleming/slicing/exceptions/Test.ice
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/kpfleming/slicing/exceptions/Test.ice
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: techdemo/team/kpfleming/slicing/exceptions/Test.ice
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/kpfleming/slicing/exceptions/TestAMD.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/TestAMD.ice?view=auto&rev=563
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/TestAMD.ice (added)
+++ techdemo/team/kpfleming/slicing/exceptions/TestAMD.ice Thu Apr  1 17:10:50 2010
@@ -1,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_AMD_ICE
+#define TEST_AMD_ICE
+
+module Test
+{
+
+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 TestIntf
+{
+    void baseAsBase() throws Base;
+    void unknownDerivedAsBase() throws Base;
+    void knownDerivedAsBase() throws Base;
+    void knownDerivedAsKnownDerived() throws KnownDerived;
+
+    void unknownIntermediateAsBase() throws Base;

[... 4050 lines stripped ...]




More information about the asterisk-scf-commits mailing list