public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            string[] multiChannel = { "testChannel" };

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            CurrentRequestType crt              = CurrentRequestType.PresenceHeartbeat;
            string             expectedMessage  = "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}";
            string             expectedChannels = string.Join(",", multiChannel);
            string             url              = string.Format("http://ps.pndsn.com/v2/presence/sub_key/{0}/channel/{1}/heartbeat?uuid={2}&heartbeat=62&pnsdk={3}", CommonIntergrationTests.SubscribeKey,
                                                                expectedChannels, pubnub.SessionUUID, pubnub.Version
                                                                );
            ResponseType respType = ResponseType.PresenceHeartbeat;

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #2
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            System.Random r       = new System.Random();
            string        channel = "UnityIntegrationTestsTimeout_" + r.Next(100);

            string[] multiChannel = new string[1];
            multiChannel [0] = channel;

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            CurrentRequestType crt              = CurrentRequestType.NonSubscribe;
            string             expectedMessage  = "Aborted";
            string             expectedChannels = string.Join(",", multiChannel);
            long nanoSecondTime = Pubnub.TranslateDateTimeToPubnubUnixNanoSeconds(DateTime.UtcNow);

            //Send a sub request (intentional) that waits for response
            string url = string.Format("http://ps.pndsn.com/subscribe/{0}/{1}/0/{2}?uuid={3}&pnsdk={4}", CommonIntergrationTests.SubscribeKey,
                                       expectedChannels, nanoSecondTime, pubnub.SessionUUID, pubnub.Version
                                       );
            ResponseType respType = ResponseType.HereNow;

            common.TestCoroutineBounce(url, 5, 0, multiChannel, false,
                                       false, this.name, expectedMessage, expectedChannels, true, false, false, 0, crt, respType);

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #3
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            string[] multiChannel = { "testChannel" };
            //
            CurrentRequestType crt              = CurrentRequestType.NonSubscribe;
            string             expectedMessage  = "[[]";
            string             expectedChannels = string.Join(",", multiChannel);
            ResponseType       respType         = ResponseType.Time;

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            long nanoSecondTime = 0;//Pubnub.TranslateDateTimeToPubnubUnixNanoSeconds (DateTime.UtcNow);

            string url = string.Format("http://pubsub.pubnub.com/subscribe/{0}/{1}/0/{2}?uuid={3}&pnsdk={4}", CommonIntergrationTests.SubscribeKey,
                                       expectedChannels, nanoSecondTime, pubnub.SessionUUID, pubnub.Version
                                       );

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #4
0
 public IEnumerator Start()
 {
     CommonIntergrationTests common = new CommonIntergrationTests ();
     yield return StartCoroutine(common.DoConnectedTest(SslOn, this.name, AsObject, IsPresence));
     UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
     yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
 }
Example #5
0
 public IEnumerator Start()
 {
     CommonIntergrationTests common = new CommonIntergrationTests ();
     yield return StartCoroutine (common.DoSubscribeThenDoGlobalHereNowAndParse (SslOn, this.name, !AsObject));
     UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
     yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
 }
 public IEnumerator Start()
 {
     CommonIntergrationTests common = new CommonIntergrationTests ();
     yield return StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, "[1.2]", true));
     UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
     yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
 }
Example #7
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests ();

            yield return StartCoroutine(common.DoPublishAndParse(SslOn, this.name, "Pubnub API Usage Example", "Sent", AsObject, WithCipher));
            UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
            yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
        }
Example #8
0
 public IEnumerator Start()
 {
     CommonIntergrationTests common = new CommonIntergrationTests ();
     //we are converting long to string due to JSON issue
     yield return StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, "14255515120803306", true));
     UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
     yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
 }
 public IEnumerator Start()
 {
     CommonIntergrationTests common = new CommonIntergrationTests ();
     string TestName = "TestSecretKeyOptional";
     yield return StartCoroutine(common.DoPublishAndParse(true, TestName, "Simple message test", "Sent", false, true, true));
     UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", TestName));
     yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
 }
Example #10
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests ();
            object[] message = {"Test Detailed History"};

            yield return StartCoroutine(common.DoPublishThenDetailedHistoryAndParse(SslOn, this.name, message, AsObject, CipherOn, NoStore, message.Length, false));
            UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", this.name));
            yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
        }
