public AppDataBasesPage(EnvApplication applicationOwner, Context context) { InitializeComponent(); AppOwner = applicationOwner; mContext = context; //Set grid look and data SetGridView(); SetGridData(); //Added for Encryption if (grdAppDbs.grdMain != null) { grdAppDbs.grdMain.CellEditEnding += grdMain_CellEditEnding; grdAppDbs.grdMain.PreparingCellForEdit += grdMain_PreparingCellForEdit; } }
public void TestInitialize() { mEnv = new ProjEnvironment(); EnvApplication app1 = new EnvApplication(); app1.Name = "App1"; app1.Url = "URL123"; mEnv.Applications.Add(app1); Database db1 = new Database(); db1.Name = "DB1"; app1.Dbs.Add(db1); GeneralParam GP1 = new GeneralParam(); GP1.Name = "GP1"; GP1.Value = "GP1Value"; app1.GeneralParams.Add(GP1); mBF = new BusinessFlow(); VariableString v1 = new VariableString(); v1.Name = "v1"; v1.Value = v1Value; //mBF.Variables.Add(v1); mBF.AddVariable(v1); VariableString v2 = new VariableString(); v2.Name = "v2"; v2.Value = v2Value; //mBF.Variables.Add(v2); mBF.AddVariable(v2); VariableString v3 = new VariableString(); v3.Name = "v3"; v3.Value = v3Value; //mBF.Variables.Add(v3); mBF.AddVariable(v3); VariableString v4 = new VariableString(); v4.Name = "v4"; v4.Value = v4Value; //mBF.Variables.Add(v4); mBF.AddVariable(v4); }
public ApplicationPage(EnvApplication app) { InitializeComponent(); mEnvApplication = app; App.ObjFieldBinding(ApplicationNameTextBox, TextBox.TextProperty, app, nameof(EnvApplication.Name)); App.ObjFieldBinding(DescriptionTextBox, TextBox.TextProperty, app, nameof(EnvApplication.Description)); UpdateParametersTabHeader(); app.GeneralParams.CollectionChanged += GeneralParams_CollectionChanged; UpdateDBsTabHeader(); app.Dbs.CollectionChanged += Dbs_CollectionChanged; UpdateLoginuserTabHeader(); app.LoginUsers.CollectionChanged += LoginUsers_CollectionChanged; ColorSelectedTab(); }
private void xAddAppBtn_Click(object sender, RoutedEventArgs e) { string newAppName = "NewApp"; if (GingerCore.General.GetInputWithValidation("Add Environment Application", "Application Name:", ref newAppName)) { if (mWizard.apps.Where(x => x.Name == newAppName).FirstOrDefault() == null) { EnvApplication envApp = new EnvApplication() { Name = newAppName }; envApp.Active = true; mWizard.apps.Add(envApp); } } }
private void ReplaceEnvURLWithValue(string p, string[] a) { string AppName = null; string URL = null; AppName = p.Replace("\r\n", "vbCrLf"); AppName = AppName.Substring(1, AppName.Length - 2); AppName = AppName.Replace("EnvURL App=", ""); EnvApplication app = Env.GetApplication(AppName); if (app != null) { URL = app.Url + ""; mValueCalculated = mValueCalculated.Replace(p, URL); } else { // TODO: err } }
public void RenameDBName() { //Arrange ProjEnvironment projEnvironment = new ProjEnvironment(); projEnvironment.Name = "MongoDbApp"; EnvApplication envApplication = new EnvApplication(); envApplication.Name = "DB"; Database db = new Database(); DatabaseOperations databaseOperations = new DatabaseOperations(db); db.DatabaseOperations = databaseOperations; db.Name = "MongoDb"; db.DBType = Database.eDBTypes.MongoDb; envApplication.Dbs.Add(db); projEnvironment.Applications.Add(envApplication); mGR.ProjEnvironment = projEnvironment; ActDBValidation actDB = new ActDBValidation(); actDB.DBValidationType = ActDBValidation.eDBValidationType.UpdateDB; actDB.AppName = "DB"; actDB.DBName = "MongoDb"; mBF.CurrentActivity.Acts.Add(actDB); mBF.CurrentActivity.Acts.CurrentItem = actDB; //Act ((DatabaseOperations)db.DatabaseOperations).NameBeforeEdit = actDB.DBName; db.Name = "MongoDBNew"; //Database.UpdateDatabaseNameChangeInItem(actDB, db.NameBeforeEdit, db.Name); //Assert Assert.AreEqual(actDB.DBName, db.Name, "Names"); }
private void AppNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { // TODO: if there is only one item in the combo auto select it DBNameComboBox.Items.Clear(); KeySpaceComboBox.Items.Clear(); TablesComboBox.Items.Clear(); ColumnComboBox.Items.Clear(); if ((((ComboBox)sender).SelectedItem) == null) { return; } string app = ((ComboBox)sender).SelectedItem.ToString(); EA = (from a in pe.Applications where a.Name == app select a).FirstOrDefault(); foreach (Database db in EA.Dbs) { DBNameComboBox.Items.Add(db.Name); } ComboAutoSelectIfOneItemOnly(DBNameComboBox); }
public void MongoDbUpdateDB() { ActDBValidation actDB = new ActDBValidation(); actDB.DBValidationType = ActDBValidation.eDBValidationType.UpdateDB; actDB.AppName = "DB"; actDB.DBName = "MongoDb"; actDB.SQL = "db.inventory.updateOne({ item: \"paper\" },{$set: { \"size.uom\": \"cm\", status: \"P\" }})"; mBF.CurrentActivity.Acts.Add(actDB); mBF.CurrentActivity.Acts.CurrentItem = actDB; ProjEnvironment projEnvironment = new ProjEnvironment(); projEnvironment.Name = "MongoDbApp"; EnvApplication envApplication = new EnvApplication(); envApplication.Name = "DB"; Database db = new Database(); DatabaseOperations databaseOperations = new DatabaseOperations(db); db.DatabaseOperations = databaseOperations; db.Name = "MongoDb"; db.DBType = Database.eDBTypes.MongoDb; db.ConnectionString = ConfigurationManager.AppSettings["MongoDbConnectionString"]; envApplication.Dbs.Add(db); projEnvironment.Applications.Add(envApplication); mGR.ProjEnvironment = projEnvironment; mGR.Executor.RunAction(actDB, false); Assert.AreEqual(eRunStatus.Passed, actDB.Status, "Action Status"); }
public void MongoDbRecordCount() { ActDBValidation actDB = new ActDBValidation(); actDB.DBValidationType = ActDBValidation.eDBValidationType.RecordCount; actDB.AppName = "DB"; actDB.DBName = "MongoDb"; actDB.SQL = "products"; mBF.CurrentActivity.Acts.Add(actDB); mBF.CurrentActivity.Acts.CurrentItem = actDB; ProjEnvironment projEnvironment = new ProjEnvironment(); projEnvironment.Name = "MongoDbApp"; EnvApplication envApplication = new EnvApplication(); envApplication.Name = "DB"; Database db = new Database(); DatabaseOperations databaseOperations = new DatabaseOperations(db); db.DatabaseOperations = databaseOperations; db.Name = "MongoDb"; db.DBType = Database.eDBTypes.MongoDb; db.ConnectionString = ConfigurationManager.AppSettings["MongoDbConnectionString"]; envApplication.Dbs.Add(db); projEnvironment.Applications.Add(envApplication); mGR.ProjEnvironment = projEnvironment; mGR.Executor.RunAction(actDB, false); Assert.AreEqual(eRunStatus.Passed, actDB.Status, "Action Status"); }
private void Share(object sender, System.Windows.RoutedEventArgs e) { bool appsWereAdded = false; ObservableList <ProjEnvironment> envs = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <ProjEnvironment>(); foreach (ProjEnvironment env in envs) { if (env != ProjEnvironment) { if (env.Applications.Where(x => x.Name == EnvApplication.Name).FirstOrDefault() == null) { EnvApplication app = (EnvApplication)(((RepositoryItemBase)EnvApplication).CreateCopy()); env.Applications.Add(app); env.SaveBackup();//to mark the env as changed appsWereAdded = true; } } } if (appsWereAdded) { Reporter.ToUser(eUserMsgKey.ShareEnvAppWithAllEnvs); } }
public void TestInitialize() { WorkSpace.Init(new WorkSpaceEventHandler()); WorkSpace.Instance.SolutionRepository = GingerSolutionRepository.CreateGingerSolutionRepository(); // Init SR mSolutionRepository = WorkSpace.Instance.SolutionRepository; string TempRepositoryFolder = TestResources.GetTestTempFolder(Path.Combine("Solutions", "temp")); mSolutionRepository.Open(TempRepositoryFolder); Ginger.SolutionGeneral.Solution sol = new Ginger.SolutionGeneral.Solution(); sol.ContainingFolderFullPath = TempRepositoryFolder; WorkSpace.Instance.Solution = sol; mSolutionRepository.StopAllRepositoryFolderWatchers(); WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder = Path.Combine(TempRepositoryFolder, "ExecutionResults"); runset = new RunSetConfig(); runset.Name = "NewRunset1"; WorkSpace.Instance.RunsetExecutor.RunSetConfig = runset; runner = new GingerRunner(); runner.Name = "Runner1"; runner.CurrentSolution = new Ginger.SolutionGeneral.Solution(); WorkSpace.Instance.RunsetExecutor.Runners.Add(runner); mEnv = new ProjEnvironment(); mEnv.Name = "Environment1"; EnvApplication app1 = new EnvApplication(); app1.Name = "App1"; app1.Url = "URL123"; mEnv.Applications.Add(app1); GeneralParam GP1 = new GeneralParam(); GP1.Name = "GP1"; GP1.Value = "GP1Value"; app1.GeneralParams.Add(GP1); mBF = new BusinessFlow(); mBF.Name = "Businessflow1"; runner.BusinessFlows.Add(mBF); mActivity = new GingerCore.Activity(); mActivity.Active = true; mActivity.ActivityName = "Activity1"; mAct = new ActDummy(); mAct.Active = true; mAct.Description = "Action1"; mActivity.Acts.Add(mAct); mActivity.Acts.CurrentItem = mAct; mBF.AddActivity(mActivity); BusinessFlow BF1 = new BusinessFlow(); BF1.Name = "Businessflow2"; runner.BusinessFlows.Add(BF1); GingerCore.Activity activity = new GingerCore.Activity(); activity.Active = true; activity.ActivityName = "Activity1"; ActDummy dummy = new ActDummy(); dummy.Active = true; dummy.Description = "Dummy1"; activity.Acts.Add(dummy); activity.Acts.CurrentItem = dummy; BF1.AddActivity(activity); }