Example #1
0
        public void GetRepositoryIdTest()
        {
            Type   type     = typeof(IComponent);
            string expected = "IDL:scs/core/IComponent:1.0";
            string actual   = IiopNetUtil.GetRepositoryId(type);

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        /// <summary>
        /// Adiciona as facetas básicas à lista de Facetas criadas pelo usuário.
        /// </summary>
        private void AddBasicFacets()
        {
            Type   icomponentType          = typeof(IComponent);
            string icomponentName          = icomponentType.Name;
            string icomponentInterfaceName = IiopNetUtil.GetRepositoryId(icomponentType);

            if (!facets.ContainsKey(icomponentName))
            {
                IComponent         icomponent        = new IComponentServant(this);
                MarshalByRefObject icomponentServant = icomponent as MarshalByRefObject;
                AddFacet(icomponentName, icomponentInterfaceName, icomponentServant);
                logger.DebugFormat("Faceta '{0}' adicionada com sucesso", icomponentName);
            }

            Type   ireceptacleType          = typeof(IReceptacles);
            string ireceptacleName          = ireceptacleType.Name;
            string ireceptacleInterfaceName = IiopNetUtil.GetRepositoryId(ireceptacleType);

            if (!facets.ContainsKey(ireceptacleName))
            {
                IReceptacles       receptacle        = new IReceptaclesServant(this);
                MarshalByRefObject receptacleServant = receptacle as MarshalByRefObject;
                AddFacet(ireceptacleName, ireceptacleInterfaceName, receptacleServant);
                logger.DebugFormat("Faceta '{0}' adicionada com sucesso", ireceptacleName);
            }

            Type   imetaInterfaceType          = typeof(IMetaInterface);
            string imetaInterfaceName          = imetaInterfaceType.Name;
            string imetaInterfaceInterfaceName = IiopNetUtil.GetRepositoryId(imetaInterfaceType);

            if (!facets.ContainsKey(imetaInterfaceName))
            {
                IMetaInterface     metaInterface        = new IMetaInterfaceServant(this);
                MarshalByRefObject metaInterfaceServant = metaInterface as MarshalByRefObject;
                AddFacet(imetaInterfaceName, imetaInterfaceInterfaceName, metaInterfaceServant);
                logger.DebugFormat("Faceta '{0}' adicionada com sucesso", imetaInterfaceName);
            }
        }