Ejemplo n.º 1
0
        private void TestOptions()
        {
            AdjustTestOptions testOptions = new AdjustTestOptions();

            testOptions.BaseUrl = MainPage.BaseUrl;
            testOptions.GdprUrl = MainPage.GdprUrl;
            if (Command.ContainsParameter("basePath"))
            {
                BasePath = Command.GetFirstParameterValue("basePath");
                GdprPath = Command.GetFirstParameterValue("basePath");
            }

            if (Command.ContainsParameter("timerInterval"))
            {
                long timerInterval = long.Parse(Command.GetFirstParameterValue("timerInterval"));
                testOptions.TimerIntervalInMilliseconds = timerInterval;
            }

            if (Command.ContainsParameter("timerStart"))
            {
                long timerStart = long.Parse(Command.GetFirstParameterValue("timerStart"));
                testOptions.TimerStartInMilliseconds = timerStart;
            }

            if (Command.ContainsParameter("sessionInterval"))
            {
                long sessionInterval = long.Parse(Command.GetFirstParameterValue("sessionInterval"));
                testOptions.SessionIntervalInMilliseconds = sessionInterval;
            }

            if (Command.ContainsParameter("subsessionInterval"))
            {
                long subsessionInterval = long.Parse(Command.GetFirstParameterValue("subsessionInterval"));
                testOptions.SubsessionIntervalInMilliseconds = subsessionInterval;
            }

            if (Command.ContainsParameter("noBackoffWait"))
            {
                if (Command.GetFirstParameterValue("noBackoffWait") == "true")
                {
                    testOptions.NoBackoffWait = true;
                }
            }

            if (Command.ContainsParameter("teardown"))
            {
                List <string> teardownOptions = Command.Parameters["teardown"];
                foreach (string teardownOption in teardownOptions)
                {
                    if (teardownOption == "resetSdk")
                    {
                        testOptions.Teardown = true;
                        testOptions.BasePath = BasePath;
                        testOptions.GdprPath = GdprPath;
                    }
                    if (teardownOption == "deleteState")
                    {
                        testOptions.DeleteState = true;
                    }
                    if (teardownOption == "resetTest")
                    {
                        _savedEvents  = new Dictionary <int, AdjustEvent>();
                        _savedConfigs = new Dictionary <int, AdjustConfig>();
                        testOptions.TimerIntervalInMilliseconds      = -1;
                        testOptions.TimerStartInMilliseconds         = -1;
                        testOptions.SessionIntervalInMilliseconds    = -1;
                        testOptions.SubsessionIntervalInMilliseconds = -1;
                    }
                    if (teardownOption == "sdk")
                    {
                        testOptions.Teardown = true;
                        testOptions.BasePath = null;
                        testOptions.GdprPath = null;
                    }
                    if (teardownOption == "test")
                    {
                        _savedEvents  = null;
                        _savedConfigs = null;
                        testOptions.TimerIntervalInMilliseconds      = -1;
                        testOptions.TimerStartInMilliseconds         = -1;
                        testOptions.SessionIntervalInMilliseconds    = -1;
                        testOptions.SubsessionIntervalInMilliseconds = -1;
                    }
                }
            }

#if DEBUG
            Adjust.SetTestOptions(testOptions);
#endif
        }