Example #11
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            yield return(StartCoroutine(common.DoSubscribeThenHereNowAndParse(SslOn, this.name, !AsObject, WithState, CustomUUID)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #12
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            yield return(StartCoroutine(common.DoNotSubscribedTest(SslOn, this.name, AsObject, IsPresence)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            yield return(StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, "[\"14255515120803306\"]", true)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests ();
            string testName = "TestSetAndDeleteGlobalState";

            yield return StartCoroutine(common.SetAndDeleteStateAndParse(false, testName));
            UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", testName));
            yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
        }
Example #15
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            yield return(StartCoroutine(common.DoPublishAndParse(SslOn, this.name, "Pubnub API Usage Example", "Sent", AsObject, WithCipher)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #16
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string TestName = "TestSecretKeyOptional";

            yield return(StartCoroutine(common.DoPublishAndParse(true, TestName, "Simple message test", "Sent", false, true, true)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", TestName));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string testName = "TestSetAndGetGlobalStateUUID";

            yield return(StartCoroutine(common.SetAndGetStateAndParseUUID(false, testName)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", testName));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();

            object[] message = { "Test Detailed History" };

            yield return(StartCoroutine(common.DoPublishThenDetailedHistoryAndParse(SslOn, this.name, message, AsObject, CipherOn, NoStore, message.Length, false)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
 public IEnumerator Start()
 {
     if (CommonIntergrationTests.TestingUsingMiniJSON) {
         UnityEngine.Debug.Log (string.Format ("{0}: Ignored for MiniJSON", this.name));
         IntegrationTest.Pass ();
     } else {
         object Message = new PubnubDemoObject ();
         CommonIntergrationTests common = new CommonIntergrationTests ();
         yield return StartCoroutine (common.DoSubscribeThenPublishAndParse (SslOn, this.name, AsObject, CipherOn, Message, "\"VersionID\":3.4", true));
         UnityEngine.Debug.Log (string.Format ("{0}: After StartCoroutine", this.name));
         yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
     }
 }
        public IEnumerator Start()
        {
                        #if !PUBNUB_PS_V2_RESPONSE
            CommonIntergrationTests common = new CommonIntergrationTests();
            yield return(StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, "1", false)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
                        #else
            yield return(null);

            UnityEngine.Debug.Log(string.Format("{0}: Ignoring test", this.name));
            IntegrationTest.Pass();
                        #endif
        }
Example #21
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string TestName = "TestPublishKeyPresent";
            Pubnub pubnub   = new Pubnub(
                "",
                "demo",
                "",
                "",
                false
                );

            pubnub.Publish <object> ("testchannel", "testmessage", common.DisplayReturnMessage, common.DisplayReturnMessage);
            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", TestName));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #22
0
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests ();
            string TestName = "TestPublishKeyPresent";
            Pubnub pubnub = new Pubnub (
                "",
                "demo",
                "",
                "",
                false
            );

            pubnub.Publish<object> ("testchannel", "testmessage", common.DisplayReturnMessage, common.DisplayReturnMessage);
            UnityEngine.Debug.Log (string.Format("{0}: After StartCoroutine", TestName));
            yield return new WaitForSeconds (CommonIntergrationTests.WaitTimeBetweenCalls);
        }
        public IEnumerator Start()
        {
            #if (REDUCE_PUBNUB_COROUTINES)
            CommonIntergrationTests common = new CommonIntergrationTests();
            System.Random           r      = new System.Random();
            string channel  = "UnityIntegrationTestsTimeout_" + r.Next(100);
            string channel2 = "UnityIntegrationTestsTimeout_" + r.Next(100);

            string[] multiChannel = new string[2];
            multiChannel [0] = channel;

            Pubnub pubnub = new Pubnub(
                CommonIntergrationTests.PublishKey,
                CommonIntergrationTests.SubscribeKey,
                "",
                "",
                true
                );

            CurrentRequestType crt              = CurrentRequestType.Subscribe;
            string             expectedMessage  = "Aborted";
            string             expectedChannels = string.Join(",", multiChannel);
            long nanoSecondTime = Pubnub.TranslateDateTimeToPubnubUnixNanoSeconds(DateTime.UtcNow);

            string url = string.Format("http://pubsub.pubnub.com/v2/subscribe/{0}/{1}/0/{2}?uuid={3}&tt={2}&pnsdk={4}", CommonIntergrationTests.SubscribeKey,
                                       expectedChannels, nanoSecondTime, pubnub.SessionUUID, pubnub.Version
                                       );
            multiChannel [1] = channel2;
            expectedChannels = string.Join(",", multiChannel);
            string url2 = string.Format("http://pubsub.pubnub.com/v2/subscribe/{0}/{1}/0?uuid={3}&tt={2}&pnsdk={4}", CommonIntergrationTests.SubscribeKey,
                                        expectedChannels, nanoSecondTime, pubnub.SessionUUID, pubnub.Version
                                        );
            ResponseType respType = ResponseType.SubscribeV2;

            IEnumerator ienum = common.TestCoroutineRunSubscribeMultiple(url, url2, 20, -1, multiChannel, false,
                                                                         false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);
            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
            #else
            yield return(null);

            UnityEngine.Debug.Log(string.Format("{0}: Ignoring test", this.name));
            IntegrationTest.Pass();
            #endif
        }
        public IEnumerator Start()
        {
            if (CommonIntergrationTests.TestingUsingMiniJSON)
            {
                UnityEngine.Debug.Log(string.Format("{0}: Ignored for MiniJSON", this.name));
                IntegrationTest.Pass();
            }
            else
            {
                object Message = new PubnubDemoObject();
                CommonIntergrationTests common = new CommonIntergrationTests();
                yield return(StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, "\"VersionID\":3.4", true)));

                UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
                yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
            }
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string url = "https://pubsub.pubnub.com/time/0";

            string[] multiChannel = { "testChannel" };
            //
            CurrentRequestType crt              = CurrentRequestType.NonSubscribe;
            string             expectedMessage  = "[14";
            string             expectedChannels = string.Join(",", multiChannel);
            ResponseType       respType         = ResponseType.Time;

            IEnumerator ienum = common.TestCoroutineRunProcessResponse(url, 20, -1, multiChannel, false,
                                                                       false, this.name, expectedMessage, expectedChannels, false, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
Example #26
0
        public IEnumerator Start()
        {
            #if !PUBNUB_PS_V2_RESPONSE
            Dictionary <string, long>   Message1 = new Dictionary <string, long>();
            Dictionary <string, string> Message2 = new Dictionary <string, string>();
            object Message = null;
            if (BothString)
            {
                Message2.Add("cat", "test");
                Message = Message2;
            }
            else
            {
                Message1.Add("cat", 14255515120803306);
                Message = Message1;
            }

            string expectedMessage = "\"cat\":\"14255515120803306\"";
            if (BothString)
            {
                expectedMessage = "\"cat\":\"test\"";
            }
            else
            {
                if (CommonIntergrationTests.TestingUsingMiniJSON)
                {
                    expectedMessage = "\"cat\":14255515120803306";
                }
            }
            CommonIntergrationTests common = new CommonIntergrationTests();
            yield return(StartCoroutine(common.DoSubscribeThenPublishAndParse(SslOn, this.name, AsObject, CipherOn, Message, expectedMessage, true)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
            #else
            yield return(null);

            UnityEngine.Debug.Log(string.Format("{0}: Ignoring test", this.name));
            IntegrationTest.Pass();
            #endif
        }
        public IEnumerator Start()
        {
            CommonIntergrationTests common = new CommonIntergrationTests();
            string url = "http://pubsub.pubnub.com";

            string[] multiChannel = { "testChannel" };

            //Inducing Error by setting wrong request type
            CurrentRequestType crt              = CurrentRequestType.Heartbeat;
            string             expectedMessage  = "404 Nothing";
            string             expectedChannels = string.Join(",", multiChannel);
            ResponseType       respType         = ResponseType.Heartbeat;

            IEnumerator ienum = common.TestCoroutineRunError(url, 20, -1, multiChannel, false,
                                                             false, this.name, expectedMessage, expectedChannels, true, false, false, 0, crt, respType);

            yield return(StartCoroutine(ienum));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }
        public IEnumerator Start()
        {
            Dictionary <string, long>   Message1 = new Dictionary <string, long>();
            Dictionary <string, string> Message2 = new Dictionary <string, string>();
            object Message = null;

            if (BothString)
            {
                Message2.Add("cat", "test");
                Message = Message2;
            }
            else
            {
                Message1.Add("cat", 14255515120803306);
                Message = Message1;
            }

            string expectedMessage = "\"cat\":\"14255515120803306\"";

            if (BothString)
            {
                expectedMessage = "\"cat\":\"test\"";
            }
            else
            {
                if (CommonIntergrationTests.TestingUsingMiniJSON)
                {
                    expectedMessage = "\"cat\":14255515120803306";
                }
            }
            CommonIntergrationTests common = new CommonIntergrationTests();

            yield return(StartCoroutine(common.DoCGAddListRemoveSubscribeStateHereNowUnsub(SslOn, this.name, AsObject, CipherOn, Message, expectedMessage, true)));

            UnityEngine.Debug.Log(string.Format("{0}: After StartCoroutine", this.name));
            yield return(new WaitForSeconds(CommonIntergrationTests.WaitTimeBetweenCalls));
        }