Example #1
0
        public static void InitClassTypesDictionary()
        {
            if (bDone)
            {
                return;
            }

            bDone = true;
            // TODO: remove after we don't need old serializer to load old repo items
            NewRepositorySerializer.NewRepositorySerializerEvent += RepositorySerializer.NewRepositorySerializer_NewRepositorySerializerEvent;

            // Add all RI classes from GingerCore
            NewRepositorySerializer.AddClassesFromAssembly(typeof(GingerCore.Actions.ActButton).Assembly); // GingerCore.dll

            // add from Ginger
            NewRepositorySerializer.AddClassesFromAssembly(typeof(Ginger.App).Assembly);

            // Each class which moved from GingerCore to GingerCoreCommon needed to be added here, so it will auto translate
            // For backward compatibility of loading old object name in xml
            Dictionary <string, Type> list = new Dictionary <string, Type>();

            list.Add("GingerCore.Actions.ActInputValue", typeof(ActInputValue));
            list.Add("GingerCore.Actions.ActReturnValue", typeof(ActReturnValue));
            list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));
            list.Add("GingerCore.Environments.GeneralParam", typeof(GeneralParam));



            NewRepositorySerializer.AddClasses(list);
        }
        public static void ClassInitialize(TestContext TestContext)
        {
            mTestHelper.ClassInitialize(TestContext);

            TempRepositoryFolder = TestResources.GetTestTempFolder("Solutions", "SRTestTemp");
            Console.WriteLine("SolutionRepositoryTest folder: " + TempRepositoryFolder);

            Console.WriteLine("===> Creating test solution");
            CreateTestSolution();
            Console.WriteLine("===> test solution created");

            mRepositorySerializer = new NewRepositorySerializer();
            // Init SR
            mSolutionRepository = new SolutionRepository();
            mSolutionRepository.AddItemInfo <MyRepositoryItem>(pattern: "*.Ginger.MyRepositoryItem.xml",   // Need to use for file name
                                                               rootFolder: SolutionRepository.cSolutionRootFolderSign + "MyRepositoryItems",
                                                               containRepositoryItems: true,
                                                               displayName: "My Repository Item",
                                                               PropertyNameForFileName: nameof(MyRepositoryItem.Name)
                                                               );

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(MyRepositoryItem).Assembly);
            mSolutionRepository.Open(TempRepositoryFolder);
        }
Example #3
0
        public static void ClassInitialize(TestContext TC)
        {
            TempRepositoryFolder = TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "SRTestTempLongPath");

            int i = 1;

            while (TempRepositoryFolder.Length < 300)
            {
                TempRepositoryFolder = Path.Combine(TempRepositoryFolder, "LongSubFolderName_" + i);
                Directory.CreateDirectory(PathHelper.GetLongPath(TempRepositoryFolder));
                i++;
            }


            CreateTestSolution();

            mRepositorySerializer = new NewRepositorySerializer();
            // Init SR
            mSolutionRepository = new SolutionRepository();
            mSolutionRepository.AddItemInfo <MyRepositoryItem>(pattern: "*.Ginger.MyRepositoryItem.xml",   // Need to use for file name
                                                               rootFolder: @"~\MyRepositoryItems",
                                                               containRepositoryItems: true,
                                                               displayName: "My Repository Item",
                                                               PropertyNameForFileName: nameof(MyRepositoryItem.Name)
                                                               );


            NewRepositorySerializer.AddClassesFromAssembly(typeof(MyRepositoryItem).Assembly);



            mSolutionRepository.Open(TempRepositoryFolder);
        }
 public static void ClassInitialize(TestContext TestContext)
 {
     //TODO::
     mTestHelper.ClassInitialize(TestContext);
     NewRepositorySerializer.AddClassesFromAssembly(typeof(ActValidation).Assembly);
     NewRepositorySerializer.AddClassesFromAssembly(typeof(BusinessFlow).Assembly);
 }