Ejemplo n.º 2
0
        private void TestOptions()
        {
            Dictionary <string, string> testOptions = new Dictionary <string, string>();

            testOptions[AdjustUtils.KeyTestOptionsBaseUrl]         = _baseUrl;
            testOptions[AdjustUtils.KeyTestOptionsGdprUrl]         = _gdprUrl;
            testOptions[AdjustUtils.KeyTestOptionsSubscriptionUrl] = _subscriptionUrl;

            if (_command.ContainsParameter("basePath"))
            {
                ExtraPath = _command.GetFirstParameterValue("basePath");
            }
            if (_command.ContainsParameter("timerInterval"))
            {
                testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds] = _command.GetFirstParameterValue("timerInterval");
            }
            if (_command.ContainsParameter("timerStart"))
            {
                testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds] = _command.GetFirstParameterValue("timerStart");
            }
            if (_command.ContainsParameter("sessionInterval"))
            {
                testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds] = _command.GetFirstParameterValue("sessionInterval");
            }
            if (_command.ContainsParameter("subsessionInterval"))
            {
                testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds] = _command.GetFirstParameterValue("subsessionInterval");
            }
            if (_command.ContainsParameter("noBackoffWait"))
            {
                testOptions[AdjustUtils.KeyTestOptionsNoBackoffWait] = _command.GetFirstParameterValue("noBackoffWait");
            }
            testOptions [AdjustUtils.KeyTestOptionsiAdFrameworkEnabled] = "false";  // false - iAd will not be used in test app by default
            if (_command.ContainsParameter("iAdFrameworkEnabled"))
            {
                testOptions[AdjustUtils.KeyTestOptionsiAdFrameworkEnabled] = _command.GetFirstParameterValue("iAdFrameworkEnabled");
            }
            if (_command.ContainsParameter("teardown"))
            {
                List <string> teardownOptions = _command.Parameters["teardown"];
                foreach (string teardownOption in teardownOptions)
                {
                    if (teardownOption == "resetSdk")
                    {
                        testOptions[AdjustUtils.KeyTestOptionsTeardown]  = "true";
                        testOptions[AdjustUtils.KeyTestOptionsExtraPath] = ExtraPath;
                        testOptions[AdjustUtils.KeyTestOptionsUseTestConnectionOptions] = "true";
                    }
                    if (teardownOption == "deleteState")
                    {
                        testOptions[AdjustUtils.KeyTestOptionsDeleteState] = "true";
                    }
                    if (teardownOption == "resetTest")
                    {
                        _savedEvents  = new Dictionary <int, AdjustEvent>();
                        _savedConfigs = new Dictionary <int, AdjustConfig>();
                        testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]      = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]    = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]         = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds] = "-1";
                    }
                    if (teardownOption == "sdk")
                    {
                        testOptions[AdjustUtils.KeyTestOptionsTeardown]  = "true";
                        testOptions[AdjustUtils.KeyTestOptionsExtraPath] = null;
                        testOptions[AdjustUtils.KeyTestOptionsUseTestConnectionOptions] = "false";
                    }
                    if (teardownOption == "test")
                    {
                        _savedEvents  = null;
                        _savedConfigs = null;
                        testOptions[AdjustUtils.KeyTestOptionsTimerIntervalInMilliseconds]      = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsTimerStartInMilliseconds]         = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsSessionIntervalInMilliseconds]    = "-1";
                        testOptions[AdjustUtils.KeyTestOptionsSubsessionIntervalInMilliseconds] = "-1";
                    }
                }
            }

            Adjust.SetTestOptions(testOptions);
        }
 public static void SetTestOptions(AdjustTestOptionsDto adjustTestOptionsDto)
 {
     Adjust.SetTestOptions(adjustTestOptionsDto.ToAdjustTestOptions());
 }
Ejemplo n.º 4
0
        private void TestOptions()
        {
            TestApp.Log("Configuring and setting Testing Options...");

            AdjustTestOptions testOptions = new AdjustTestOptions();

            testOptions.BaseUrl = _baseUrl;
            testOptions.GdprUrl = _gdprUrl;

            if (_command.ContainsParameter("basePath"))
            {
                BasePath = _command.GetFirstParameterValue("basePath");
                GdprPath = _command.GetFirstParameterValue("basePath");
            }

            if (_command.ContainsParameter("timerInterval"))
            {
                long timerInterval = long.Parse(_command.GetFirstParameterValue("timerInterval"));
                testOptions.TimerIntervalInMilliseconds = timerInterval;
            }

            if (_command.ContainsParameter("timerStart"))
            {
                long timerStart = long.Parse(_command.GetFirstParameterValue("timerStart"));
                testOptions.TimerStartInMilliseconds = timerStart;
            }

            if (_command.ContainsParameter("sessionInterval"))
            {
                long sessionInterval = long.Parse(_command.GetFirstParameterValue("sessionInterval"));
                testOptions.SessionIntervalInMilliseconds = sessionInterval;
            }

            if (_command.ContainsParameter("subsessionInterval"))
            {
                long subsessionInterval = long.Parse(_command.GetFirstParameterValue("subsessionInterval"));
                testOptions.SubsessionIntervalInMilliseconds = subsessionInterval;
            }

            if (_command.ContainsParameter("teardown"))
            {
                List <string> teardownOptions = _command.Parameters["teardown"];
                foreach (string teardownOption in teardownOptions)
                {
                    if (teardownOption == "resetSdk")
                    {
                        testOptions.Teardown = true;
                        testOptions.BasePath = BasePath;
                        testOptions.GdprPath = GdprPath;
                        testOptions.UseTestConnectionOptions = true;
                    }
                    if (teardownOption == "deleteState")
                    {
                        testOptions.DeleteState = true;
                    }
                    if (teardownOption == "resetTest")
                    {
                        _savedEvents  = new Dictionary <int, AdjustEvent>();
                        _savedConfigs = new Dictionary <int, AdjustConfig>();
                        testOptions.TimerIntervalInMilliseconds      = -1;
                        testOptions.TimerStartInMilliseconds         = -1;
                        testOptions.SessionIntervalInMilliseconds    = -1;
                        testOptions.SubsessionIntervalInMilliseconds = -1;
                    }
                    if (teardownOption == "sdk")
                    {
                        testOptions.Teardown = true;
                        testOptions.BasePath = null;
                        testOptions.GdprPath = null;
                        testOptions.UseTestConnectionOptions = false;
                    }
                    if (teardownOption == "test")
                    {
                        _savedEvents  = null;
                        _savedConfigs = null;
                        testOptions.TimerIntervalInMilliseconds      = -1;
                        testOptions.TimerStartInMilliseconds         = -1;
                        testOptions.SessionIntervalInMilliseconds    = -1;
                        testOptions.SubsessionIntervalInMilliseconds = -1;
                    }
                }
            }

            Adjust.SetTestOptions(testOptions);
        }
