本文整理汇总了TypeScript中ice.Ice.MapUtil类的典型用法代码示例。如果您正苦于以下问题:TypeScript Ice.MapUtil类的具体用法?TypeScript Ice.MapUtil怎么用?TypeScript Ice.MapUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ice.MapUtil类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: run
//.........这里部分代码省略.........
test(ssso[0][0][0] === "abc");
test(ssso[0][0][1] === "de");
test(ssso[0][1][0] === "xyz");
test(ssso[1][0][0] === "hello");
test(ssso[2][0][0] === "");
test(ssso[2][0][1] === "");
test(ssso[2][1][0] === "abcd");
test(ssso[3][0][0] === "");
test(retval.length === 3);
test(retval[0].length === 0);
test(retval[1].length === 1);
test(retval[1][0].length === 1);
test(retval[2].length === 2);
test(retval[2][0].length === 2);
test(retval[2][1].length === 1);
test(retval[1][0][0] === "");
test(retval[2][0][0] === "");
test(retval[2][0][1] === "");
test(retval[2][1][0] === "abcd");
}
{
const di1 = new Test.ByteBoolD();
di1.set(10, true);
di1.set(100, false);
const di2 = new Test.ByteBoolD();
di2.set(10, true);
di2.set(11, false);
di2.set(101, true);
const [retval, p3] = await prx.opByteBoolD(di1, di2);
test(Ice.MapUtil.equals(p3, di1));
test(retval.size === 4);
test(retval.get(10) === true);
test(retval.get(11) === false);
test(retval.get(100) === false);
test(retval.get(101) === true);
}
{
const di1 = new Test.ShortIntD();
di1.set(110, -1);
di1.set(1100, 123123);
const di2 = new Test.ShortIntD();
di2.set(110, -1);
di2.set(111, -100);
di2.set(1101, 0);
const [retval, p3] = await prx.opShortIntD(di1, di2);
test(Ice.MapUtil.equals(p3, di1));
test(retval.size === 4);
test(retval.get(110) === -1);
test(retval.get(111) === -100);
test(retval.get(1100) === 123123);
test(retval.get(1101) === 0);
}
{
const di1 = new Test.LongFloatD();
di1.set(new Ice.Long(0, 999999110), -1.1);
di1.set(new Ice.Long(0, 999999111), 123123.2);
const di2 = new Test.LongFloatD();
示例2: allTests
//.........这里部分代码省略.........
test(compObj1.ice_encodingVersion(Ice.Encoding_1_0).equals(compObj1.ice_encodingVersion(Ice.Encoding_1_0)));
test(!compObj1.ice_encodingVersion(Ice.Encoding_1_0).equals(
compObj1.ice_encodingVersion(Ice.Encoding_1_1)));
const baseConnection = await base.ice_getConnection();
if(baseConnection !== null)
{
const baseConnection2 = await base.ice_connectionId("base2").ice_getConnection();
compObj1 = compObj1.ice_fixed(baseConnection);
compObj2 = compObj2.ice_fixed(baseConnection2);
test(!compObj1.equals(compObj2));
}
out.writeLine("ok");
out.write("testing checked cast... ");
const cl = await Test.MyClassPrx.checkedCast(base);
test(cl !== null);
let derived = await Test.MyDerivedClassPrx.checkedCast(cl);
test(derived !== null);
test(cl.equals(base));
test(derived.equals(base));
test(cl.equals(derived));
out.writeLine("ok");
out.write("testing checked cast with context... ");
let c = await cl.getContext();
test(c === null || c.size == 0);
c = new Map();
c.set("one", "hello");
c.set("two", "world");
const clc = await Test.MyClassPrx.checkedCast(base, undefined, c);
const c2 = await clc.getContext();
test(Ice.MapUtil.equals(c, c2));
out.writeLine("ok");
out.write("testing ice_fixed... ");
{
const connection = await cl.ice_getConnection();
if(connection !== null)
{
await cl.ice_fixed(connection).getContext();
test(cl.ice_secure(true).ice_fixed(connection).ice_isSecure());
test(cl.ice_facet("facet").ice_fixed(connection).ice_getFacet() == "facet");
test(cl.ice_oneway().ice_fixed(connection).ice_isOneway());
const ctx = new Map();
ctx.set("one", "hello");
ctx.set("two", "world");
test(cl.ice_fixed(connection).ice_getContext().size == 0);
test(cl.ice_context(ctx).ice_fixed(connection).ice_getContext().size == 2);
test(cl.ice_fixed(connection).ice_getInvocationTimeout() == -1);
test(cl.ice_invocationTimeout(10).ice_fixed(connection).ice_getInvocationTimeout() == 10);
test(await cl.ice_fixed(connection).ice_getConnection() == connection);
test(await cl.ice_fixed(connection).ice_fixed(connection).ice_getConnection() == connection);
test(cl.ice_fixed(connection).ice_getTimeout() === undefined);
const fixedConnection = await cl.ice_connectionId("ice_fixed").ice_getConnection();
test(await cl.ice_fixed(connection).ice_fixed(fixedConnection).ice_getConnection() ==
fixedConnection);
try
{
await cl.ice_secure(!connection.getEndpoint().getInfo().secure()).ice_fixed(connection).ice_ping();
}
catch(ex)
{
test(ex instanceof Ice.NoEndpointException);
}