Example #5
0
        public static void InitClassTypesDictionary()
        {
            if (bDone)
            {
                return;
            }

            bDone = true;
            // TODO: remove after we don't need old serializer to load old repo items
            NewRepositorySerializer.NewRepositorySerializerEvent += RepositorySerializer.NewRepositorySerializer_NewRepositorySerializerEvent;

            // Add all RI classes from GingerCore
            NewRepositorySerializer.AddClassesFromAssembly(typeof(GingerCore.Actions.ActButton).Assembly); // GingerCore.dll

            // add from Ginger
            NewRepositorySerializer.AddClassesFromAssembly(typeof(Ginger.App).Assembly);

            // Each class which moved from GingerCore to GingerCoreCommon needed to be added here, so it will auto translate
            // For backward compatibility of loading old object name in xml
            Dictionary <string, Type> list = new Dictionary <string, Type>();

            list.Add("GingerCore.Actions.ActInputValue", typeof(ActInputValue));
            list.Add("GingerCore.Actions.ActReturnValue", typeof(ActReturnValue));
            list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));
            list.Add("GingerCore.Environments.GeneralParam", typeof(GeneralParam));


            // Put back for Lazy load of BF.Acitvities
            NewRepositorySerializer.AddLazyLoadAttr(nameof(BusinessFlow.Activities)); // TODO: add RI type, and use attr on field
            NewRepositorySerializer.AddLazyLoadAttr(nameof(ApplicationPOMModel.UnMappedUIElements));
            NewRepositorySerializer.AddLazyLoadAttr(nameof(ApplicationPOMModel.MappedUIElements));

            NewRepositorySerializer.AddClasses(list);
        }
Example #6
0
        public static void InitClassTypesDictionary()
        {
            //TODO: cleanup after all RIs moved to GingerCoreCommon

            //if (bDone) return;
            //bDone = true;

            // TODO: remove after we don't need old serializer to load old repo items
            // NewRepositorySerializer.NewRepositorySerializerEvent += RepositorySerializer.NewRepositorySerializer_NewRepositorySerializerEvent;

            // Add all RI classes from GingerCoreCommon
            NewRepositorySerializer.AddClassesFromAssembly(typeof(RepositoryItemBase).Assembly);

            // Add all RI classes from GingerCore
            // NewRepositorySerializer.AddClassesFromAssembly(typeof(GingerCore.Actions.ActButton).Assembly); // GingerCore.dll

            // add  old Plugins - TODO: remove later when we change to new plugins
            // NewRepositorySerializer.AddClassesFromAssembly(typeof(GingerPlugIns.ActionsLib.PlugInActionsBase).Assembly);


            // add from Ginger - items like RunSetConfig
            // NewRepositorySerializer.AddClassesFromAssembly(typeof(Ginger.App).Assembly);

            // Each class which moved from GingerCore to GingerCoreCommon needed to be added here, so it will auto translate
            // For backward compatibility of loading old object name in xml
            Dictionary <string, Type> list = new Dictionary <string, Type>();

            list.Add("GingerCore.Actions.ActInputValue", typeof(ActInputValue));
            list.Add("GingerCore.Actions.ActReturnValue", typeof(ActReturnValue));
            list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));
            list.Add("GingerCore.Environments.GeneralParam", typeof(GeneralParam));

            // Put back for Lazy load of BF.Acitvities
            NewRepositorySerializer.AddLazyLoadAttr(nameof(BusinessFlow.Activities)); // TODO: add RI type, and use attr on field


            // Verify the old name used in XML
            //list.Add("GingerCore.Actions.RepositoryItemTag", typeof(RepositoryItemTag));
            //list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));

            // TODO: change to SR2  if we want the files to be loaded convert and save with the new SR2

            //if (WorkSpace.Instance.BetaFeatures.UseNewRepositorySerializer)
            //{
            //RepositorySerializer2 RS2 = new RepositorySerializer2();

            //SolutionRepository.mRepositorySerializer = RS2;
            //RepositoryFolderBase.mRepositorySerializer = RS2;
            //    ObservableListSerializer.RepositorySerializer = RS2;

            //}
            //else
            //{
            //        SolutionRepository.mRepositorySerializer = new RepositorySerializer();
            //        RepositoryFolderBase.mRepositorySerializer = new RepositorySerializer();
            //}

            NewRepositorySerializer.AddClasses(list);
        }
        public static void ClassInitialize(TestContext TC)
        {
            Reporter.ToLog(eLogLevel.DEBUG, "Creating the GingerCoreNET WorkSpace");
            WorkSpaceEventHandler WSEH = new WorkSpaceEventHandler();

            WorkSpace.Init(WSEH);

            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "APIModelsComparisonUtilityTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }

            WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository();
            WorkSpace.Instance.SolutionRepository.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            WorkSpace.Instance.SolutionRepository.Open(TempSolutionFolder);

            // Initialize ApplicationAPIModels XML file names to be fetched from TestResources
            xmlFiles = new List <string>()
            {
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Create_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Delete_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "PhoneVerifySOAP_CheckPhoneNumber.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "Update_User.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "PhoneVerifySOAP_CheckPhoneNumbers.Ginger.ApplicationAPIModel.xml",
                @"Repository" + Path.DirectorySeparatorChar + "SampleAPIModels" + Path.DirectorySeparatorChar + "GetQuote_DelayedStockQuoteSoap.Ginger.ApplicationAPIModel.xml",
            };

            existingAPIsList = new ObservableList <ApplicationAPIModel>();
            learnedAPIsList  = new List <ApplicationAPIModel>();

            // Importing API Models from XML files (listed in xmlFiles)
            foreach (String fileName in xmlFiles)
            {
                var tempFile = TestResources.GetTestResourcesFile(fileName);
                ApplicationAPIModel appModel = RS.DeserializeFromFile(typeof(ApplicationAPIModel), tempFile) as ApplicationAPIModel;
                appModel.FilePath = appModel.Name;//so it will get new file path when been added to repository later
                if (appModel != null)
                {
                    existingAPIsList.Add(appModel);
                    learnedAPIsList.Add(appModel.CreateCopy() as ApplicationAPIModel);
                }
            }

            // Modifying certain API Models for testing different Comparison status and scenarios
            existingAPIsList[1].RequestBody = existingAPIsList[1].RequestBody + "This is modified";
            existingAPIsList[3].RequestBody = existingAPIsList[3].RequestBody + "This is also modified";

            // Storing the API Models in the Solution Repository as will be utilized during Comparison process
            foreach (ApplicationAPIModel apiModel in existingAPIsList.Skip(1).Take(4))
            {
                WorkSpace.Instance.SolutionRepository.AddRepositoryItem(apiModel);
            }
        }
 public static void ClassInitialize(TestContext TestContext)
 {
     //TODO::
     mTestHelper.ClassInitialize(TestContext);
     NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCore);
     NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreCommon);
     NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreNET);
 }
