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

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

            pwAuth.SetSession(session);
            pwAuth.SessionNotify(SessionConsts.UP);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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")));
        }
Exemplo n.º 11
0
 public void Constructor6()
 {
     transport.is_server = new Exception("is_server failed");
     PwAuth pwAuth = newPwAuth("tcp://*****:*****@host:9999");
 }