コード例 #1
0
        public void BonCodeAJP13ServerConnectionConstructorTest5()
        {
            BonCodeAJP13Packet           singlePacket = null; // TODO: Initialize to an appropriate value
            BonCodeAJP13ServerConnection target       = new BonCodeAJP13ServerConnection(singlePacket);

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
コード例 #2
0
        internal virtual BonCodeAJP13Packet CreateBonCodeAJP13Packet()
        {
            // TODO: Instantiate an appropriate concrete class.
            BonCodeAJP13Packet target = null;

            return(target);
        }
コード例 #3
0
        public void RemoveTest()
        {
            BonCodeAJP13PacketCollection target = new BonCodeAJP13PacketCollection(); // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet           value  = null;                               // TODO: Initialize to an appropriate value

            target.Remove(value);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
コード例 #4
0
        public void AddPacketToSendQueueTest()
        {
            BonCodeAJP13ServerConnection target       = new BonCodeAJP13ServerConnection(); // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet           singlePacket = null;                               // TODO: Initialize to an appropriate value

            target.AddPacketToSendQueue(singlePacket);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
コード例 #5
0
        public void UserDataLengthTest()
        {
            BonCodeAJP13Packet target = CreateBonCodeAJP13Packet(); // TODO: Initialize to an appropriate value
            ushort             actual;

            actual = target.UserDataLength;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #6
0
        public void PacketTypeTest()
        {
            BonCodeAJP13Packet target = CreateBonCodeAJP13Packet(); // TODO: Initialize to an appropriate value
            byte actual;

            actual = target.PacketType;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #7
0
        public void BonCodeAJP13ServerConnectionConstructorTest()
        {
            string                       server       = string.Empty; // TODO: Initialize to an appropriate value
            int                          port         = 0;            // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet           singlePacket = null;         // TODO: Initialize to an appropriate value
            BonCodeAJP13ServerConnection target       = new BonCodeAJP13ServerConnection(server, port, singlePacket);

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
コード例 #8
0
        public void PrintPacketHeaderTest()
        {
            BonCodeAJP13Packet target   = CreateBonCodeAJP13Packet(); // TODO: Initialize to an appropriate value
            string             expected = string.Empty;               // TODO: Initialize to an appropriate value
            string             actual;

            actual = target.PrintPacketHeader();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #9
0
        public void GetUserDataBytesTest()
        {
            BonCodeAJP13Packet target = CreateBonCodeAJP13Packet(); // TODO: Initialize to an appropriate value

            byte[] expected = null;                                 // TODO: Initialize to an appropriate value
            byte[] actual;
            actual = target.GetUserDataBytes();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #10
0
        public void GetPacketTest()
        {
            byte[]             Buffer   = null; // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet expected = null; // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet actual;

            actual = BonCodeAJP13Packet.GetPacket(Buffer);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #11
0
        public void ContainsTest()
        {
            BonCodeAJP13PacketCollection target = new BonCodeAJP13PacketCollection(); // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet           value  = null;                               // TODO: Initialize to an appropriate value
            bool expected = false;                                                    // TODO: Initialize to an appropriate value
            bool actual;

            actual = target.Contains(value);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #12
0
        public void ItemTest()
        {
            BonCodeAJP13PacketCollection target = new BonCodeAJP13PacketCollection(); // TODO: Initialize to an appropriate value
            int index = 0;                                                            // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet expected = null;                                       // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet actual;

            target[index] = expected;
            actual        = target[index];
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #13
0
        public void LogPacketTest()
        {
            string             fileName    = string.Empty;                                  // TODO: Initialize to an appropriate value
            Mutex              loggerMutex = null;                                          // TODO: Initialize to an appropriate value
            BonCodeAJP13Logger target      = new BonCodeAJP13Logger(fileName, loggerMutex); // TODO: Initialize to an appropriate value
            BonCodeAJP13Packet packet      = null;                                          // TODO: Initialize to an appropriate value
            bool logAllways        = false;                                                 // TODO: Initialize to an appropriate value
            int  onlyAboveLogLevel = 0;                                                     // TODO: Initialize to an appropriate value

            target.LogPacket(packet, logAllways, onlyAboveLogLevel);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
コード例 #14
0
        static void Main(string[] args)
        {
            //KeyTest();
            //sample setting
            //Console.WriteLine("Sample Setting " + Properties.Settings.Default.SampleSetting);

            //read parameters from console first parameter is server second port
            if (args.Length >= 1)
            {
                myURL = (string)args[0];
            }
            if (args.Length >= 2)
            {
                myServer = (string)args[1];
            }
            if (args.Length >= 3)
            {
                myPort = (string)args[2];
            }

            string myDNS = myServer; // +":" + myPort;
            ushort iPort = Convert.ToUInt16(myPort);

            //test search
            byte[] sourceBytes = new byte[20] {
                0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A
            };
            byte[] searchBytes = new byte[2] {
                0x02, 0x04
            };

            int foundPos = ByteSearch(sourceBytes, searchBytes, 0);

            Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache));
            Console.WriteLine(BonCodeAJP13Settings.BONCODEAJP13_LOG_DIR);

            ConnectViaString(myDNS, myData);



            //test config
            //Test myTest = new Test();
            //myTest.fHeaderTest();

            //log level
            //Console.WriteLine("Log Level " + BonCodeAJP13Settings.BONCODEAJP13_LOG_LEVEL);


            //create intance of forward request
            BonCodeAJP13ForwardRequest FR = new BonCodeAJP13ForwardRequest(BonCodeAJP13HTTPMethods.BONCODEAJP13_GET,
                                                                           "HTTP/1.1",
                                                                           myURL,
                                                                           "::1",
                                                                           "::1", myServer, iPort, false, 1);

            //create cping request
            BonCodeAJP13ForwardRequest FR2 = new BonCodeAJP13ForwardRequest(BonCodeAJP13HTTPMethods.BONCODEAJP13_GET,
                                                                            "HTTP/1.1",
                                                                            myURL,
                                                                            "::1",
                                                                            "::1", myServer, iPort, false, 1);

            byte[] testBytes = FR.GetDataBytes();  //this returns the contructed databytes

            //byte[] testBytes = FR.WriteServerTestPacket();



            Console.WriteLine("Server: {0} , Port: {1}, URL: {2}", myServer, myPort, myURL);

            //call server request
            BonCodeAJP13ServerConnection sconn = new BonCodeAJP13ServerConnection(FR, true);

            sconn.Server = myServer;
            sconn.Port   = System.Convert.ToInt32(myPort);
            sconn.FlushDelegateFunction = PrintFlush;  //this function will do the printing to console



            //run connection
            sconn.BeginConnection();



            //write the response to screen that has not been flushed yet
            foreach (Object oIterate in sconn.ReceivedDataCollection)
            {
                BonCodeAJP13Packet Packet = oIterate as BonCodeAJP13Packet; //only objects derived from this class should be in the collection
                Console.WriteLine(Packet.GetDataString());
            }
            Console.WriteLine("Last Size:" + sconn.ReceivedDataCollection.Count);

            //call connect function
            //ConnectViaString(myDNS, myData);
            //Connect(myDNS, testBytes);

            int a = 2;

            a++;
        }