public void TestUnencryptedSecretDetailedHistoryParams()
		{
			Pubnub pubnub = new Pubnub(
				"demo",
				"demo",
				"secretkey",
				"",
				false);
			
			string channel = "hello_world";
			
			int totalMessages = 10;
			
			Common common = new Common();
			common.DeliveryStatus = false;
			common.Response = null;        
			
			long starttime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(0, totalMessages/2, channel, pubnub);
			
			long midtime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(totalMessages/2, totalMessages, channel, pubnub);
			
			long endtime = common.Timestamp(pubnub);
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams1");
			
			common.DeliveryStatus = false;
			common.Response = null;
			Console.WriteLine("DetailedHistory with start & end");
			
			pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("DetailedHistory with start & reverse = true");
			
			ParseResponse(common.Response, 0, totalMessages/2, "");
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams2");
			
			common.DeliveryStatus = false;
			common.Response = null;
			pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("DetailedHistory with start & reverse = false");
			
			ParseResponse(common.Response, totalMessages/2, totalMessages, "");
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested" ,"TestUnencryptedSecretDetailedHistoryParams3");
			
			common.DeliveryStatus = false;
			common.Response = null;
			pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			
			Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");
			
			ParseResponse(common.Response, 0, totalMessages/2, "");
		}
		public void TestEncryptedDetailedHistory()
		{
			Pubnub pubnub = new Pubnub(
				"demo",
				"demo",
				"",
				"enigma",
				false);
			string channel = "hello_world";
			
			int totalMessages = 10;
			
			Common common = new Common();
			common.DeliveryStatus = false;
			common.Response = null;
			
			long starttime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(0, totalMessages, channel, pubnub);
			
			long midtime = common.Timestamp(pubnub);
			
			SendMultipleIntMessages(totalMessages, totalMessages/2, channel, pubnub);
			
			long endtime = common.Timestamp(pubnub);
			while (!common.DeliveryStatus) ;
			
			pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestEncryptedDetailedHistory");
			
			common.Response = null;
			common.DeliveryStatus = false;
			
			pubnub.DetailedHistory(channel, totalMessages, common.DisplayReturnMessage);
			
			while (!common.DeliveryStatus) ;
			Console.WriteLine("\n*********** DetailedHistory Messages Received*********** ");
			
			ParseResponse(common.Response, 0, totalMessages, "");
		}