Example #9
0
        /// <summary>
        /// Init core classes type dictionary for RepositorySerializer
        /// </summary>
        void InitClassTypesDictionary()
        {
            if (bDone)
            {
                return;
            }
            bDone = true;

            // Add all RI classes from GingerCoreCommon
            NewRepositorySerializer.AddClassesFromAssembly(typeof(RepositoryItemBase).Assembly);

            // Add gingerCoreNET classes
            NewRepositorySerializer.AddClassesFromAssembly(typeof(RunSetConfig).Assembly);
        }
Example #10
0
        /// <summary>
        /// Init core classes type dictionary for RepositorySerializer
        /// </summary>
        void InitClassTypesDictionary()
        {
            if (bDone)
            {
                return;
            }
            bDone = true;

            // Add all RI classes from GingerCoreCommon
            NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreCommon);

            // Add gingerCoreNET classes
            NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreNET);
            //NewRepositorySerializer.AddClassesFromAssembly(typeof(ALMConfig).Assembly);
        }
Example #11
0
        public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions" + Path.DirectorySeparatorChar + "APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = GingerSolutionRepository.CreateGingerSolutionRepository();


            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(NewRepositorySerializer.eAssemblyType.GingerCoreCommon);
            SR.Open(TempSolutionFolder);
        }
        public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.GetTestTempFolder(@"Solutions\APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = GingerSolutionRepository.CreateGingerSolutionRepository();


            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            SR.Open(TempSolutionFolder);
        }
Example #13
0
        public static void ClassInitialize(TestContext TC)
        {
            string TempSolutionFolder = TestResources.getGingerUnitTesterTempFolder(@"Solutions\APIModelsTest");

            if (Directory.Exists(TempSolutionFolder))
            {
                Directory.Delete(TempSolutionFolder, true);
            }
            SR = new SolutionRepository();

            SR.AddItemInfo <ApplicationAPIModel>("*.Ginger.ApplicationAPIModel.xml", @"~\Applications Models\API Models", true, "API Models", PropertyNameForFileName: nameof(ApplicationAPIModel.Name));
            // SR.AddItemInfo<GlobalAppModelParameter>("*.Ginger.GlobalAppModelParameter.xml", @"~\Applications Models\Global Models Parameters", true, "Global Model Parameters", addToRootFolders: true, PropertyNameForFileName: nameof(GlobalAppModelParameter.PlaceHolder));

            SR.CreateRepository(TempSolutionFolder);

            NewRepositorySerializer RS = new NewRepositorySerializer();

            NewRepositorySerializer.AddClassesFromAssembly(typeof(ApplicationAPIModel).Assembly);
            SR.Open(TempSolutionFolder);
        }
        public static void ClassInit(TestContext TestContext)
        {
            mTestHelper.ClassInitialize(TestContext);

            NewRepositorySerializer.AddClassesFromAssembly(typeof(MyComplextRepositoryItem).Assembly);
        }
