Exemplo n.º 1
0
 public static void SetTestOptions(AdjustTestOptions testOptions)
 {
     if (Adjust.IsEditor())
     {
         return;
     }
     AdjustAndroid.SetTestOptions(testOptions);
 }
Exemplo n.º 2
0
        public static void SetTestOptions(AdjustTestOptions testOptions)
        {
            AndroidJavaObject androidJavaObject = testOptions.ToAndroidJavaObject(AdjustAndroid.ajoCurrentActivity);

            AdjustAndroid.ajcAdjust.CallStatic("setTestOptions", new object[]
            {
                androidJavaObject
            });
        }
Exemplo n.º 3
0
 public static void SetTestOptions(AdjustTestOptions testOptions)
 {
     TestLibraryInterface.TestLibraryInterface.SetTestOptions(
         new TestLibraryInterface.AdjustTestOptionsDto
     {
         BasePath    = testOptions.BasePath,
         GdprPath    = testOptions.GdprPath,
         BaseUrl     = testOptions.BaseUrl,
         GdprUrl     = testOptions.GdprUrl,
         DeleteState = testOptions.DeleteState,
         SessionIntervalInMilliseconds    = testOptions.SessionIntervalInMilliseconds,
         SubsessionIntervalInMilliseconds = testOptions.SubsessionIntervalInMilliseconds,
         TimerIntervalInMilliseconds      = testOptions.TimerIntervalInMilliseconds,
         TimerStartInMilliseconds         = testOptions.TimerStartInMilliseconds,
         Teardown = testOptions.Teardown
     });
 }
Exemplo n.º 4
0
        public static void SetTestOptions(AdjustTestOptions testOptions)
        {
            if (IsEditor())
            {
                return;
            }

            #if UNITY_IOS
            AdjustiOS.SetTestOptions(testOptions);
            #elif UNITY_ANDROID
            AdjustAndroid.SetTestOptions(testOptions);
            #elif (UNITY_WSA || UNITY_WP8)
            AdjustWindows.SetTestOptions(testOptions);
            #else
            Debug.Log("Cannot run integration tests. None of the supported platforms selected.");
            #endif
        }
Exemplo n.º 5
0
        public static void SetTestOptions(AdjustTestOptions testOptions)
        {
            long timerIntervalMls = testOptions.TimerIntervalInMilliseconds.HasValue ? testOptions.TimerIntervalInMilliseconds.Value : -1;
            long timerStartMls    = testOptions.TimerStartInMilliseconds.HasValue ? testOptions.TimerStartInMilliseconds.Value : -1;
            long sessionIntMls    = testOptions.SessionIntervalInMilliseconds.HasValue ? testOptions.SessionIntervalInMilliseconds.Value : -1;
            long subsessionIntMls = testOptions.SubsessionIntervalInMilliseconds.HasValue ? testOptions.SubsessionIntervalInMilliseconds.Value : -1;
            bool teardown         = testOptions.Teardown.HasValue ? testOptions.Teardown.Value : false;
            bool deleteState      = testOptions.DeleteState.HasValue ? testOptions.DeleteState.Value : false;

            _AdjustSetTestOptions(
                testOptions.BaseUrl,
                testOptions.BasePath,
                testOptions.GdprUrl,
                testOptions.GdprPath,
                timerIntervalMls,
                timerStartMls,
                sessionIntMls,
                subsessionIntMls,
                AdjustUtils.ConvertBool(teardown),
                AdjustUtils.ConvertBool(deleteState));
        }
Exemplo n.º 6
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
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
        // Used for testing only.
        public static void SetTestOptions(AdjustTestOptions testOptions)
        {
            AndroidJavaObject ajoTestOptions = testOptions.ToAndroidJavaObject(ajoCurrentActivity);

            ajcAdjust.CallStatic("setTestOptions", ajoTestOptions);
        }