summaryrefslogtreecommitdiff
path: root/java/test
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-01-22 15:19:02 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-01-22 15:19:02 +0100
commit3994b371119ba308c6c4f27475c1b16a1fc518eb (patch)
tree476d2e9180d79e3910430b1396431d93c43bb180 /java/test
parentMore fixes for bug3504 and fixed bug3506 (diff)
downloadice-3994b371119ba308c6c4f27475c1b16a1fc518eb.tar.bz2
ice-3994b371119ba308c6c4f27475c1b16a1fc518eb.tar.xz
ice-3994b371119ba308c6c4f27475c1b16a1fc518eb.zip
Fixed bug 3484 & 3604
Diffstat (limited to 'java/test')
-rw-r--r--java/test/Ice/udp/AllTests.java32
-rw-r--r--java/test/Ice/udp/Client.java9
-rw-r--r--java/test/Ice/udp/Server.java8
-rw-r--r--java/test/Ice/udp/Test.ice3
-rw-r--r--java/test/Ice/udp/TestIntfI.java12
5 files changed, 62 insertions, 2 deletions
diff --git a/java/test/Ice/udp/AllTests.java b/java/test/Ice/udp/AllTests.java
index b15d57f901c..5e23f10d62e 100644
--- a/java/test/Ice/udp/AllTests.java
+++ b/java/test/Ice/udp/AllTests.java
@@ -82,6 +82,38 @@ public class AllTests
obj.ping(reply);
boolean ret = replyI.waitReply(3, 2000);
test(ret == true);
+
+ byte[] seq = null;
+ try
+ {
+ seq = new byte[1024];
+ while(true)
+ {
+ seq = new byte[seq.length * 2 + 10];
+ replyI.reset();
+ obj.sendByteSeq(seq, reply);
+ replyI.waitReply(1, 10000);
+ }
+ }
+ catch(Ice.DatagramLimitException ex)
+ {
+ test(seq.length > 16384);
+ }
+
+ communicator.getProperties().setProperty("Ice.UDP.SndSize", "64000");
+ seq = new byte[50000];
+ try
+ {
+ replyI.reset();
+ obj.sendByteSeq(seq, reply);
+ test(!replyI.waitReply(1, 500));
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.err.println(ex);
+ test(false);
+ }
+
System.out.println("ok");
System.out.print("testing udp multicast... ");
diff --git a/java/test/Ice/udp/Client.java b/java/test/Ice/udp/Client.java
index 3315d78da6b..321f89d3ecf 100644
--- a/java/test/Ice/udp/Client.java
+++ b/java/test/Ice/udp/Client.java
@@ -27,7 +27,14 @@ public class Client
try
{
- communicator = Ice.Util.initialize(args);
+ Ice.StringSeqHolder argHolder = new Ice.StringSeqHolder(args);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argHolder);
+
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+ initData.properties.setProperty("Ice.UDP.SndSize", "16384");
+
+ communicator = Ice.Util.initialize(argHolder, initData);
status = run(args, communicator);
}
catch(Exception ex)
diff --git a/java/test/Ice/udp/Server.java b/java/test/Ice/udp/Server.java
index 4ea6e29a4b8..bedd63218bb 100644
--- a/java/test/Ice/udp/Server.java
+++ b/java/test/Ice/udp/Server.java
@@ -48,7 +48,13 @@ public class Server
try
{
Ice.StringSeqHolder argHolder = new Ice.StringSeqHolder(args);
- communicator = Ice.Util.initialize(argHolder);
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argHolder);
+
+ initData.properties.setProperty("Ice.Warn.Connections", "0");
+ initData.properties.setProperty("Ice.UDP.RcvSize", "16384");
+
+ communicator = Ice.Util.initialize(argHolder, initData);
status = run(argHolder.value, communicator);
}
catch(Exception ex)
diff --git a/java/test/Ice/udp/Test.ice b/java/test/Ice/udp/Test.ice
index 46adf09ca03..0d4af4d441a 100644
--- a/java/test/Ice/udp/Test.ice
+++ b/java/test/Ice/udp/Test.ice
@@ -18,9 +18,12 @@ interface PingReply
void reply();
};
+sequence<byte> ByteSeq;
+
interface TestIntf
{
void ping(PingReply* reply);
+ void sendByteSeq(ByteSeq seq, PingReply* reply);
void shutdown();
};
diff --git a/java/test/Ice/udp/TestIntfI.java b/java/test/Ice/udp/TestIntfI.java
index 8a3d3887767..585d00be077 100644
--- a/java/test/Ice/udp/TestIntfI.java
+++ b/java/test/Ice/udp/TestIntfI.java
@@ -21,6 +21,18 @@ public final class TestIntfI extends Test._TestIntfDisp
}
}
+ public void sendByteSeq(byte[] seq, Test.PingReplyPrx reply, Ice.Current current)
+ {
+ try
+ {
+ reply.reply();
+ }
+ catch(Ice.LocalException ex)
+ {
+ assert(false);
+ }
+ }
+
public void shutdown(Ice.Current current)
{
current.adapter.getCommunicator().shutdown();