示例#1
0
        public void Clientup5()
        {
            transport.is_server = false;
            session.password    = "******";
            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);
        }
示例#2
0
        public void Clientup4()
        {
            transport.is_server = false;
            session.user        = "******";
            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);
        }
示例#3
0
        public void Clientup6()
        {
            transport.is_server = false;
            session.user        = "******";
            session.password    = new Exception("password failed");
            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);
        }
示例#4
0
        public void Serverup1()
        {
            transport.is_server = true;

            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);

            Assert.IsTrue(session.up);
        }
示例#5
0
        public void Clientdown1()
        {
            transport.is_server = false;

            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.DOWN);

            Assert.IsFalse(session.up);
        }
示例#6
0
        public void Constructor4()
        {
            transport.is_server = false;
            PwAuth pwAuth = newPwAuth("tcp://alice@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(false, pwAuth.GetServer());
            Assert.AreEqual("alice", pwAuth.TransportQuery(PwAuth.USER));
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.PASSWORD));
        }
示例#7
0
        public void Constructor3()
        {
            transport.is_server = false;
            PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(false, pwAuth.GetServer());
            Assert.AreEqual("mary", pwAuth.TransportQuery(PwAuth.USER));
            Assert.AreEqual("2345", pwAuth.TransportQuery(PwAuth.PASSWORD));
        }
示例#8
0
        public void Constructor1()
        {
            transport.is_server = true;
            PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");

            pwAuth.SetSession(session);
            Assert.AreSame(pwAuth, transport.GetSession());
            Assert.AreSame(session, pwAuth.GetSession());
            Assert.AreEqual(true, pwAuth.GetServer());
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.USER));
            Assert.IsNull(pwAuth.TransportQuery(PwAuth.PASSWORD));
        }
示例#9
0
        public void Serverdown1()
        {
            transport.is_server = true;

            PwAuth pwAuth = newPwAuth("tcp://host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.DOWN);

            Assert.IsFalse(session.up);
            Assert.IsNull(session.userPassword.user);
            Assert.IsNull(session.userPassword.password);
        }
示例#10
0
        public void Clientup1()
        {
            transport.is_server = false;
            PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);
            Assert.IsTrue(session.up);
            Assert.AreEqual(What.TRANSPORT_MESSAGE, transport.what);
            Message msg1 = transport.msg;

            Assert.AreEqual("_Etch_PwAuthReq", msg1.GetXType.Name);
            Assert.AreEqual("fred", msg1.Get(new Field("user")));
            Assert.AreEqual("1234", msg1.Get(new Field("password")));
        }
示例#11
0
 public void Constructor6()
 {
     transport.is_server = new Exception("is_server failed");
     PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");
 }