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


TypeScript Ice.identityToString方法代码示例

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


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

示例1: allTests


//.........这里部分代码省略.........
        test(b1.ice_getEncodingVersion().major === 6 && b1.ice_getEncodingVersion().minor === 5);

        b1 = communicator.stringToProxy("test -p 1.0 -e 1.0");
        test(b1.toString() === "test -t -e 1.0");

        b1 = communicator.stringToProxy("test -p 6.5 -e 1.0");
        test(b1.toString() === "test -t -p 6.5 -e 1.0");

        try
        {
            b1 = communicator.stringToProxy("test:" + defaultProtocol + "@adapterId");
            test(false);
        }
        catch(ex)
        {
            test(ex instanceof Ice.EndpointParseException, ex);
        }

        try
        {
            b1 = communicator.stringToProxy("test::" + defaultProtocol);
            test(false);
        }
        catch(ex)
        {
            test(ex instanceof Ice.EndpointParseException, ex);
        }

        //
        // Test for bug ICE-5543: escaped escapes in stringToIdentity
        //

        let id = new Ice.Identity("test", ",X2QNUAzSBcJ_e$AV;E\\");
        let id2 = Ice.stringToIdentity(Ice.identityToString(id));
        test(id.equals(id2));

        id = new Ice.Identity("test", ",X2QNUAz\\SB\\/cJ_e$AV;E\\\\");
        id2 = Ice.stringToIdentity(Ice.identityToString(id));
        test(id.equals(id2));

        id = new Ice.Identity("/test", "cat/");
        let idStr = Ice.identityToString(id);
        test(idStr === "cat\\//\\/test");
        id2 = Ice.stringToIdentity(idStr);
        test(id.equals(id2));

        // Input string with various pitfalls
        // id = Ice.stringToIdentity("\\342\\x82\\254\\60\\x9\\60\\");
        // test(id.name === "€0\t0\\" && id.category.isEmpty());

        try
        {
            // Illegal character < 32
            id = Ice.stringToIdentity("xx\x01FooBar");
            test(false);
        }
        catch(ex)
        {
            test(ex instanceof Ice.IdentityParseException);
        }

        try
        {
            // Illegal surrogate
            id = Ice.stringToIdentity("xx\\ud911");
            test(false);
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:67,代码来源:Client.ts


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