public void CreateAndDeleteDatabaseShouldBeSuccessfully() { var cfg = new ShellSettings(); if (!SlipstreamEnvironment.Initialized) { SlipstreamEnvironment.Initialize(cfg); } var dbName = "os-testdb"; var adminPassword = "******"; var hashedRootPassword = SlipstreamEnvironment.Settings.ServerPassword.ToSha(); var service = SlipstreamEnvironment.RootService; Assert.DoesNotThrow(() => { service.CreateDatabase(hashedRootPassword, dbName, adminPassword); }); Assert.DoesNotThrow(() => { service.DeleteDatabase(hashedRootPassword, dbName); }); }
public void TestFixtureSetup() { if (!SlipstreamEnvironment.Initialized) { SlipstreamEnvironment.Initialize(); } }
public void Init() { SlipstreamEnvironment.Initialize(); var TestingDatabaseName = ServiceTestCaseBase.TestingDatabaseName; var dbDomain = SlipstreamEnvironment.DbDomains.GetDbDomain(TestingDatabaseName); this._dataContext = dbDomain.DataProvider.OpenDataContext(TestingDatabaseName); }
public void Create_and_delete_database() { var dbName = "oo_testdb"; SlipstreamEnvironment.Initialize(); var hash = SlipstreamEnvironment.Settings.ServerPassword.ToSha(); var service = SlipstreamEnvironment.RootService; service.CreateDatabase(hash, dbName, "admin"); service.DeleteDatabase(hash, dbName); }
private static void InitializeFramework(string[] args) { Debug.Assert(!SlipstreamEnvironment.Initialized); var cfg = CreateSettingsFromProgramArgs(args); cfg.LogToConsole = true; Console.WriteLine("Initializing Slipstream framework..."); SlipstreamEnvironment.Initialize(cfg); Console.WriteLine("Slipstream framework has benn initialized."); Console.WriteLine("Log Directory=[{0}],Application Server URL=[{1}]", SlipstreamEnvironment.Settings.LogPath, SlipstreamEnvironment.Settings.RpcBusUrl); }
public static int Main(string[] args) { Console.WriteLine("ObjectServer Development Server\n"); try { var cfg = InitializeFramework(args); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnExit); using (var server = new HttpServer(cfg.HttpListenUrl)) { server.Start(WaitToQuit); Console.WriteLine("Starting to broadcast the TERMINATE command..."); Console.WriteLine("Terminating..."); } return(0); } catch (OptionException ex) { Console.WriteLine("Bad argument(s): "); Console.WriteLine(ex.Message); Console.WriteLine("Try `slipserver.exe --help' for more information."); return(-1); } catch (Exception ex) { LoggerProvider.EnvironmentLogger.ErrorException( "Unhandled Exception: " + ex.Message, ex); var oldColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Unhandled exception:\n{0}", ex.Message); Console.ForegroundColor = oldColor; return(-1); } finally { SlipstreamEnvironment.Shutdown(); } }
public void Init() { SlipstreamEnvironment.Initialize(); }
public static int Main(string[] args) { Console.WriteLine("ObjectServer Development Server\n"); try { InitializeFramework(args); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnExit); using (var server = new ServerProcess()) { var serverThreadProc = new ThreadStart(delegate { server.Run(); }); var serverThread = new Thread(serverThreadProc); serverThread.Start(); Console.WriteLine("Waiting for client requests..."); WaitToQuit(); Console.WriteLine("Starting to broadcast the TERMINATE command..."); var role = SlipstreamEnvironment.Settings.Role; if (role == ServerRoles.Standalone || role == ServerRoles.Controller) { server.BeginStopAll(); } else if (role == ServerRoles.HttpServer) { server.BeginStopHttpServer(); } else if (role == ServerRoles.Worker) { server.BeginStopRpcWorkers(); } Console.WriteLine("Terminating..."); } return(0); } catch (OptionException ex) { Console.WriteLine("Bad argument(s): "); Console.WriteLine(ex.Message); Console.WriteLine("Try `slipserver.exe --help' for more information."); return(-1); } catch (Exception ex) { LoggerProvider.EnvironmentLogger.ErrorException( "Unhandled Exception: " + ex.Message, ex); var oldColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Unhandled exception:\n{0}", ex.Message); Console.ForegroundColor = oldColor; return(-1); } finally { SlipstreamEnvironment.Shutdown(); } }