Exemplo n.º 1
0
        private Result Test01()
        {
            Transaction t = null;

            AppRibbon.xm = XsMgr;
            AppRibbon.dm = DsMgr;

            // test to reset and eliminate everything from memory
            try
            {
                using (t = new Transaction(AppRibbon.Doc, "Test01"))
                {
                    t.Start();
                    {
                        if (AppRibbon.Doc.IsDetached)
                        {
                            return(Result.Cancelled);
                        }

                        AppRibbon.msg += "before reset\n";

                        if (!xsTest.Reset())
                        {
                            xsTest.showStat("Reset", ExStoreRtnCodes.XRC_UNDEFINED, 0);
                            t.RollBack();
                            return(Result.Failed);
                        }

                        AppRibbon.msg += "after reset\n";

                        xsTest.showStat("Reset", ExStoreRtnCodes.XRC_UNDEFINED, 0);

                        AppRibbon.msg += "before config\n";

                        XsMgr.Configure();

                        AppRibbon.msg += "after config\n";

                        xsTest.showStat("re-configure", ExStoreRtnCodes.XRC_UNDEFINED, 0);
                    }

                    t.Commit();
                }
            }
            catch (OperationCanceledException)
            {
                if (t != null && t.HasStarted())
                {
                    t.RollBack();
                }

                return(Result.Failed);
            }

            return(Result.Succeeded);
        }
Exemplo n.º 2
0
        private Result Test01()
        {
            return(Result.Succeeded);

            Transaction t = null;

            try
            {
                using (t = new Transaction(AppRibbon.Doc, "Test01"))
                {
                    t.Start();
                    {
                        if (AppRibbon.Doc.IsDetached)
                        {
                            return(Result.Cancelled);
                        }

                        if (XsMgr.AppExStorExists)
                        {
                            return(Result.Failed);
                        }

                        ExStoreRtnCodes result;

                        xsTest.makeSampleDataAppAndCell();
                        result = XsMgr.MakeApp();
                        xsTest.showStat("Create app", result, 2);
                        if (result != ExStoreRtnCodes.XRC_GOOD)
                        {
                            return(Result.Failed);
                        }
                    }

                    t.Commit();
                }
            }
            catch (OperationCanceledException)
            {
                if (t != null && t.HasStarted())
                {
                    t.RollBack();
                }

                return(Result.Failed);
            }

            return(Result.Succeeded);
        }
Exemplo n.º 3
0
        private Result Test01()
        {
            Transaction t = null;

            // test to create the root datastorage / schema / entity
            // and create the app+cell datastorage

            AppRibbon.msg += "before sample data\n";

            // create the test data
            makeSampleData();
            // xsTest.showStat("Create root", ExStoreRtnCodes.XRC_UNDEFINED, 1);

            bool noSkip = true;

            try
            {
                using (t = new Transaction(AppRibbon.Doc, "Test01"))
                {
                    t.Start();
                    {
                        if (AppRibbon.Doc.IsDetached)
                        {
                            return(Result.Cancelled);
                        }

                        ExStoreRtnCodes result;

                        AppRibbon.msg += "before make root\n";
                        result         = XsMgr.MakeRoot();
                        AppRibbon.msg += "after make root\n";

                        xsTest.showStat("Create root", result, 1);
                        if (result != ExStoreRtnCodes.XRC_GOOD)
                        {
                            t.Commit();
                            return(Result.Failed);
                        }


                        if (noSkip)
                        {
                            AppRibbon.msg += "before make app\n";
                            result         = XsMgr.MakeApp();
                            AppRibbon.msg += "after make app\n";

                            xsTest.showStat("Create root", result, 1);
                            if (result != ExStoreRtnCodes.XRC_GOOD)
                            {
                                t.Commit();
                                return(Result.Failed);
                            }
                        }
                    }
                    t.Commit();
                }
            }
            catch (OperationCanceledException)
            {
                if (t != null && t.HasStarted())
                {
                    t.RollBack();
                }

                return(Result.Failed);
            }

            return(Result.Succeeded);
        }