Example #3
0
        public void TestUnencryptedDetailedHistoryParamsSSL()
        {
            Pubnub pubnub = new Pubnub(
                Common.PublishKey,
                Common.SubscribeKey,
                "",
                "",
                true);

            string channel = "hello_world_de12";

            int totalMessages = 10;

            Common common = new Common();

            common.DeliveryStatus = false;
            common.Response       = null;

            long starttime = common.Timestamp(pubnub);

            SendMultipleIntMessages(0, totalMessages / 2, channel, pubnub);

            long midtime = common.Timestamp(pubnub);

            SendMultipleIntMessages(totalMessages / 2, totalMessages, channel, pubnub);

            long endtime = common.Timestamp(pubnub);

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedDetailedHistoryParams1");

            common.DeliveryStatus = false;
            common.Response       = null;
            Console.WriteLine("DetailedHistory with start & end");
            //Thread.Sleep (2000);
            pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse();

            Console.WriteLine("DetailedHistory with start & reverse = true");

            ParseResponse(common.Response, 0, totalMessages / 2, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedDetailedHistoryParams2");

            common.DeliveryStatus = false;
            common.Response       = null;
            //Thread.Sleep (2000);
            pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse();

            Console.WriteLine("DetailedHistory with start & reverse = false");

            ParseResponse(common.Response, totalMessages / 2, totalMessages, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedDetailedHistoryParams3");

            common.DeliveryStatus = false;
            common.Response       = null;
            //Thread.Sleep (2000);
            pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse();

            Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");

            ParseResponse(common.Response, 0, totalMessages / 2, "");
            pubnub.EndPendingRequests();
        }
        public void TestEncryptedDetailedHistorySSL ()
        {
            Pubnub pubnub = new Pubnub (
                          Common.PublishKey,
                          Common.SubscribeKey,
                          "",
                          "enigma",
                          true);
            string channel = "hello_world_de15";

            int totalMessages = 10;

            Common common = new Common ();
            common.DeliveryStatus = false;
            common.Response = null;

            long starttime = common.Timestamp (pubnub);

            SendMultipleIntMessages (0, totalMessages, channel, pubnub);

            long midtime = common.Timestamp (pubnub);

            SendMultipleIntMessages (totalMessages, totalMessages / 2, channel, pubnub);

            long endtime = common.Timestamp (pubnub);
            common.WaitForResponse ();

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestEncryptedDetailedHistory");

            common.Response = null;
            common.DeliveryStatus = false;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, totalMessages, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();
            Console.WriteLine ("\n*********** DetailedHistory Messages Received*********** ");

            ParseResponse (common.Response, 0, totalMessages, "");
            pubnub.EndPendingRequests ();
        }
        public void TestUnencryptedSecretDetailedHistoryParams ()
        {
            Pubnub pubnub = new Pubnub (
                          Common.PublishKey,
                          Common.SubscribeKey,
                          Common.SecretKey,
                          "",
                          false);

            string channel = "hello_world_de5";

            int totalMessages = 10;

            Common common = new Common ();
            common.DeliveryStatus = false;
            common.Response = null;        

            long starttime = common.Timestamp (pubnub);

            SendMultipleIntMessages (0, totalMessages / 2, channel, pubnub);

            long midtime = common.Timestamp (pubnub);

            SendMultipleIntMessages (totalMessages / 2, totalMessages, channel, pubnub);

            long endtime = common.Timestamp (pubnub);

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams1");

            common.DeliveryStatus = false;
            common.Response = null;
            Console.WriteLine ("DetailedHistory with start & end");
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("DetailedHistory with start & reverse = true");

            ParseResponse (common.Response, 0, totalMessages / 2, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams2");

            common.DeliveryStatus = false;
            common.Response = null;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("DetailedHistory with start & reverse = false");

            ParseResponse (common.Response, totalMessages / 2, totalMessages, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance ("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams3");

            common.DeliveryStatus = false;
            common.Response = null;
            Thread.Sleep (1000);
            pubnub.DetailedHistory (channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage, common.DisplayReturnMessageDummy);

            common.WaitForResponse ();

            Console.WriteLine ("\n******* DetailedHistory Messages Received ******* ");

            ParseResponse (common.Response, 0, totalMessages / 2, "");
            pubnub.EndPendingRequests ();
        }
Example #6
0
        public void TestUnencryptedSecretDetailedHistoryParams()
        {
            Pubnub pubnub = new Pubnub(
                "demo",
                "demo",
                "secretkey",
                "",
                false);

            string channel = "hello_world";

            int totalMessages = 10;

            Common common = new Common();

            common.DeliveryStatus = false;
            common.Response       = null;

            long starttime = common.Timestamp(pubnub);

            SendMultipleIntMessages(0, totalMessages / 2, channel, pubnub);

            long midtime = common.Timestamp(pubnub);

            SendMultipleIntMessages(totalMessages / 2, totalMessages, channel, pubnub);

            long endtime = common.Timestamp(pubnub);

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams1");

            common.DeliveryStatus = false;
            common.Response       = null;
            Console.WriteLine("DetailedHistory with start & end");

            pubnub.DetailedHistory(channel, starttime, midtime, totalMessages / 2, true, common.DisplayReturnMessage);

            while (!common.DeliveryStatus)
            {
                ;
            }

            Console.WriteLine("DetailedHistory with start & reverse = true");

            ParseResponse(common.Response, 0, totalMessages / 2, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams2");

            common.DeliveryStatus = false;
            common.Response       = null;
            pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, true, common.DisplayReturnMessage);

            while (!common.DeliveryStatus)
            {
                ;
            }

            Console.WriteLine("DetailedHistory with start & reverse = false");

            ParseResponse(common.Response, totalMessages / 2, totalMessages, "");

            pubnub.PubnubUnitTest = common.CreateUnitTestInstance("WhenDetailedHistoryIsRequested", "TestUnencryptedSecretDetailedHistoryParams3");

            common.DeliveryStatus = false;
            common.Response       = null;
            pubnub.DetailedHistory(channel, midtime, -1, totalMessages / 2, false, common.DisplayReturnMessage);

            while (!common.DeliveryStatus)
            {
                ;
            }

            Console.WriteLine("\n******* DetailedHistory Messages Received ******* ");

            ParseResponse(common.Response, 0, totalMessages / 2, "");
        }