/// <summary> /// Creates the object /// </summary> public StoredProcedureTestInputContext() { //Before accessing database restore it to clean state (once only). SnapshotInitialisation.RestoreFromSnapshot(); //string ripleyServerPath = System.Environment.GetEnvironmentVariable("RipleyServerPath"); //_config = new DnaConfig(ripleyServerPath + @"\"); //Dont use the config from h2g2 - use the config from dnapages dir. //Must find a better solution to finding a test config. //_config = new DnaConfig(System.Environment.GetEnvironmentVariable("dnapages") + @"\"); _config = new DnaConfig(TestConfig.GetConfig().GetRipleyServerPath()); //_config.Initialise(); }
/// <summary> /// Creates an AppContext, given the root path of the app, where it can find config info /// </summary> /// <param name="rootPath">Path where app lives</param> public AppContext(string rootPath) { _dnaConfig = new DnaConfig(rootPath); //_dnaConfig.Initialise(); _dnaAppDiagnostics = new DnaDiagnostics(-1, DateTime.Now); if (WebConfigurationManager.AppSettings["maxrequests"] != null) { _maximumRequestCount = Convert.ToInt32(WebConfigurationManager.AppSettings["maxrequests"]); } ReaderCreator = new DnaDataReaderCreator(_dnaConfig.ConnectionString, _dnaAppDiagnostics); }
private void InitialiseFromConfig(string rootPath) { if (rootPath == null) { //Use the config frm the dnapages directory. rootPath = TestConfig.GetConfig().GetRipleyServerPath(); } if (_signInComponent == null) { if (_useIdentity) { string identityWebServiceConnetionDetails = GetConnectionDetails["IdentityURL"].ConnectionString; if (_debugUserDetails.Length == 0) { _signInComponent = new DnaIdentityWebServiceProxy.IdentityRestSignIn(identityWebServiceConnetionDetails, ""); Console.WriteLine("Using REAL Identity signin system"); } else { _signInComponent = new DnaIdentityWebServiceProxy.IdentityDebugSigninComponent(_debugUserDetails); Console.WriteLine("Using DEBUG Identity signin system"); } } else { throw new Exception("SSO Sign in is nologer supported! Please rewrite your test to use identity."); } } if (_dnaConfig == null) { _dnaConfig = new DnaConfig(rootPath); //_dnaConfig.Initialise(); string dir = System.Environment.CurrentDirectory + @"\logs\"; Directory.CreateDirectory(dir); DnaDiagnostics.Initialise(dir, "DNATestUtils"); DnaDiagnostics.WriteHeader("TEST-FullInputContext"); } ReaderCreator = new DnaDataReaderCreator(_dnaConfig.ConnectionString, _dnaDiagnostics); _siteList = new SiteList(ReaderCreator, dnaDiagnostics, CacheFactory.GetCacheManager(), null, null); Statistics.InitialiseIfEmpty(); ProfanityFilterTests.InitialiseProfanities(); }