diff options
Diffstat (limited to 'java-compat/test')
6 files changed, 87 insertions, 16 deletions
diff --git a/java-compat/test/src/main/java/test/Ice/exceptions/AllTests.java b/java-compat/test/src/main/java/test/Ice/exceptions/AllTests.java index d00bd7bef7c..bb5e82db6f4 100644 --- a/java-compat/test/src/main/java/test/Ice/exceptions/AllTests.java +++ b/java-compat/test/src/main/java/test/Ice/exceptions/AllTests.java @@ -1131,6 +1131,10 @@ public class AllTests catch(Ice.ConnectionLostException ex) { } + catch(Ice.UnknownLocalException ex) + { + // Expected with JS bidir server + } catch(Ice.SocketException ex) { // This can be raised if the connection is closed during the client's call to write(). @@ -1141,24 +1145,31 @@ public class AllTests test(false); } - ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast( - communicator.stringToProxy("thrower:" + app.getTestEndpoint(1))); try { - thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) - } - catch(Ice.MemoryLimitException ex) - { - } - ThrowerPrx thrower3 = ThrowerPrxHelper.uncheckedCast( - communicator.stringToProxy("thrower:" + app.getTestEndpoint(2))); - try - { - thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit - test(false); + ThrowerPrx thrower2 = ThrowerPrxHelper.uncheckedCast( + communicator.stringToProxy("thrower:" + app.getTestEndpoint(1))); + try + { + thrower2.throwMemoryLimitException(new byte[2 * 1024 * 1024]); // 2MB (no limits) + } + catch(Ice.MemoryLimitException ex) + { + } + ThrowerPrx thrower3 = ThrowerPrxHelper.uncheckedCast( + communicator.stringToProxy("thrower:" + app.getTestEndpoint(2))); + try + { + thrower3.throwMemoryLimitException(new byte[1024]); // 1KB limit + test(false); + } + catch(Ice.ConnectionLostException ex) + { + } } - catch(Ice.ConnectionLostException ex) + catch(Ice.ConnectionRefusedException ex) { + // Expected with JS bidir server } out.println("ok"); diff --git a/java-compat/test/src/main/java/test/Ice/objects/AllTests.java b/java-compat/test/src/main/java/test/Ice/objects/AllTests.java index f71bf5010a4..0e4588c6e94 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/AllTests.java +++ b/java-compat/test/src/main/java/test/Ice/objects/AllTests.java @@ -31,6 +31,7 @@ import test.Ice.objects.Test.BaseSeqHolder; import test.Ice.objects.Test.InitialPrx; import test.Ice.objects.Test.InitialPrxHelper; import test.Ice.objects.Test.J; +import test.Ice.objects.Test.Recursive; import test.Ice.objects.Test.UnexpectedObjectExceptionTestPrx; import test.Ice.objects.Test.UnexpectedObjectExceptionTestPrxHelper; @@ -251,6 +252,42 @@ public class AllTests } out.println("ok"); + out.print("testing recursive type... "); + out.flush(); + Recursive top = new Recursive(); + Recursive p = top; + int depth = 0; + try + { + for(; depth <= 20000; ++depth) + { + p.v = new Recursive(); + p = p.v; + if((depth < 10 && (depth % 10) == 0) || + (depth < 1000 && (depth % 100) == 0) || + (depth < 10000 && (depth % 1000) == 0) || + (depth % 10000) == 0) + { + initial.setRecursive(top); + } + } + test(!initial.supportsClassGraphDepthMax()); + } + catch(Ice.UnknownLocalException ex) + { + // Expected marshal exception from the server (max class graph depth reached) + } + catch(Ice.UnknownException ex) + { + // Expected stack overflow from the server (Java only) + } + catch(java.lang.StackOverflowError ex) + { + // Stack overflow while writing instances + } + initial.setRecursive(new Recursive()); + out.println("ok"); + out.print("testing compact ID..."); out.flush(); try diff --git a/java-compat/test/src/main/java/test/Ice/objects/Collocated.java b/java-compat/test/src/main/java/test/Ice/objects/Collocated.java index f83e0167f26..9a66174ba08 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/Collocated.java +++ b/java-compat/test/src/main/java/test/Ice/objects/Collocated.java @@ -105,6 +105,7 @@ public class Collocated extends test.Util.Application { Ice.InitializationData initData = super.getInitData(argsH); initData.properties.setProperty("Ice.Package.Test", "test.Ice.objects"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); return initData; } diff --git a/java-compat/test/src/main/java/test/Ice/objects/InitialI.java b/java-compat/test/src/main/java/test/Ice/objects/InitialI.java index ddb1957d013..24ae8c3e697 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/InitialI.java +++ b/java-compat/test/src/main/java/test/Ice/objects/InitialI.java @@ -24,6 +24,7 @@ import test.Ice.objects.Test.D1; import test.Ice.objects.Test.EDerived; import test.Ice.objects.Test.Base; import test.Ice.objects.Test.BaseSeqHolder; +import test.Ice.objects.Test.Recursive; import test.Ice.objects.Test.Initial; import test.Ice.objects.Test.Compact; import test.Ice.objects.Test.CompactExt; @@ -126,6 +127,18 @@ public final class InitialI extends Initial } @Override + public void + setRecursive(Recursive r, Ice.Current current) + { + } + + @Override + public boolean supportsClassGraphDepthMax(Ice.Current current) + { + return false; + } + + @Override public B getMB(Ice.Current current) { @@ -159,14 +172,14 @@ public final class InitialI extends Initial { return new HI(); } - + @Override public D1 getD1(D1 d1, Ice.Current current) { return d1; } - + @Override public void throwEDerived(Ice.Current current) throws EDerived diff --git a/java-compat/test/src/main/java/test/Ice/objects/Server.java b/java-compat/test/src/main/java/test/Ice/objects/Server.java index 560befcbe0d..6d36d75e5f7 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/Server.java +++ b/java-compat/test/src/main/java/test/Ice/objects/Server.java @@ -58,6 +58,7 @@ public class Server extends test.Util.Application { Ice.InitializationData initData = super.getInitData(argsH); initData.properties.setProperty("Ice.Package.Test", "test.Ice.objects"); + initData.properties.setProperty("Ice.Warn.Dispatch", "0"); initData.properties.setProperty("TestAdapter.Endpoints", getTestEndpoint(initData.properties, 0)); return initData; } diff --git a/java-compat/test/src/main/java/test/Ice/objects/Test.ice b/java-compat/test/src/main/java/test/Ice/objects/Test.ice index 629cc8c10b8..07cfcd797d4 100644 --- a/java-compat/test/src/main/java/test/Ice/objects/Test.ice +++ b/java-compat/test/src/main/java/test/Ice/objects/Test.ice @@ -163,6 +163,11 @@ exception EDerived extends EBase A1 a4; }; +class Recursive +{ + Recursive v; +}; + class Initial { void shutdown(); @@ -173,6 +178,9 @@ class Initial E getE(); F getF(); + void setRecursive(Recursive p); + bool supportsClassGraphDepthMax(); + ["marshaled-result"] B getMB(); ["amd", "marshaled-result"] B getAMDMB(); |