• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript ice.Ice.MapUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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();
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:67,代码来源:Twoways.ts


示例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);
                }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:67,代码来源:Client.ts



注:本文中的ice.Ice.MapUtil类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript ice.Ice.Promise类代码示例发布时间:2022-05-25
下一篇:
TypeScript ice.Ice.HashMap类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap