当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Ice.ArrayUtil.equals方法代码示例

本文整理汇总了TypeScript中ice.Ice.ArrayUtil.equals方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Ice.ArrayUtil.equals方法的具体用法?TypeScript Ice.ArrayUtil.equals怎么用?TypeScript Ice.ArrayUtil.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ice.Ice.ArrayUtil的用法示例。


在下文中一共展示了Ice.ArrayUtil.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: allTests

    async allTests()
    {
        const out = this.getWriter();
        const communicator = this.communicator();

        out.write("testing stringToProxy... ");
        const ref = "test:" + this.getTestEndpoint();
        const base = communicator.stringToProxy(ref);
        test(base !== null);
        out.writeLine("ok");

        out.write("testing checked cast... ");
        const obj = await Test.TestIntfPrx.checkedCast(base);
        test(obj !== null);
        test(obj.equals(base));
        out.writeLine("ok");

        {
            out.write("creating/destroying/recreating object adapter... ");
            communicator.getProperties().setProperty("TransientTestAdapter.AdapterId", "dummy");
            let adapter = await communicator.createObjectAdapter("TransientTestAdapter");
            try
            {
                await communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "");
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.AlreadyRegisteredException);
            }
            await adapter.destroy();

            //
            // Use a different port than the first adapter to avoid an "address already in use" error.
            //
            adapter = await communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "");
            await adapter.destroy();
            out.writeLine("ok");
        }

        out.write("creating/activating/deactivating object adapter in one operation... ");
        await obj.transient();
        out.writeLine("ok");

        out.write("testing connection closure... ");
        for(let i = 0; i < 10; ++i)
        {
            const initData = new Ice.InitializationData();
            initData.properties = communicator.getProperties().clone();
            const comm = Ice.initialize(initData);
            comm.stringToProxy("test:" + this.getTestEndpoint()).ice_ping().catch(ex => {});
            await comm.destroy();
        }
        out.writeLine("ok");

        out.write("testing object adapter published endpoints... ");
        {
            communicator.getProperties().setProperty("PAdapter.PublishedEndpoints", "tcp -h localhost -p 12345 -t 30000");
            const adapter = await communicator.createObjectAdapter("PAdapter");
            test(adapter.getPublishedEndpoints().length === 1);
            const endpt = adapter.getPublishedEndpoints()[0];
            test(endpt.toString() == "tcp -h localhost -p 12345 -t 30000");
            const prx =
                    communicator.stringToProxy("dummy:tcp -h localhost -p 12346 -t 20000:tcp -h localhost -p 12347 -t 10000");
            adapter.setPublishedEndpoints(prx.ice_getEndpoints());
            test(adapter.getPublishedEndpoints().length === 2);
            const id = new Ice.Identity("dummy");
            test(Ice.ArrayUtil.equals(adapter.createProxy(id).ice_getEndpoints(), prx.ice_getEndpoints()));
            test(Ice.ArrayUtil.equals(adapter.getPublishedEndpoints(), prx.ice_getEndpoints()));
            await adapter.refreshPublishedEndpoints();
            test(adapter.getPublishedEndpoints().length === 1);
            test(adapter.getPublishedEndpoints()[0].equals(endpt));
            communicator.getProperties().setProperty("PAdapter.PublishedEndpoints", "tcp -h localhost -p 12345 -t 20000");
            await adapter.refreshPublishedEndpoints();
            test(adapter.getPublishedEndpoints().length === 1);
            test(adapter.getPublishedEndpoints()[0].toString() == "tcp -h localhost -p 12345 -t 20000");
            await adapter.destroy();
            test(adapter.getPublishedEndpoints().length === 0);
        }
        out.writeLine("ok");

        test(obj.ice_getConnection() !== null);
        {
            out.write("testing object adapter with bi-dir connection... ");
            const adapter = await communicator.createObjectAdapter("");
            (await obj.ice_getConnection()).setAdapter(adapter);
            (await obj.ice_getConnection()).setAdapter(null);
            await adapter.deactivate();
            try
            {
                (await obj.ice_getConnection()).setAdapter(adapter);
                test(false);
            }
            catch(ex)
            {
                test(ex instanceof Ice.ObjectAdapterDeactivatedException);
            }
            out.writeLine("ok");
        }

//.........这里部分代码省略.........
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:101,代码来源:Client.ts

示例2: run


//.........这里部分代码省略.........
            Test.su0 == Test.su2 &&
            Test.su0 == literals[28] &&
            Test.su0 == literals[29] &&
            Test.su0 == literals[30]);

    await prx.ice_ping();

    test(await prx.ice_isA(Test.MyClass.ice_staticId()));

    test((await prx.ice_id()) === Test.MyDerivedClass.ice_staticId());

    test((await prx.ice_ids()).length === 3);

    await prx.opVoid();

    {
        const [retval, p3] = await prx.opByte(0xff, 0x0f);
        test(p3 === 0xf0);
        test(retval === 0xff);
    }

    {
        const [retval, p3] = await prx.opBool(true, false);
        test(p3);
        test(!retval);
    }

    {
        const lo = new Ice.Long(0, 12);
        const [retval, s, i, l] = await prx.opShortIntLong(10, 11, lo);

        test(s === 10);
        test(i === 11);
        test(l.equals(lo));
        test(retval.equals(lo));
    }

    {
        const [retval, f, d] = await prx.opFloatDouble(3.14, 1.1E10);
        test((f - 3.14) <= 0.01);
        test(d == 1.1E10);
        test(retval == 1.1E10);
    }

    try
    {
        await prx.opByte(0xffff, 0xff0f);
        test(false);
    }
    catch(ex)
    {
        test(ex instanceof Ice.MarshalException, ex);
    }

    try
    {
        await prx.opShortIntLong(-32768 - 1, 0, new Ice.Long(0));
        test(false);
    }
    catch(ex)
    {
        test(ex instanceof Ice.MarshalException, ex);
    }

    try
    {
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:67,代码来源:Twoways.ts


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