Ejemplo n.º 5
0
        private void TestOptions()
        {
            AdjustTestOptions testOptions = new AdjustTestOptions();

            testOptions.BaseUrl         = AppDelegate.BaseUrl;
            testOptions.GdprUrl         = AppDelegate.GdprUrl;
            testOptions.SubscriptionUrl = AppDelegate.SubscriptionUrl;

            if (Command.ContainsParameter("basePath"))
            {
                ExtraPath = Command.GetFirstParameterValue("basePath");
            }

            if (Command.ContainsParameter("timerInterval"))
            {
                long timerInterval = long.Parse(Command.GetFirstParameterValue("timerInterval"));
                testOptions.TimerIntervalInMilliseconds = timerInterval;
            }

            if (Command.ContainsParameter("timerStart"))
            {
                long timerStart = long.Parse(Command.GetFirstParameterValue("timerStart"));
                testOptions.TimerStartInMilliseconds = timerStart;
            }

            if (Command.ContainsParameter("sessionInterval"))
            {
                long sessionInterval = long.Parse(Command.GetFirstParameterValue("sessionInterval"));
                testOptions.SessionIntervalInMilliseconds = sessionInterval;
            }

            if (Command.ContainsParameter("subsessionInterval"))
            {
                long subsessionInterval = long.Parse(Command.GetFirstParameterValue("subsessionInterval"));
                testOptions.SubsessionIntervalInMilliseconds = subsessionInterval;
            }

            if (Command.ContainsParameter("noBackoffWait"))
            {
                if (Command.GetFirstParameterValue("noBackoffWait") == "true")
                {
                    testOptions.NoBackoffWait = true;
                }
            }

            if (Command.ContainsParameter("iAdFrameworkEnabled"))
            {
                if (Command.GetFirstParameterValue("iAdFrameworkEnabled") == "true")
                {
                    testOptions.IAdFrameworkEnabled = true;
                }
            }

            if (Command.ContainsParameter("adServicesFrameworkEnabled"))
            {
                if (Command.GetFirstParameterValue("adServicesFrameworkEnabled") == "true")
                {
                    testOptions.AdServicesFrameworkEnabled = true;
                }
            }

            if (Command.ContainsParameter("teardown"))
            {
                IList <string> teardownOptions = Command.Parameters["teardown"];
                foreach (string teardownOption in teardownOptions)
                {
                    if (teardownOption == "resetSdk")
                    {
                        testOptions.Teardown  = true;
                        testOptions.ExtraPath = ExtraPath;
                    }
                    if (teardownOption == "deleteState")
                    {
                        testOptions.DeleteState = true;
                    }
                    if (teardownOption == "resetTest")
                    {
                        _savedEvents  = new Dictionary <int, ADJEvent>();
                        _savedConfigs = new Dictionary <int, ADJConfig>();
                        testOptions.TimerIntervalInMilliseconds      = -1000;
                        testOptions.TimerStartInMilliseconds         = -1000;
                        testOptions.SessionIntervalInMilliseconds    = -1000;
                        testOptions.SubsessionIntervalInMilliseconds = -1000;
                    }
                    if (teardownOption == "sdk")
                    {
                        testOptions.Teardown = true;
                        // System.ArgumentNullException is thrown when trying to nullify these two vals.
                        // iOS ApiDefinition object doesn't allow null-ing of these fields.
                        // testOptions.BasePath = null;
                        // testOptions.GdprPath = null;
                    }
                    if (teardownOption == "test")
                    {
                        _savedEvents  = null;
                        _savedConfigs = null;
                        ExtraPath     = null;
                        testOptions.TimerIntervalInMilliseconds      = -1000;
                        testOptions.TimerStartInMilliseconds         = -1000;
                        testOptions.SessionIntervalInMilliseconds    = -1000;
                        testOptions.SubsessionIntervalInMilliseconds = -1000;
                    }
                }
            }

            Adjust.SetTestOptions(testOptions);
        }
