summaryrefslogtreecommitdiff
path: root/java/test/Ice/operations/Twoways.java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /java/test/Ice/operations/Twoways.java
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'java/test/Ice/operations/Twoways.java')
-rw-r--r--java/test/Ice/operations/Twoways.java416
1 files changed, 208 insertions, 208 deletions
diff --git a/java/test/Ice/operations/Twoways.java b/java/test/Ice/operations/Twoways.java
index c8f49ebb81a..328b3ae4013 100644
--- a/java/test/Ice/operations/Twoways.java
+++ b/java/test/Ice/operations/Twoways.java
@@ -403,80 +403,80 @@ class Twoways
test(rso[2].length == 0);
}
- {
- final String[][][] sssi1 =
- {
- {
- {
- "abc", "de"
- },
- {
- "xyz"
- }
- },
- {
- {
- "hello"
- }
- }
- };
-
- final String[][][] sssi2 =
- {
- {
- {
- "", ""
- },
- {
- "abcd"
- }
- },
- {
- {
- ""
- }
- },
- {
- }
- };
-
- Test.StringSSSHolder ssso = new Test.StringSSSHolder();
- String rsso[][][];
-
- rsso = p.opStringSSS(sssi1, sssi2, ssso);
- test(ssso.value.length == 5);
- test(ssso.value[0].length == 2);
- test(ssso.value[0][0].length == 2);
- test(ssso.value[0][1].length == 1);
- test(ssso.value[1].length == 1);
- test(ssso.value[1][0].length == 1);
- test(ssso.value[2].length == 2);
- test(ssso.value[2][0].length == 2);
- test(ssso.value[2][1].length == 1);
- test(ssso.value[3].length == 1);
- test(ssso.value[3][0].length == 1);
- test(ssso.value[4].length == 0);
- test(ssso.value[0][0][0].equals("abc"));
- test(ssso.value[0][0][1].equals("de"));
- test(ssso.value[0][1][0].equals("xyz"));
- test(ssso.value[1][0][0].equals("hello"));
- test(ssso.value[2][0][0].equals(""));
- test(ssso.value[2][0][1].equals(""));
- test(ssso.value[2][1][0].equals("abcd"));
- test(ssso.value[3][0][0].equals(""));
-
- test(rsso.length == 3);
- test(rsso[0].length == 0);
- test(rsso[1].length == 1);
- test(rsso[1][0].length == 1);
- test(rsso[2].length == 2);
- test(rsso[2][0].length == 2);
- test(rsso[2][1].length == 1);
- test(rsso[1][0][0].equals(""));
- test(rsso[2][0][0].equals(""));
- test(rsso[2][0][1].equals(""));
- test(rsso[2][1][0].equals("abcd"));
- }
+ {
+ final String[][][] sssi1 =
+ {
+ {
+ {
+ "abc", "de"
+ },
+ {
+ "xyz"
+ }
+ },
+ {
+ {
+ "hello"
+ }
+ }
+ };
+
+ final String[][][] sssi2 =
+ {
+ {
+ {
+ "", ""
+ },
+ {
+ "abcd"
+ }
+ },
+ {
+ {
+ ""
+ }
+ },
+ {
+ }
+ };
+
+ Test.StringSSSHolder ssso = new Test.StringSSSHolder();
+ String rsso[][][];
+
+ rsso = p.opStringSSS(sssi1, sssi2, ssso);
+ test(ssso.value.length == 5);
+ test(ssso.value[0].length == 2);
+ test(ssso.value[0][0].length == 2);
+ test(ssso.value[0][1].length == 1);
+ test(ssso.value[1].length == 1);
+ test(ssso.value[1][0].length == 1);
+ test(ssso.value[2].length == 2);
+ test(ssso.value[2][0].length == 2);
+ test(ssso.value[2][1].length == 1);
+ test(ssso.value[3].length == 1);
+ test(ssso.value[3][0].length == 1);
+ test(ssso.value[4].length == 0);
+ test(ssso.value[0][0][0].equals("abc"));
+ test(ssso.value[0][0][1].equals("de"));
+ test(ssso.value[0][1][0].equals("xyz"));
+ test(ssso.value[1][0][0].equals("hello"));
+ test(ssso.value[2][0][0].equals(""));
+ test(ssso.value[2][0][1].equals(""));
+ test(ssso.value[2][1][0].equals("abcd"));
+ test(ssso.value[3][0][0].equals(""));
+
+ test(rsso.length == 3);
+ test(rsso[0].length == 0);
+ test(rsso[1].length == 1);
+ test(rsso[1][0].length == 1);
+ test(rsso[2].length == 2);
+ test(rsso[2][0].length == 2);
+ test(rsso[2][1].length == 1);
+ test(rsso[1][0][0].equals(""));
+ test(rsso[2][0][0].equals(""));
+ test(rsso[2][0][1].equals(""));
+ test(rsso[2][1][0].equals("abcd"));
+ }
{
java.util.Map di1 = new java.util.HashMap();
@@ -579,153 +579,153 @@ class Twoways
}
{
- int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
-
- for(int l = 0; l < lengths.length; ++l)
- {
- int[] s = new int[lengths[l]];
- for(int i = 0; i < lengths[l]; ++i)
- {
- s[i] = i;
- }
- int[] r = p.opIntS(s);
- test(r.length == lengths[l]);
- for(int j = 0; j < r.length; ++j)
- {
- test(r[j] == -j);
- }
- }
+ int[] lengths = { 0, 1, 2, 126, 127, 128, 129, 253, 254, 255, 256, 257, 1000 };
+
+ for(int l = 0; l < lengths.length; ++l)
+ {
+ int[] s = new int[lengths[l]];
+ for(int i = 0; i < lengths[l]; ++i)
+ {
+ s[i] = i;
+ }
+ int[] r = p.opIntS(s);
+ test(r.length == lengths[l]);
+ for(int j = 0; j < r.length; ++j)
+ {
+ test(r[j] == -j);
+ }
+ }
}
- {
- java.util.HashMap ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
- {
- test(p.ice_getContext().isEmpty());
- java.util.Map r = p.opContext();
- test(!r.equals(ctx));
- }
- {
- java.util.Map r = p.opContext(ctx);
- test(p.ice_getContext().isEmpty());
- test(r.equals(ctx));
- }
- {
- Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
- test(p2.ice_getContext().equals(ctx));
- java.util.Map r = p2.opContext();
- test(r.equals(ctx));
- r = p2.opContext(ctx);
- test(r.equals(ctx));
- }
- {
- //
- // Test that default context is obtained correctly from communicator.
- //
+ {
+ java.util.HashMap ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+ {
+ test(p.ice_getContext().isEmpty());
+ java.util.Map r = p.opContext();
+ test(!r.equals(ctx));
+ }
+ {
+ java.util.Map r = p.opContext(ctx);
+ test(p.ice_getContext().isEmpty());
+ test(r.equals(ctx));
+ }
+ {
+ Test.MyClassPrx p2 = Test.MyClassPrxHelper.checkedCast(p.ice_context(ctx));
+ test(p2.ice_getContext().equals(ctx));
+ java.util.Map r = p2.opContext();
+ test(r.equals(ctx));
+ r = p2.opContext(ctx);
+ test(r.equals(ctx));
+ }
+ {
+ //
+ // Test that default context is obtained correctly from communicator.
+ //
/* DEPRECATED
- java.util.HashMap dflt = new java.util.HashMap();
- dflt.put("a", "b");
- communicator.setDefaultContext(dflt);
- test(!p.opContext().equals(dflt));
+ java.util.HashMap dflt = new java.util.HashMap();
+ dflt.put("a", "b");
+ communicator.setDefaultContext(dflt);
+ test(!p.opContext().equals(dflt));
- Test.MyClassPrx p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
- test(p2.opContext().isEmpty());
+ Test.MyClassPrx p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_context(new java.util.HashMap()));
+ test(p2.opContext().isEmpty());
- p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
- test(p2.opContext().equals(dflt));
+ p2 = Test.MyClassPrxHelper.uncheckedCast(p.ice_defaultContext());
+ test(p2.opContext().equals(dflt));
- communicator.setDefaultContext(new java.util.HashMap());
- test(!p2.opContext().isEmpty());
+ communicator.setDefaultContext(new java.util.HashMap());
+ test(!p2.opContext().isEmpty());
- communicator.setDefaultContext(dflt);
- Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
- communicator.stringToProxy("test:default -p 12010 -t 10000"));
- test(c.opContext().equals(dflt));
+ communicator.setDefaultContext(dflt);
+ Test.MyClassPrx c = Test.MyClassPrxHelper.checkedCast(
+ communicator.stringToProxy("test:default -p 12010 -t 10000"));
+ test(c.opContext().equals(dflt));
- dflt.put("a", "c");
- Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
- test(c2.opContext().get("a").equals("c"));
+ dflt.put("a", "c");
+ Test.MyClassPrx c2 = Test.MyClassPrxHelper.uncheckedCast(c.ice_context(dflt));
+ test(c2.opContext().get("a").equals("c"));
- dflt.clear();
- Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
- test(c3.opContext().get("a") == null);
+ dflt.clear();
+ Test.MyClassPrx c3 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_context(dflt));
+ test(c3.opContext().get("a") == null);
- Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
- test(c4.opContext().get("a").equals("b"));
+ Test.MyClassPrx c4 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
+ test(c4.opContext().get("a").equals("b"));
- dflt.put("a", "d");
- communicator.setDefaultContext(dflt);
+ dflt.put("a", "d");
+ communicator.setDefaultContext(dflt);
- Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
- test(c5.opContext().get("a").equals("d"));
+ Test.MyClassPrx c5 = Test.MyClassPrxHelper.uncheckedCast(c2.ice_defaultContext());
+ test(c5.opContext().get("a").equals("d"));
- communicator.setDefaultContext(new java.util.HashMap());
+ communicator.setDefaultContext(new java.util.HashMap());
*/
- }
- }
- {
- //
- // Test implicit context propagation
- //
-
- String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
- for(int i = 0; i < 3; i++)
- {
- Ice.InitializationData initData = new Ice.InitializationData();
- initData.properties = communicator.getProperties()._clone();
- initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
-
- Ice.Communicator ic = Ice.Util.initialize(initData);
-
- java.util.Map ctx = new java.util.HashMap();
- ctx.put("one", "ONE");
- ctx.put("two", "TWO");
- ctx.put("three", "THREE");
-
- Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
- ic.stringToProxy("test:default -p 12010 -t 10000"));
-
- ic.getImplicitContext().setContext(ctx);
- test(ic.getImplicitContext().getContext().equals(ctx));
- test(p3.opContext().equals(ctx));
-
- ic.getImplicitContext().set("zero", "ZERO");
- test(ic.getImplicitContext().get("zero").equals("ZERO"));
- test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
-
- ctx = ic.getImplicitContext().getContext();
- test(p3.opContext().equals(ctx));
-
- java.util.Map prxContext = new java.util.HashMap();
- prxContext.put("one", "UN");
- prxContext.put("four", "QUATRE");
-
- java.util.Map combined = new java.util.HashMap(ctx);
- combined.putAll(prxContext);
- test(combined.get("one").equals("UN"));
-
- p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
-
- ic.getImplicitContext().setContext(null);
- test(p3.opContext().equals(prxContext));
-
- ic.getImplicitContext().setContext(ctx);
- test(p3.opContext().equals(combined));
-
- ic.destroy();
- }
- }
-
- {
- double d = 1278312346.0 / 13.0;
- double[] ds = new double[5];
- for(int i = 0; i < 5; i++)
- {
- ds[i] = d;
- }
- p.opDoubleMarshaling(d, ds);
- }
+ }
+ }
+ {
+ //
+ // Test implicit context propagation
+ //
+
+ String[] impls = {"Shared", "SharedWithoutLocking", "PerThread"};
+ for(int i = 0; i < 3; i++)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = communicator.getProperties()._clone();
+ initData.properties.setProperty("Ice.ImplicitContext", impls[i]);
+
+ Ice.Communicator ic = Ice.Util.initialize(initData);
+
+ java.util.Map ctx = new java.util.HashMap();
+ ctx.put("one", "ONE");
+ ctx.put("two", "TWO");
+ ctx.put("three", "THREE");
+
+ Test.MyClassPrx p3 = Test.MyClassPrxHelper.uncheckedCast(
+ ic.stringToProxy("test:default -p 12010 -t 10000"));
+
+ ic.getImplicitContext().setContext(ctx);
+ test(ic.getImplicitContext().getContext().equals(ctx));
+ test(p3.opContext().equals(ctx));
+
+ ic.getImplicitContext().set("zero", "ZERO");
+ test(ic.getImplicitContext().get("zero").equals("ZERO"));
+ test(ic.getImplicitContext().getWithDefault("foobar", "foo").equals("foo"));
+
+ ctx = ic.getImplicitContext().getContext();
+ test(p3.opContext().equals(ctx));
+
+ java.util.Map prxContext = new java.util.HashMap();
+ prxContext.put("one", "UN");
+ prxContext.put("four", "QUATRE");
+
+ java.util.Map combined = new java.util.HashMap(ctx);
+ combined.putAll(prxContext);
+ test(combined.get("one").equals("UN"));
+
+ p3 = Test.MyClassPrxHelper.uncheckedCast(p3.ice_context(prxContext));
+
+ ic.getImplicitContext().setContext(null);
+ test(p3.opContext().equals(prxContext));
+
+ ic.getImplicitContext().setContext(ctx);
+ test(p3.opContext().equals(combined));
+
+ ic.destroy();
+ }
+ }
+
+ {
+ double d = 1278312346.0 / 13.0;
+ double[] ds = new double[5];
+ for(int i = 0; i < 5; i++)
+ {
+ ds[i] = d;
+ }
+ p.opDoubleMarshaling(d, ds);
+ }
}
}