[hydra-commits] beagles: branch ice/preserve-graphs r640 - in /ice/branches/preserve-graphs: ...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Tue May 25 08:23:27 CDT 2010
Author: beagles
Date: Tue May 25 08:23:26 2010
New Revision: 640
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=640
Log:
test suite updates
Modified:
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/AllTests.cs
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/ClientPrivate.ice
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/Test.ice
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMD.ice
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMDI.cs
ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestI.cs
ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AMDTestI.java
ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AllTests.java
ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ClientPrivate.ice
ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ServerPrivateAMD.ice
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=640&r1=639&r2=640
==============================================================================
--- 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 08:23:26 2010
@@ -1133,12 +1133,183 @@
test(b2.sb.Equals("D5.sb"));
test(b2.ice_id().Equals("::Test::D5"));
test(b2.pb == b1);
- D5 p5 = (D5) b2;
- test(p5 != null);
+ try
+ {
+ D5 p5 = (D5) b2;
+ test(p5 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("return value unsliced for input params known first (AMI)... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ AsyncCallback cb = new AsyncCallback();
+ testPrx.begin_returnTest3(d1, d5).whenCompleted(cb.response_returnTest3, cb.exception);
+ cb.check();
+ B b1 = cb.rb;
+
+ test(b1 != null);
+ test(b1.sb.Equals("D1.sb"));
+ test(b1.ice_id().Equals("::Test::D1")); // Sliced by server
+
+ try
+ {
+ D1 p1 = (D1) b1;
+ test(p1 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.Equals("D5.sb"));
+ test(b2.ice_id().Equals("::Test::D5"));
+ test(b2.pb == b1);
+ try
+ {
+ D5 p5 = (D5) b2;
+ test(p5 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("return value unsliced for input params unknown first... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ B b1 = testPrx.returnTest3(d5, d1);
+
+ test(b1 != null);
+ test(b1.ice_id().Equals("::Test::D5"));
+ test(b1.sb.Equals("D5.sb"));
+ try
+ {
+ D5 p5 = (D5) b1;
+ test(p5 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.Equals("D1.sb"));
+ test(b2.ice_id().Equals("::Test::D1"));
+ try
+ {
+ D1 p1 = (D1) b2;
+ test(p1 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ catch(Exception)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("return value unsliced for input params unknown first (AMI)... ");
+ Console.Out.Flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ AsyncCallback cb = new AsyncCallback();
+ testPrx.begin_returnTest3(d5, d1).whenCompleted(cb.response_returnTest3, cb.exception);
+ cb.check();
+ B b1 = cb.rb;
+
+ test(b1 != null);
+ test(b1.ice_id().Equals("::Test::D5"));
+ test(b1.sb.Equals("D5.sb"));
+ try
+ {
+ D5 p5 = (D5) b1;
+ test(p5 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.Equals("D1.sb"));
+ test(b2.ice_id().Equals("::Test::D1"));
+ try
+ {
+ D1 p1 = (D1) b2;
+ test(p1 != null);
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
}
catch(Exception ex)
{
- Console.Out.WriteLine(ex);
+ Console.Out.WriteLine(ex);
test(false);
}
}
@@ -1217,6 +1388,140 @@
cb.check();
}
Console.Out.WriteLine("ok");
+
+ Console.Out.Write("sequence of slice-preserved objects... ");
+ Console.Out.Flush();
+ {
+ BSeq seq = new BSeq();
+ D5 current = new D5();
+ current.sd5 = "0";
+ seq.Add(current);
+ current = new D5();
+ current.sd5 = "1";
+ seq.Add(current);
+ current = new D5();
+ current.sd5 = "2";
+ seq.Add(current);
+ current = new D5();
+ current.sd5 = "3";
+ seq.Add(current);
+
+ BSeq outV;
+ BSeq ret = testPrx.echoSeq(seq, out outV);
+
+ test(seq.Count == ret.Count);
+ test(seq.Count == outV.Count);
+ for(int i = 0; i < seq.Count; ++i)
+ {
+ D5 r5 = null;
+ D5 o5 = null;
+
+ test(ret[i].ice_id().Equals("::Test::D5"));
+ test(outV[i].ice_id().Equals("::Test::D5"));
+
+ try
+ {
+ r5 = (D5)ret[i];
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ try
+ {
+ o5 = (D5)outV[i];
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ test(((D5)seq[i]).sd5.Equals(r5.sd5));
+ test(((D5)seq[i]).sd5.Equals(o5.sd5));
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("slice preserved object, unsliceable inner class... ");
+ Console.Out.Flush();
+ {
+ D7 b1 = new D7();
+ b1.sd7 = "D7.sd7";
+ b1.innerD7 = new D7();
+ b1.innerD7.sd7 = "D7.innerD7.sd7";
+ B b2 = new B();
+ b2.sb = "B.sb";
+ b2.pb = new B();
+ b2.pb.sb = "B.B.sb";
+ B result = testPrx.returnTest3(b1, b2);
+ test(result != null);
+ test(result.ice_id().Equals("::Test::D7"));
+ try
+ {
+ D7 t = (D7)result;
+ test(t.sd7.Equals("D7.sd7"));
+ test(t.innerD7 != null);
+ test(t.innerD7.sd7.Equals("D7.innerD7.sd7"));
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("object graphs of unsliceable objects... ");
+ Console.Out.Flush();
+ {
+ GraphBase graph = new GraphBase();
+ D6 d6 = new D6();
+ d6.sd6 = "d6.1";
+ d6.innerD5 = new D5();
+ d6.innerD5.sd5 = "d6.1.sd5";
+ d6.innerD5.pd5 = new B();
+ d6.innerD5.pd5.sb = "d6.1.d5.sb";
+ d6.innerD5.pd5.pb = new B();
+ d6.innerD5.pd5.pb.sb = "d6.1.d5.sb.sb";
+ graph.left = d6;
+
+ D7 d7 = new D7();
+ d7.sd7 = "d7";
+ d7.innerD7 = new D7();
+ d7.innerD7.sd7 = "d7.d7";
+ d7.innerD7.innerD7 = new D7();
+ d7.innerD7.innerD7.sd7 = "d7.d7.d7";
+ graph.right = d7;
+
+ B result = testPrx.returnTest3(graph, d7);
+ test(result != null);
+ test(result.ice_id().Equals("::Test::GraphBase"));
+ try
+ {
+ GraphBase t = (GraphBase)result;
+ test(t.left.ice_id().Equals("::Test::D6"));
+ test(t.right.ice_id().Equals("::Test::D7"));
+ 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"));
+
+ D7 t7 = (D7)t.right;
+ test(t7.sd7.Equals("d7"));
+ test(t7.innerD7 != null);
+ test(t7.innerD7.sd7.Equals("d7.d7"));
+ test(t7.innerD7.innerD7 != null);
+ test(t7.innerD7.innerD7.sd7.Equals("d7.d7.d7"));
+ }
+ catch(InvalidCastException)
+ {
+ test(false);
+ }
+ }
+ Console.Out.WriteLine("ok");
+
Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as base... ");
Console.Out.Flush();
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/ClientPrivate.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/ClientPrivate.ice?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/ClientPrivate.ice (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/ClientPrivate.ice Tue May 25 08:23:26 2010
@@ -26,6 +26,24 @@
string sd5;
B pd5;
};
+
+class GraphBase extends BU
+{
+ BU left;
+ BU right;
+};
+
+class D6 extends BU
+{
+ string sd6;
+ D5 innerD5;
+};
+
+class D7 extends BU
+{
+ string sd7;
+ D7 innerD7;
+};
};
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/Test.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/Test.ice?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/Test.ice (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/Test.ice Tue May 25 08:23:26 2010
@@ -99,6 +99,8 @@
B returnTest1(out B p1, out B p2);
B returnTest2(out B p2, out B p1);
B returnTest3(B p1, B p2);
+
+ BSeq echoSeq(BSeq p1, out BSeq p2);
SS sequenceTest(SS1 p1, SS2 p2);
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMD.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMD.ice?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMD.ice (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMD.ice Tue May 25 08:23:26 2010
@@ -100,6 +100,8 @@
B returnTest2(out B p2, out B p1);
B returnTest3(B p1, B p2);
+ BSeq echoSeq(BSeq p1, out BSeq p2);
+
SS sequenceTest(SS1 p1, SS2 p2);
BDict dictionaryTest(BDict bin, out BDict bout);
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMDI.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMDI.cs?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMDI.cs (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestAMDI.cs Tue May 25 08:23:26 2010
@@ -235,6 +235,11 @@
public override void returnTest3_async(AMD_TestIntf_returnTest3 cb, B p1, B p2, Ice.Current current)
{
cb.ice_response(p1);
+ }
+
+ public override void echoSeq_async(AMD_TestIntf_echoSeq cb, BSeq p1, Ice.Current current)
+ {
+ cb.ice_response(p1, p1);
}
public override void sequenceTest_async(AMD_TestIntf_sequenceTest cb, SS1 p1, SS2 p2, Ice.Current current)
Modified: ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestI.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestI.cs?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestI.cs (original)
+++ ice/branches/preserve-graphs/cs/test/Ice/slicing/objects/TestI.cs Tue May 25 08:23:26 2010
@@ -210,6 +210,12 @@
public override B returnTest3(B p1, B p2, Ice.Current current)
{
+ return p1;
+ }
+
+ public override BSeq echoSeq(BSeq p1, out BSeq p2, Ice.Current current)
+ {
+ p2 = p1;
return p1;
}
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AMDTestI.java
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AMDTestI.java?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AMDTestI.java (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/objects/AMDTestI.java Tue May 25 08:23:26 2010
@@ -28,6 +28,7 @@
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_returnTest2;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_returnTest3;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_sequenceTest;
+import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_echoSeq;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_shutdown;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_throwBaseAsBase;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_throwDerivedAsBase;
@@ -36,6 +37,7 @@
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_twoElementCycle;
import test.Ice.slicing.objects.serverAMD.Test.AMD_TestIntf_useForward;
import test.Ice.slicing.objects.serverAMD.Test.B;
+import test.Ice.slicing.objects.serverAMD.Test.BSeqHolder;
import test.Ice.slicing.objects.serverAMD.Test.BaseException;
import test.Ice.slicing.objects.serverAMD.Test.D1;
import test.Ice.slicing.objects.serverAMD.Test.D2;
@@ -297,6 +299,12 @@
returnTest3_async(AMD_TestIntf_returnTest3 cb, B p1, B p2, Ice.Current current)
{
cb.ice_response(p1);
+ }
+
+ public void
+ echoSeq_async(AMD_TestIntf_echoSeq cb, B[] p1, Ice.Current current)
+ {
+ cb.ice_response(p1, p1);
}
public void
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=640&r1=639&r2=640
==============================================================================
--- 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 08:23:26 2010
@@ -38,6 +38,7 @@
import test.Ice.slicing.objects.client.Test.Callback_TestIntf_twoElementCycle;
import test.Ice.slicing.objects.client.Test.Callback_TestIntf_useForward;
import test.Ice.slicing.objects.client.Test.B;
+import test.Ice.slicing.objects.client.Test.BSeqHolder;
import test.Ice.slicing.objects.client.Test.BU;
import test.Ice.slicing.objects.client.Test.BDictHolder;
import test.Ice.slicing.objects.client.Test.BHolder;
@@ -45,6 +46,9 @@
import test.Ice.slicing.objects.client.Test.D1;
import test.Ice.slicing.objects.client.Test.D3;
import test.Ice.slicing.objects.client.Test.D5;
+import test.Ice.slicing.objects.client.Test.GraphBase;
+import test.Ice.slicing.objects.client.Test.D6;
+import test.Ice.slicing.objects.client.Test.D7;
import test.Ice.slicing.objects.client.Test.DerivedException;
import test.Ice.slicing.objects.client.Test.SBSKnownDerived;
import test.Ice.slicing.objects.client.Test.SBase;
@@ -1757,6 +1761,166 @@
}
out.println("ok");
+ out.print("return value unsliced for input params known first (AMI)... ");
+ out.flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ Callback_TestIntf_returnTest3I cb = new Callback_TestIntf_returnTest3I();
+ test.begin_returnTest3(d1, d5, cb);
+ cb.check();
+ B b1 = cb.r;
+
+ test(b1 != null);
+ test(b1.sb.equals("D1.sb"));
+ test(b1.ice_id().equals("::Test::D1"));
+ try
+ {
+ D1 p1 = (D1)b1;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D5.sb"));
+ test(b2.ice_id().equals("::Test::D5"));
+ test(b2.pb == b1);
+ try
+ {
+ D5 p5 = (D5)b2;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("return value unsliced for input params unknown first... ");
+ out.flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ B b1 = test.returnTest3(d5, d1);
+
+ test(b1 != null);
+ test(b1.sb.equals("D5.sb"));
+ test(b1.ice_id().equals("::Test::D5")); // *NOT* Sliced by server
+
+ try
+ {
+ D5 p1 = (D5)b1;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D1.sb"));
+ test(b2.ice_id().equals("::Test::D1"));
+ test(b2.pb == b1);
+ try
+ {
+ D1 p5 = (D1)b2;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("return value unsliced for input params unknown first (AMI)... ");
+ out.flush();
+ {
+ try
+ {
+ D1 d1 = new D1();
+ d1.sb = "D1.sb";
+ d1.sd1 = "D1.sd1";
+ D5 d5 = new D5();
+ d5.pb = d1;
+ d5.sb = "D5.sb";
+ d5.sd5 = "D5.sd5";
+ d5.pd5 = d1;
+ d1.pb = d5;
+ d1.pd1 = d5;
+
+ Callback_TestIntf_returnTest3I cb = new Callback_TestIntf_returnTest3I();
+ test.begin_returnTest3(d5, d1, cb);
+ cb.check();
+ B b1 = cb.r;
+ test(b1 != null);
+ test(b1.sb.equals("D5.sb"));
+ test(b1.ice_id().equals("::Test::D5")); // *NOT* Sliced by server
+
+ try
+ {
+ D5 p1 = (D5)b1;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+
+ B b2 = b1.pb;
+ test(b2 != null);
+ test(b2.sb.equals("D1.sb"));
+ test(b2.ice_id().equals("::Test::D1"));
+ test(b2.pb == b1);
+ try
+ {
+ D1 p5 = (D1)b2;
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ catch(Exception ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
out.print("remainder unmarshaling (3 instances)... ");
out.flush();
{
@@ -1831,6 +1995,146 @@
}
out.println("ok");
+ out.print("sequence of slice-preserved objects... ");
+ out.flush();
+ {
+ B bseq[] = new B[4];
+ D5 current = new D5();
+ current.sd5 = "0";
+ bseq[0] = current;
+ current = new D5();
+ current.sd5 = "1";
+ bseq[1] = current;
+ current = new D5();
+ current.sd5 = "2";
+ bseq[2] = current;
+ current = new D5();
+ current.sd5 = "3";
+ bseq[3] = current;
+
+ BSeqHolder outHolder = new BSeqHolder();
+ B[] ret = test.echoSeq(bseq, outHolder);
+ B[] outV = outHolder.value;
+ test(outV.length == bseq.length);
+ test(ret.length == bseq.length);
+ for(int i = 0; i < bseq.length; ++i)
+ {
+ D5 r5 = null;
+ D5 o5 = null;
+
+ test(outV[i].ice_id().equals("::Test::D5"));
+ test(ret[i].ice_id().equals("::Test::D5"));
+
+ try
+ {
+ r5 = (D5)ret[i];
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ try
+ {
+ o5 = (D5)outV[i];
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ test(((D5)bseq[i]).sd5.equals(r5.sd5));
+ test(((D5)bseq[i]).sd5.equals(o5.sd5));
+ }
+
+ }
+ out.println("ok");
+
+ out.print("slice preserved object, unsliceable inner class... ");
+ out.flush();
+ {
+ D7 b1 = new D7();
+ b1.sd7 = "D7.sd7";
+ b1.innerD7 = new D7();
+ b1.innerD7.sd7 = "D7.innerD7.sd7";
+ B b2 = new B();
+ b2.sb = "B.sb";
+ b2.pb = new B();
+ b2.pb.sb = "B.B.sb";
+ B result = test.returnTest3(b1, b2);
+ test(result != null);
+ test(result.ice_id().equals("::Test::D7"));
+ try
+ {
+ D7 t = (D7)result;
+ test(t.sd7.equals("D7.sd7"));
+ test(t.innerD7 != null);
+ test(t.innerD7.sd7.equals("D7.innerD7.sd7"));
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
+ out.print("object graphs of unsliceable objects... ");
+ out.flush();
+ {
+ GraphBase graph = new GraphBase();
+ D6 d6 = new D6();
+ d6.sd6 = "d6.1";
+ d6.innerD5 = new D5();
+ d6.innerD5.sd5 = "d6.1.sd5";
+ d6.innerD5.pd5 = new B();
+ d6.innerD5.pd5.sb = "d6.1.d5.sb";
+ d6.innerD5.pd5.pb = new B();
+ d6.innerD5.pd5.pb.sb = "d6.1.d5.sb.sb";
+ graph.left = d6;
+
+ D7 d7 = new D7();
+ d7.sd7 = "d7";
+ d7.innerD7 = new D7();
+ d7.innerD7.sd7 = "d7.d7";
+ d7.innerD7.innerD7 = new D7();
+ d7.innerD7.innerD7.sd7 = "d7.d7.d7";
+ graph.right = d7;
+
+ B result = test.returnTest3(graph, d7);
+ test(result != null);
+ test(result.ice_id().equals("::Test::GraphBase"));
+ try
+ {
+ GraphBase t = (GraphBase)result;
+ test(t.left.ice_id().equals("::Test::D6"));
+ test(t.right.ice_id().equals("::Test::D7"));
+ 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"));
+ 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"));
+
+ D7 t7 = (D7)t.right;
+ test(t7.sd7.equals("d7"));
+ test(t7.innerD7 != null);
+ test(t7.innerD7.sd7.equals("d7.d7"));
+ test(t7.innerD7.innerD7 != null);
+ test(t7.innerD7.innerD7.sd7.equals("d7.d7.d7"));
+ }
+ catch(ClassCastException ex)
+ {
+ test(false);
+ }
+ }
+ out.println("ok");
+
out.print("param ptr slicing, instance marshaled in unknown derived as base... ");
out.flush();
{
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ClientPrivate.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ClientPrivate.ice?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ClientPrivate.ice (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ClientPrivate.ice Tue May 25 08:23:26 2010
@@ -133,6 +133,24 @@
B pd5;
};
+class GraphBase extends BU
+{
+ BU left;
+ BU right;
+};
+
+class D6 extends BU
+{
+ string sd6;
+ D5 innerD5;
+};
+
+class D7 extends BU
+{
+ string sd7;
+ D7 innerD7;
+};
+
class Forward;
class Hidden
Modified: ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ServerPrivateAMD.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ServerPrivateAMD.ice?view=diff&rev=640&r1=639&r2=640
==============================================================================
--- ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ServerPrivateAMD.ice (original)
+++ ice/branches/preserve-graphs/java/test/Ice/slicing/objects/ServerPrivateAMD.ice Tue May 25 08:23:26 2010
@@ -103,6 +103,8 @@
B returnTest2(out B p2, out B p1);
B returnTest3(B p1, B p2);
+ BSeq echoSeq(BSeq s1, out BSeq s2);
+
SS sequenceTest(SS1 p1, SS2 p2);
BDict dictionaryTest(BDict bin, out BDict bout);
More information about the asterisk-scf-commits
mailing list