[hydra-commits] beagles: branch ice/preserve-graphs r641 - in /ice/branches/preserve-graphs: ...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Tue May 25 09:56:30 CDT 2010
Author: beagles
Date: Tue May 25 09:56:29 2010
New Revision: 641
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=641
Log:
Fix some typos in exceptions generation and add exception test suite modifications
Added:
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice (with props)
Modified:
ice/branches/preserve-graphs/cpp/src/slice2cs/Gen.cpp
ice/branches/preserve-graphs/cpp/src/slice2java/Gen.cpp
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/AllTests.cs
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile.mak
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Test.ice
ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/TestI.cs
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs
ice/branches/preserve-graphs/java/build.xml
ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/AllTests.java
ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/Test.ice
ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/TestI.java
ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java
Modified: ice/branches/preserve-graphs/cpp/src/slice2cs/Gen.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cpp/src/slice2cs/Gen.cpp?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cpp/src/slice2cs/Gen.cpp (original)
+++ ice/branches/preserve-graphs/cpp/src/slice2cs/Gen.cpp Tue May 25 09:56:29 2010
@@ -2879,7 +2879,7 @@
_out << nl << "throw new Ice.MarshalException(\"unable to locate preserved object\");";
_out << eb;
_out << eb;
- _out << nl << "idMap.put(i.typeId, offsetSeq);";
+ _out << nl << "idMap.Add(i.typeId, offsetSeq);";
_out << nl << "os__.writeBlob(blob);";
_out << eb;
_out << nl << "else";
@@ -2907,7 +2907,7 @@
{
_out << nl << "Ice.ObjectIdOffset offset;";
_out << nl << "offset.id = 0;";
- _out << nl << "_System.Collections.Generic.List<Ice.ObjectIdOffset> offsetSeq = _System.Collections.Generic.new List<Ice.ObjectIdOffset>();";
+ _out << nl << "_System.Collections.Generic.List<Ice.ObjectIdOffset> offsetSeq = new _System.Collections.Generic.List<Ice.ObjectIdOffset>();";
}
for(q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
@@ -2918,7 +2918,7 @@
{
_out << nl << "if(offsetSeq.Count > 0)";
_out << sb;
- _out << nl << "idMap.put(ice_staticId(), offsetSeq);";
+ _out << nl << "idMap.Add(\"" << scoped << "\", offsetSeq);";
_out << eb;
}
if(switchWrites)
@@ -3047,7 +3047,7 @@
}
if(switchWrites)
{
- _out << nl << "objectIdMap__ = Ice.ObjectIdMap.read(is__);";
+ _out << nl << "objectIdMap__ = Ice.ObjectIdMapHelper.read(is__);";
}
_out << nl << "is__.endReadSlice();";
if(switchWrites)
@@ -3060,7 +3060,7 @@
_out << nl << "foreach(Ice.ObjectIdOffset offset in objs)";
_out << sb;
_out << nl << "Ice.ObjectPatcher mappedObj;";
- _out << nl << "if(!objectMap.TryGetValue(offset.id, out mappedObj)))";
+ _out << nl << "if(!objectMap__.TryGetValue(offset.id, out mappedObj))";
_out << sb;
_out << nl << "Ice.ObjectPatcher patcher = new Ice.ObjectPatcher();";
_out << nl << "objectMap__.Add(offset.id, patcher);";
Modified: ice/branches/preserve-graphs/cpp/src/slice2java/Gen.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cpp/src/slice2java/Gen.cpp?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cpp/src/slice2java/Gen.cpp (original)
+++ ice/branches/preserve-graphs/cpp/src/slice2java/Gen.cpp Tue May 25 09:56:29 2010
@@ -2836,7 +2836,7 @@
out << eb;
out << nl << "__writeImpl(__os, idMap);";
out << eb;
- out << sp << nl << "public void" << nl << "__writeImpl(IceInternal.BasicStream __os, java.util.HashMap<String, java.util.ArrayList<Ice.ObjectIdOffset>> idMap)";
+ out << sp << nl << "public void" << nl << "__writeImpl(IceInternal.BasicStream __os, java.util.Map<String, java.util.List<Ice.ObjectIdOffset>> idMap)";
out << sb;
}
out << nl << "__os.writeString(\"" << scoped << "\");";
@@ -2857,7 +2857,7 @@
{
out << nl << "if(offsetSeq.size() > 0)";
out << sb;
- out << nl << "idMap.put(ice_staticId(), offsetSeq);";
+ out << nl << "idMap.put(\"" << scoped << "\", offsetSeq);";
out << eb;
}
if(switchWrites)
@@ -3005,7 +3005,7 @@
{
out << nl << "for(Ice.SkippedSlice i : __preserved)";
out << sb;
- out << nl << "java.util.ArrayList<Ice.ObjectIdOffset> objs = __objectIdMap.get(i.typeId);";
+ out << nl << "java.util.List<Ice.ObjectIdOffset> objs = __objectIdMap.get(i.typeId);";
out << nl << "if(objs != null)";
out << sb;
out << nl << "for(Ice.ObjectIdOffset offset : objs)";
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/AllTests.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/AllTests.cs?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/AllTests.cs (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/AllTests.cs Tue May 25 09:56:29 2010
@@ -315,6 +315,46 @@
private Callback callback = new Callback();
}
+
+ class ClientI : ClientIntfDisp_
+ {
+ public ClientI()
+ {
+ }
+
+ public override void baseAsBase(Ice.Current current)
+ {
+ Base ex = new Base();
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public override void unknownDerivedAsBase(Ice.Current current)
+ {
+ ClientUnknownDerived ex = new ClientUnknownDerived();
+ ex.ud = "UnknownDerived";
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public override void unsliceableDerivedAsBase(Ice.Current current)
+ {
+ ClientUnsliceableDerived ex = new ClientUnsliceableDerived();
+ ex.ud = "UnsliceableDerived";
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public override void unsliceableWithInnerClass(Ice.Current current)
+ {
+ ClientUnsliceableWithClass ex = new ClientUnsliceableWithClass();
+ ex.b = "WithInnerClass";
+ ex.myObj = new InnerClassDerived();
+ ex.myObj.ic = "InnerClass";
+ ex.myObj.id = "InnerClassDerived";
+ throw ex;
+ }
+ }
public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated)
{
@@ -324,6 +364,7 @@
Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
test(@base != null);
Console.Out.WriteLine("ok");
+
Console.Out.Write("testing checked cast... ");
Console.Out.Flush();
@@ -331,6 +372,11 @@
test(testPrx != null);
test(testPrx.Equals(@base));
Console.Out.WriteLine("ok");
+
+ communicator.getProperties().setProperty("ClientAdapter.Endpoints", "default -p 12020 -t 2000");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ClientAdapter");
+ ClientIntfPrx clientPrx = ClientIntfPrxHelper.uncheckedCast(adapter.addWithUUID(new ClientI()));
+ adapter.activate();
Console.Out.Write("base... ");
Console.Out.Flush();
@@ -730,6 +776,158 @@
cb.check();
}
Console.Out.WriteLine("ok");
+
+ Console.Out.Write("base pass through server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientBaseAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::Base"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("base rethrown by server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientBaseAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::Base"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("unknown derived pass through server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientUnknownDerivedAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::ClientUnknownDerived"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("unknown derived pass rethrown by server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientUnknownDerivedAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::ClientUnknownDerived"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("unsliceable derived pass through server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientUnsliceableDerivedAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::ClientUnsliceableDerived"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("unsliceable derived rethrown by server... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientUnsliceableDerivedAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.Equals("Base"));
+ test(b.ice_name().Equals("Test::ClientUnsliceableDerived"));
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("unsliceable derived rethrown by server with inner class... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ testPrx.clientUnsliceableInnerClassRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.ice_name().Equals("Test::ClientUnsliceableWithClass"));
+ try
+ {
+ ClientUnsliceableWithClass ex = (ClientUnsliceableWithClass)b;
+ test(ex.myObj != null);
+ test(ex.myObj.ice_id().Equals("::Test::InnerClassDerived"));
+ test(ex.myObj.ic.Equals("InnerClass"));
+ test(ex.myObj.id.Equals("InnerClassDerived"));
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
return testPrx;
}
Added: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice?view=auto&rev=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice (added)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice Tue May 25 09:56:29 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 CLIENTPRIVATE_ICE
+#define CLIENTPRIVATE_ICE
+
+#include <Test.ice>
+
+module Test
+{
+
+class InnerClassDerived extends InnerClass
+{
+ string id;
+};
+
+exception ClientUnknownDerived extends Base
+{
+ string ud;
+};
+
+exception ClientUnsliceableDerived extends BaseUnsliceable
+{
+ string ud;
+};
+
+exception ClientUnsliceableWithClass extends BaseUnsliceable
+{
+ InnerClassDerived myObj;
+};
+
+};
+
+#endif
Propchange: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice
------------------------------------------------------------------------------
svn:executable = *
Propchange: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/ClientPrivate.ice
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile Tue May 25 09:56:29 2010
@@ -15,7 +15,9 @@
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = Server.cs TestAMDI.cs
-SLICE_SRCS = $(SDIR)/Test.ice
+SLICE_SRCS = $(SDIR)/Test.ice \
+ $(SDIR)/ClientPrivate.ice
+
SLICE_S_SRCS = $(SDIR)/ServerPrivate.ice
SLICE_AMD_SRCS = $(SDIR)/TestAMD.ice
SLICE_SAMD_SRCS = $(SDIR)/ServerPrivateAMD.ice
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile.mak
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile.mak?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile.mak (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Makefile.mak Tue May 25 09:56:29 2010
@@ -15,7 +15,9 @@
S_SRCS = Server.cs TestI.cs
SAMD_SRCS = Server.cs TestAMDI.cs
-GEN_SRCS = $(GDIR)\Test.cs
+GEN_SRCS = $(GDIR)\Test.cs \
+ $(GDIR)\ClientPrivate.cs
+
SGEN_SRCS = $(GDIR)\ServerPrivate.cs
GEN_AMD_SRCS = $(GDIR)\TestAMD.cs
SAMD_GEN_SRCS = $(GDIR)\ServerPrivateAMD.cs
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Test.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Test.ice?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Test.ice (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/Test.ice Tue May 25 09:56:29 2010
@@ -33,6 +33,25 @@
string kmd;
};
+["preserve"]
+exception BaseUnsliceable extends Base
+{
+};
+
+["preserve"]
+class InnerClass
+{
+ string ic;
+};
+
+interface ClientIntf
+{
+ void baseAsBase() throws Base;
+ void unknownDerivedAsBase() throws Base;
+ void unsliceableDerivedAsBase() throws Base;
+ void unsliceableWithInnerClass() throws Base;
+};
+
interface TestIntf
{
void baseAsBase() throws Base;
@@ -51,6 +70,14 @@
void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate;
void unknownMostDerived2AsBase() throws Base;
+ void clientBaseAsBasePass(ClientIntf* client) throws Base;
+ void clientUnknownDerivedAsBasePass(ClientIntf* client) throws Base;
+ void clientUnsliceableDerivedAsBasePass(ClientIntf* client) throws Base;
+ void clientBaseAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnknownDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnsliceableDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnsliceableInnerClassRethrow(ClientIntf* client) throws Base;
+
void shutdown();
};
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/TestI.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/TestI.cs?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/TestI.cs (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/exceptions/TestI.cs Tue May 25 09:56:29 2010
@@ -128,4 +128,74 @@
umd2.umd2 = "UnknownMostDerived2.umd2";
throw umd2;
}
+
+ public override void
+ clientBaseAsBasePass(ClientIntfPrx client, Ice.Current current)
+ {
+ client.baseAsBase();
+ }
+
+ public override void
+ clientUnknownDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+ {
+ client.unknownDerivedAsBase();
+ }
+
+ public override void
+ clientUnsliceableDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+ {
+ client.unsliceableDerivedAsBase();
+ }
+
+ public override void
+ clientBaseAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ {
+ try
+ {
+ client.baseAsBase();
+ }
+ catch(Ice.Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ public override void
+ clientUnknownDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ {
+ try
+ {
+ client.unknownDerivedAsBase();
+ }
+ catch(Ice.Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ public override void
+ clientUnsliceableDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ {
+ try
+ {
+ client.unsliceableDerivedAsBase();
+ }
+ catch(Ice.Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ public override void
+ clientUnsliceableInnerClassRethrow(ClientIntfPrx client, Ice.Current current)
+ {
+ try
+ {
+ client.unsliceableWithInnerClass();
+ }
+ catch(Ice.Exception ex)
+ {
+ throw ex;
+ }
+ }
}
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs Tue May 25 09:56:29 2010
@@ -400,8 +400,7 @@
{
Console.Out.Write("testing stringToProxy... ");
Console.Out.Flush();
- // XXX string r = "Test:default -p 12010 -t 2000";
- string r = "Test:default -p 12010";
+ string r = "Test:default -p 12010 -t 2000";
Ice.ObjectPrx basePrx = communicator.stringToProxy(r);
test(basePrx != null);
Console.Out.WriteLine("ok");
Modified: ice/branches/preserve-graphs/java/build.xml
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/build.xml?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/java/build.xml (original)
+++ ice/branches/preserve-graphs/java/build.xml Tue May 25 09:56:29 2010
@@ -330,6 +330,7 @@
<include name="Test.ice" />
<include name="ServerPrivate.ice" />
<include name="ServerPrivateAMD.ice" />
+ <include name="ClientPrivate.ice" />
</fileset>
<fileset dir="test/Ice/slicing/objects">
<include name="ServerPrivate.ice" />
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/AllTests.java
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/AllTests.java?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/AllTests.java (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/AllTests.java Tue May 25 09:56:29 2010
@@ -28,6 +28,14 @@
import test.Ice.slicing.exceptions.Test.KnownMostDerived;
import test.Ice.slicing.exceptions.Test.TestIntfPrx;
import test.Ice.slicing.exceptions.Test.TestIntfPrxHelper;
+import test.Ice.slicing.exceptions.Test._ClientIntfDisp;
+import test.Ice.slicing.exceptions.Test.ClientIntfPrx;
+import test.Ice.slicing.exceptions.Test.ClientIntfPrxHelper;
+import test.Ice.slicing.exceptions.Test.ClientUnknownDerived;
+import test.Ice.slicing.exceptions.Test.ClientUnsliceableDerived;
+import test.Ice.slicing.exceptions.Test.ClientUnsliceableWithClass;
+import test.Ice.slicing.exceptions.Test.InnerClass;
+import test.Ice.slicing.exceptions.Test.InnerClassDerived;
public class AllTests
{
@@ -641,10 +649,59 @@
private Callback callback = new Callback();
}
+ static class ClientI extends _ClientIntfDisp
+ {
+ public
+ ClientI()
+ {
+ }
+
+ public void
+ baseAsBase(Ice.Current current)
+ throws Base
+ {
+ Base ex = new Base();
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public void
+ unknownDerivedAsBase(Ice.Current current)
+ throws Base
+ {
+ ClientUnknownDerived ex = new ClientUnknownDerived();
+ ex.ud = "UnknownDerived";
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public void
+ unsliceableDerivedAsBase(Ice.Current current)
+ throws Base
+ {
+ ClientUnsliceableDerived ex = new ClientUnsliceableDerived();
+ ex.ud = "UnsliceableDerived";
+ ex.b = "Base";
+ throw ex;
+ }
+
+ public void
+ unsliceableWithInnerClass(Ice.Current current)
+ throws Base
+ {
+ ClientUnsliceableWithClass ex = new ClientUnsliceableWithClass();
+ ex.b = "WithInnerClass";
+ ex.myObj = new InnerClassDerived();
+ ex.myObj.ic = "InnerClass";
+ ex.myObj.id = "InnerClassDerived";
+ throw ex;
+ }
+ }
+
public static TestIntfPrx
allTests(Ice.Communicator communicator, boolean collocated, java.io.PrintWriter out)
{
- out.print("testing stringToProxy... ");
+ out.print("testing stringToProxy... ");
out.flush();
String ref = "Test:default -p 12010 -t 10000";
Ice.ObjectPrx base = communicator.stringToProxy(ref);
@@ -658,6 +715,11 @@
test(test.equals(base));
out.println("ok");
+ communicator.getProperties().setProperty("ClientAdapter.Endpoints", "default -p 12020 -t 2000");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ClientAdapter");
+ ClientIntfPrx clientPrx = ClientIntfPrxHelper.uncheckedCast(adapter.addWithUUID(new ClientI()));
+ adapter.activate();
+
out.print("base... ");
out.flush();
{
@@ -1051,6 +1113,157 @@
}
out.println("ok");
+ out.print("base pass through server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientBaseAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("base rethrown by server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientBaseAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::Base"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("unknown derived pass through server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientUnknownDerivedAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::ClientUnknownDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("unknown derived pass rethrown by server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientUnknownDerivedAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::ClientUnknownDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("unsliceable derived pass through server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientUnsliceableDerivedAsBasePass(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::ClientUnsliceableDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("unsliceable derived rethrown by server... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientUnsliceableDerivedAsBaseRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.b.equals("Base"));
+ test(b.ice_name().equals("Test::ClientUnsliceableDerived"));
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("unsliceable derived rethrown by server with inner class... ");
+ out.flush();
+ {
+ try
+ {
+ test.clientUnsliceableInnerClassRethrow(clientPrx);
+ test(false);
+ }
+ catch(Base b)
+ {
+ test(b.ice_name().equals("Test::ClientUnsliceableWithClass"));
+ try
+ {
+ ClientUnsliceableWithClass ex = (ClientUnsliceableWithClass)b;
+ test(ex.myObj != null);
+ test(ex.myObj.ice_id().equals("::Test::InnerClassDerived"));
+ test(ex.myObj.ic.equals("InnerClass"));
+ test(ex.myObj.id.equals("InnerClassDerived"));
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
return test;
}
}
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/Test.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/Test.ice?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/Test.ice (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/Test.ice Tue May 25 09:56:29 2010
@@ -34,6 +34,25 @@
string kmd;
};
+["preserve"]
+exception BaseUnsliceable extends Base
+{
+};
+
+["preserve"]
+class InnerClass
+{
+ string ic;
+};
+
+interface ClientIntf
+{
+ void baseAsBase() throws Base;
+ void unknownDerivedAsBase() throws Base;
+ void unsliceableDerivedAsBase() throws Base;
+ void unsliceableWithInnerClass() throws Base;
+};
+
interface TestIntf
{
void baseAsBase() throws Base;
@@ -52,6 +71,14 @@
void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate;
void unknownMostDerived2AsBase() throws Base;
+ void clientBaseAsBasePass(ClientIntf* client) throws Base;
+ void clientUnknownDerivedAsBasePass(ClientIntf* client) throws Base;
+ void clientUnsliceableDerivedAsBasePass(ClientIntf* client) throws Base;
+ void clientBaseAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnknownDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnsliceableDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+ void clientUnsliceableInnerClassRethrow(ClientIntf* client) throws Base;
+
void shutdown();
};
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/TestI.java
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/TestI.java?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/TestI.java (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/exceptions/TestI.java Tue May 25 09:56:29 2010
@@ -18,6 +18,8 @@
import test.Ice.slicing.exceptions.server.Test.UnknownMostDerived1;
import test.Ice.slicing.exceptions.server.Test.UnknownMostDerived2;
import test.Ice.slicing.exceptions.server.Test._TestIntfDisp;
+import test.Ice.slicing.exceptions.Test.ClientIntfPrx;
+import test.Ice.slicing.exceptions.Test.ClientIntfPrxHelper;
public final class TestI extends _TestIntfDisp
{
@@ -166,4 +168,81 @@
umd2.umd2 = "UnknownMostDerived2.umd2";
throw umd2;
}
+
+ public void
+ clientBaseAsBasePass(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ client.baseAsBase();
+ }
+
+ public void
+ clientUnknownDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ client.unknownDerivedAsBase();
+ }
+
+ public void
+ clientUnsliceableDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ client.unsliceableDerivedAsBase();
+ }
+
+ public void
+ clientBaseAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ try
+ {
+ client.baseAsBase();
+ }
+ catch(test.Ice.slicing.exceptions.Test.Base ex)
+ {
+ throw ex;
+ }
+ }
+
+ public void
+ clientUnknownDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ try
+ {
+ client.unknownDerivedAsBase();
+ }
+ catch(test.Ice.slicing.exceptions.Test.Base ex)
+ {
+ throw ex;
+ }
+ }
+
+ public void
+ clientUnsliceableDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ try
+ {
+ client.unsliceableDerivedAsBase();
+ }
+ catch(test.Ice.slicing.exceptions.Test.Base ex)
+ {
+ throw ex;
+ }
+ }
+
+ public void
+ clientUnsliceableInnerClassRethrow(ClientIntfPrx client, Ice.Current current)
+ throws test.Ice.slicing.exceptions.Test.Base
+ {
+ try
+ {
+ client.unsliceableWithInnerClass();
+ }
+ catch(test.Ice.slicing.exceptions.Test.Base ex)
+ {
+ throw ex;
+ }
+ }
}
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java?view=diff&rev=641&r1=640&r2=641
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java Tue May 25 09:56:29 2010
@@ -2112,12 +2112,6 @@
test(t6.innerD5.sd5.equals("d6.1.sd5"));
test(t6.innerD5.pd5 != null);
test(t6.innerD5.pd5.sb.equals("d6.1.d5.sb"));
- D6 t6 = (D6)t.left;
- test(t6.sd6.equals("d6.1"));
- test(t6.innerD5 != null);
- test(t6.innerD5.sd5.equals("d6.1.sd5"));
- test(t6.innerD5.pd5 != null);
- test(t6.innerD5.pd5.sb.equals("d6.1.d5.sb"));
test(t6.innerD5.pd5.pb != null);
test(t6.innerD5.pd5.pb.sb.equals("d6.1.d5.sb.sb"));
More information about the asterisk-scf-commits
mailing list