summaryrefslogtreecommitdiff
path: root/java/test/Ice/optional/AllTests.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-11-09 16:22:47 -0800
committerMark Spruiell <mes@zeroc.com>2012-11-09 16:22:47 -0800
commit493caea19fd83663eb03b4eeaf7714f99ac07b97 (patch)
tree39f8b7dc983394288cb25961a0907ebe0b0f5847 /java/test/Ice/optional/AllTests.java
parentICE-4914 - Update Database/Oracle demos (diff)
downloadice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.bz2
ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.tar.xz
ice-493caea19fd83663eb03b4eeaf7714f99ac07b97.zip
ICE-4930 - fixes for scripting languages
Diffstat (limited to 'java/test/Ice/optional/AllTests.java')
-rw-r--r--java/test/Ice/optional/AllTests.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/java/test/Ice/optional/AllTests.java b/java/test/Ice/optional/AllTests.java
index 95e2a815d43..4782a02b03f 100644
--- a/java/test/Ice/optional/AllTests.java
+++ b/java/test/Ice/optional/AllTests.java
@@ -383,6 +383,19 @@ public class AllTests
test(cb.obj != null && cb.obj instanceof TestObjectReader);
factory.setEnabled(false);
+ //
+ // Use the 1.0 encoding with operations whose only class parameters are optional.
+ //
+ Ice.Optional<OneOptional> oo = new Ice.Optional<OneOptional>(new OneOptional(53));
+ initial.sendOptionalClass(true, oo);
+ InitialPrx initial2 = (InitialPrx)initial.ice_encodingVersion(Ice.Util.Encoding_1_0);
+ initial2.sendOptionalClass(true, oo);
+
+ initial.returnOptionalClass(true, oo);
+ test(oo.isSet());
+ initial2.returnOptionalClass(true, oo);
+ test(!oo.isSet());
+
out.println("ok");
out.print("testing marshaling of large containers with fixed size elements... ");
@@ -2068,6 +2081,23 @@ public class AllTests
try
{
+ //
+ // Use the 1.0 encoding with an exception whose only class members are optional.
+ //
+ Ice.IntOptional a = new Ice.IntOptional(30);
+ Ice.Optional<String> b = new Ice.Optional<String>("test");
+ Ice.Optional<OneOptional> o = new Ice.Optional<OneOptional>(new OneOptional(53));
+ initial2.opOptionalException(a, b, o);
+ }
+ catch(OptionalException ex)
+ {
+ test(!ex.hasA());
+ test(!ex.hasB());
+ test(!ex.hasO());
+ }
+
+ try
+ {
Ice.IntOptional a = new Ice.IntOptional();
Ice.Optional<String> b = new Ice.Optional<String>();
Ice.Optional<OneOptional> o = new Ice.Optional<OneOptional>();