Example #15
0
        public static void InitClassTypesDictionary()
        {
            //TODO: cleanup after all RIs moved to GingerCoreCommon

            if (bDone)
            {
                return;
            }
            bDone = true;

            // TODO: remove after we don't need old serializer to load old repo items
            NewRepositorySerializer.NewRepositorySerializerEvent += RepositorySerializer.NewRepositorySerializer_NewRepositorySerializerEvent;

            // Add all RI classes from GingerCoreNET
            // NewRepositorySerializer.AddClassesFromAssembly(typeof(RunSetConfig).Assembly);

            // Add all RI classes from GingerCoreCommon
            NewRepositorySerializer.AddClassesFromAssembly(typeof(RepositoryItemBase).Assembly);

            // Add all RI classes from GingerCore
            NewRepositorySerializer.AddClassesFromAssembly(typeof(GingerCore.Actions.ActButton).Assembly); // GingerCore.dll

            // add from Ginger
            NewRepositorySerializer.AddClassesFromAssembly(typeof(Ginger.App).Assembly);

            // Each class which moved from GingerCore to GingerCoreCommon needed to be added here, so it will auto translate
            // For backward compatibility of loading old object name in xml
            Dictionary <string, Type> list = new Dictionary <string, Type>();

            list.Add("GingerCore.Actions.ActInputValue", typeof(ActInputValue));
            list.Add("GingerCore.Actions.ActReturnValue", typeof(ActReturnValue));
            list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));
            list.Add("GingerCore.Environments.GeneralParam", typeof(GeneralParam));

            // TODO: remove after it moved to common
            AddClass(list, typeof(RunSetConfig));
            AddClass(list, typeof(RunSetActionSendEmail));
            AddClass(list, typeof(BusinessFlowReport));
            AddClass(list, typeof(HTMLReportConfiguration));
            AddClass(list, typeof(HTMLReportConfigFieldToSelect));
            AddClass(list, typeof(Agent));
            AddClass(list, typeof(DriverConfigParam));
            AddClass(list, typeof(GingerRunner));
            AddClass(list, typeof(ApplicationAgent));

            AddClass(list, typeof(RunSetActionHTMLReportSendEmail));
            AddClass(list, typeof(EmailHtmlReportAttachment));
            AddClass(list, typeof(RunSetActionAutomatedALMDefects));
            AddClass(list, typeof(RunSetActionGenerateTestNGReport));
            AddClass(list, typeof(RunSetActionHTMLReport));
            AddClass(list, typeof(RunSetActionSaveResults));
            AddClass(list, typeof(RunSetActionSendFreeEmail));
            AddClass(list, typeof(RunSetActionSendSMS));
            AddClass(list, typeof(RunSetActionPublishToQC));
            AddClass(list, typeof(ActSetVariableValue));
            AddClass(list, typeof(ActClearAllVariables));
            AddClass(list, typeof(ActAgentManipulation));
            AddClass(list, typeof(ActUIElement));
            AddClass(list, typeof(UserProfile));
            AddClass(list, typeof(Solution));
            AddClass(list, typeof(Email));
            AddClass(list, typeof(EmailAttachment));
            AddClass(list, typeof(RunSetActionScript));
            // Put back for Lazy load of BF.Acitvities
            NewRepositorySerializer.AddLazyLoadAttr(nameof(BusinessFlow.Activities)); // TODO: add RI type, and use attr on field


            // Verify the old name used in XML
            //list.Add("GingerCore.Actions.RepositoryItemTag", typeof(RepositoryItemTag));
            //list.Add("GingerCore.Actions.EnhancedActInputValue", typeof(EnhancedActInputValue));

            // TODO: change to SR2  if we want the files to be loaded convert and save with the new SR2

            //if (WorkSpace.Instance.BetaFeatures.UseNewRepositorySerializer)
            //{
            //RepositorySerializer2 RS2 = new RepositorySerializer2();

            //SolutionRepository.mRepositorySerializer = RS2;
            //RepositoryFolderBase.mRepositorySerializer = RS2;
            //    ObservableListSerializer.RepositorySerializer = RS2;

            //}
            //else
            //{
            //        SolutionRepository.mRepositorySerializer = new RepositorySerializer();
            //        RepositoryFolderBase.mRepositorySerializer = new RepositorySerializer();
            //}

            NewRepositorySerializer.AddClasses(list);
        }
Example #16
0
 public static void ClassInitialize(TestContext TC)
 {
     NewRepositorySerializer.AddClassesFromAssembly(typeof(BusinessFlow).Assembly);
 }