public void executeOperationTest()
        {
            TCPTransport trans = new TCPTransport(System.Net.IPAddress.Loopback, 11222);
            Codec codec = new Codec();
            Serializer s = new DefaultSerializer();

            //byte[] key = UTF8Encoding.UTF8.GetBytes("key11");
            byte[] key = s.serialize("key12");
            byte[] val = s.serialize("ozone");

            PutIFAbsentOperation target = new PutIFAbsentOperation(codec, key, null, 0, null, val, 0, 0);
            Transport transport = trans;
            byte[] expected = null;
            byte[] actual;
            actual = target.executeOperation(transport);
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void executeOperationTest()
        {
            Transport trans = new TCPTransport(System.Net.IPAddress.Loopback, 11222);
            Codec codec = new Codec();
            Serializer s = new DefaultSerializer();
            Serializer s2 = new DefaultSerializer();

            //byte[] key = s.serialize("11");
            byte[] key = s.serialize("key15");
            //byte[] key=UTF8Encoding.UTF8.GetBytes("key10");
            byte[] val = s.serialize("hexachlorocyclohexane777");//UTF8Encoding.UTF8.GetBytes("hexachlorocyclohexane777");
            PutOperation target = new PutOperation(codec, key, null, 0, null, val, 0, 0); // TODO: Initialize to an appropriate value
            Transport transport = trans;

            byte[] expected = null; // TODO: Initialize to an appropriate value
            byte[] actual;
            actual = target.executeOperation(transport);
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void executeOperationTest()
        {
            TCPTransport trans = new TCPTransport(System.Net.IPAddress.Loopback, 11222);
            Codec codec = new Codec();
            Serializer s = new DefaultSerializer();
            byte[] key = s.serialize("key10");
            byte[] value = s.serialize("trinitrotoluene");

            byte[] cacheName = null;
            int topologyId = 0;
            Flag[] flags = null;

            int lifespan = 0;
            int maxIdle = 0;
            ReplaceOperation target = new ReplaceOperation(codec, key, cacheName, topologyId, flags, value, lifespan, maxIdle);
            Transport transport = trans;
            byte[] expected = null;
            byte[] actual;
            actual = target.executeOperation(transport);
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void executeOperationTest()
        {
            TCPTransport trans = new TCPTransport(System.Net.IPAddress.Loopback, 11222);
            Codec codec = new Codec();
            Serializer s = new DefaultSerializer();

            // byte[] key = s.serialize("11");

            byte[] key = s.serialize("key10");
            //byte[] key= UTF8Encoding.UTF8.GetBytes("key10");

            GetOperation target = new GetOperation(codec, key, null, 0, null);
            Transport transport = trans;
            string expected = "hexachlorocyclohexane 777";
            byte[] actual;
            actual = target.executeOperation(transport);
            string res = (string)(s.deserialize(actual));

            Assert.AreEqual(expected, res);
        }