當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ice.Ice.MapUtil類代碼示例

本文整理匯總了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;未經允許,請勿轉載。