public void SetUpFixture() { FServerConfigurationManager = new SQLCEServerConfigurationManager(); FConfiguration = FServerConfigurationManager.GetTestConfiguration("TestInstance"); FServerConfigurationManager.ResetInstance(); FServer = FServerConfigurationManager.GetServer(); FServer.Start(); IServerSession LSession = FServer.Connect(new SessionInfo("Admin", "")); try { IServerProcess LProcess = LSession.StartProcess(new ProcessInfo(LSession.SessionInfo)); try { LProcess.ExecuteScript("EnsureLibraryRegistered('Frontend');"); LProcess.ExecuteScript("EnsureLibraryRegistered('TestFramework.Coverage.Base');"); } finally { LSession.StopProcess(LProcess); } } finally { FServer.Disconnect(LSession); } }
private void CatalogRegressionTest(ServerConfigurationManager AServerConfigurationManager) { // Create a test configuration ServerConfiguration LTestConfiguration = AServerConfigurationManager.GetTestConfiguration("TestInstance"); // Reset the instance AServerConfigurationManager.ResetInstance(); // Start a server based on the StoreRegression instance Server LServer = AServerConfigurationManager.GetServer(); LServer.Start(); // Stop the server LServer.Stop(); // Start the server LServer.Start(); // Stop the server LServer.Stop(); // Reset the instance AServerConfigurationManager.ResetInstance(); }
public void FixtureSetup() { InstanceManager.Load(); FConfigurationManager = new SQLCEServerConfigurationManager(); FConfiguration = FConfigurationManager.GetTestConfiguration("TestOOPInstance"); if (InstanceManager.Instances.HasInstance("TestOOPInstance")) { InstanceManager.Instances.Remove("TestOOPInstance"); } InstanceManager.Instances.Add("TestOOPInstance", FConfiguration); InstanceManager.Save(); ProcessStartInfo LProcessStartInfo = new ProcessStartInfo(); LProcessStartInfo.FileName = Path.Combine(ServerConfigurationManager.GetInstallationDirectory(), "Dataphor\\bin\\DAEServer.exe"); LProcessStartInfo.WorkingDirectory = Path.GetDirectoryName(LProcessStartInfo.FileName); LProcessStartInfo.Arguments = "-n \"TestOOPInstance\""; LProcessStartInfo.UseShellExecute = false; LProcessStartInfo.RedirectStandardInput = true; FProcess = Process.Start(LProcessStartInfo); // TODO: This should be a wait for the process, but WaitForInputIdle only works on GUI apps //Thread.Sleep(10000); ConnectionAlias LAlias = new ConnectionAlias(); LAlias.Name = "TestOOPInstanceConnection"; LAlias.InstanceName = "TestOOPInstance"; int LRetryCount = 0; while ((FDataSession == null) && (LRetryCount++ < 3)) { Thread.Sleep(500); try { FDataSession = new DataSession(); FDataSession.Alias = LAlias; FDataSession.Open(); } catch { FDataSession = null; } } }