Ejemplo n.º 6
0
        private void TestOptions()
        {
            AdjustTestOptions testOptions = new AdjustTestOptions();

            testOptions.BaseUrl         = MainActivity.BaseUrl;
            testOptions.GdprUrl         = MainActivity.GdprUrl;
            testOptions.SubscriptionUrl = MainActivity.SubscriptionUrl;

            if (Command.ContainsParameter("basePath"))
            {
                BasePath         = Command.GetFirstParameterValue("basePath");
                GdprPath         = Command.GetFirstParameterValue("basePath");
                SubscriptionPath = Command.GetFirstParameterValue("basePath");
            }

            if (Command.ContainsParameter("timerInterval"))
            {
                long timerInterval = long.Parse(Command.GetFirstParameterValue("timerInterval"));
                testOptions.TimerIntervalInMilliseconds = new Java.Lang.Long(timerInterval);
            }

            if (Command.ContainsParameter("timerStart"))
            {
                long timerStart = long.Parse(Command.GetFirstParameterValue("timerStart"));
                testOptions.TimerStartInMilliseconds = new Java.Lang.Long(timerStart);
            }

            if (Command.ContainsParameter("sessionInterval"))
            {
                long sessionInterval = long.Parse(Command.GetFirstParameterValue("sessionInterval"));
                testOptions.SessionIntervalInMilliseconds = new Java.Lang.Long(sessionInterval);
            }

            if (Command.ContainsParameter("subsessionInterval"))
            {
                long subsessionInterval = long.Parse(Command.GetFirstParameterValue("subsessionInterval"));
                testOptions.SubsessionIntervalInMilliseconds = new Java.Lang.Long(subsessionInterval);
            }

            if (Command.ContainsParameter("tryInstallReferrer"))
            {
                String tryInstallReferrerString = Command.GetFirstParameterValue("tryInstallReferrer");
                bool   tryInstallReferrer;
                if (bool.TryParse(tryInstallReferrerString, out tryInstallReferrer))
                {
                    testOptions.TryInstallReferrer = new Java.Lang.Boolean(tryInstallReferrer);
                }
            }

            if (Command.ContainsParameter("noBackoffWait"))
            {
                if (Command.GetFirstParameterValue("noBackoffWait") == "true")
                {
                    testOptions.NoBackoffWait = new Java.Lang.Boolean(true);
                }
            }

            if (Command.ContainsParameter("teardown"))
            {
                IList <string> teardownOptions = Command.Parameters["teardown"];
                foreach (string teardownOption in teardownOptions)
                {
                    if (teardownOption == "resetSdk")
                    {
                        testOptions.Teardown                 = new Java.Lang.Boolean(true);
                        testOptions.BasePath                 = BasePath;
                        testOptions.GdprPath                 = GdprPath;
                        testOptions.SubscriptionPath         = SubscriptionPath;
                        testOptions.UseTestConnectionOptions = new Java.Lang.Boolean(true);
                        testOptions.TryInstallReferrer       = new Java.Lang.Boolean(false);
                    }
                    if (teardownOption == "deleteState")
                    {
                        testOptions.Context = _context;
                    }
                    if (teardownOption == "resetTest")
                    {
                        _savedEvents  = new Dictionary <int, AdjustEvent>();
                        _savedConfigs = new Dictionary <int, AdjustConfig>();
                        testOptions.TimerIntervalInMilliseconds      = new Java.Lang.Long(-1);
                        testOptions.TimerStartInMilliseconds         = new Java.Lang.Long(-1);
                        testOptions.SessionIntervalInMilliseconds    = new Java.Lang.Long(-1);
                        testOptions.SubsessionIntervalInMilliseconds = new Java.Lang.Long(-1);
                    }
                    if (teardownOption == "sdk")
                    {
                        testOptions.Teardown                 = new Java.Lang.Boolean(true);
                        testOptions.BasePath                 = null;
                        testOptions.GdprPath                 = null;
                        testOptions.SubscriptionPath         = null;
                        testOptions.UseTestConnectionOptions = new Java.Lang.Boolean(false);
                    }
                    if (teardownOption == "test")
                    {
                        _savedEvents  = null;
                        _savedConfigs = null;
                        testOptions.TimerIntervalInMilliseconds      = new Java.Lang.Long(-1);
                        testOptions.TimerStartInMilliseconds         = new Java.Lang.Long(-1);
                        testOptions.SessionIntervalInMilliseconds    = new Java.Lang.Long(-1);
                        testOptions.SubsessionIntervalInMilliseconds = new Java.Lang.Long(-1);
                    }
                }
            }

            Adjust.SetTestOptions(testOptions);
        }