示例#1
0
        /// <exception cref="System.Exception"/>
        public virtual void TestGetUGIFromSubject()
        {
            KerberosPrincipal p       = new KerberosPrincipal("guest");
            Subject           subject = new Subject();

            subject.GetPrincipals().AddItem(p);
            UserGroupInformation ugi = UserGroupInformation.GetUGIFromSubject(subject);

            NUnit.Framework.Assert.IsNotNull(ugi);
            Assert.Equal("*****@*****.**", ugi.GetUserName());
        }