Ejemplo n.º 1
0
        /// <exception cref="System.Exception"/>
        private AList <RMApp> CreateAndStoreApps(RMStateStoreTestBase.RMStateStoreHelper stateStoreHelper
                                                 , RMStateStore store, int numApps)
        {
            AList <RMApp> appList = new AList <RMApp>();

            for (int i = 0; i < numApps; i++)
            {
                ApplicationId appId = ApplicationId.NewInstance(1383183338, i);
                RMApp         app   = StoreApp(store, appId, 123456789, 987654321);
                appList.AddItem(app);
            }
            NUnit.Framework.Assert.AreEqual(numApps, appList.Count);
            foreach (RMApp app_1 in appList)
            {
                // wait for app to be stored.
                while (true)
                {
                    if (stateStoreHelper.AppExists(app_1))
                    {
                        break;
                    }
                    else
                    {
                        Sharpen.Thread.Sleep(100);
                    }
                }
            }
            return(appList);
        }
Ejemplo n.º 2
0
        /// <exception cref="System.Exception"/>
        public virtual void TestAppDeletion(RMStateStoreTestBase.RMStateStoreHelper stateStoreHelper
                                            )
        {
            RMStateStore store = stateStoreHelper.GetRMStateStore();

            store.SetRMDispatcher(new RMStateStoreTestBase.TestDispatcher());
            AList <RMApp> appList = CreateAndStoreApps(stateStoreHelper, store, 5);

            foreach (RMApp app in appList)
            {
                // remove the app
                store.RemoveApplication(app);
                // wait for app to be removed.
                while (true)
                {
                    if (!stateStoreHelper.AppExists(app))
                    {
                        break;
                    }
                    else
                    {
                        Sharpen.Thread.Sleep(100);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <exception cref="System.Exception"/>
        public virtual void TestDeleteStore(RMStateStoreTestBase.RMStateStoreHelper stateStoreHelper
                                            )
        {
            RMStateStore  store   = stateStoreHelper.GetRMStateStore();
            AList <RMApp> appList = CreateAndStoreApps(stateStoreHelper, store, 5);

            store.DeleteStore();
            // verify apps deleted
            foreach (RMApp app in appList)
            {
                NUnit.Framework.Assert.IsFalse(stateStoreHelper.AppExists(app));
            }
        }