Exemple #1
0
        public void FullInstallTest()
        {
            // Change context connection string to test
            ContextManager.Instance.ConnectionString = Jhu.Graywulf.Test.AppSettings.RegistryTestConnectionString;

            var dbi = new DBInstaller();

            dbi.DropDatabase(true);

            dbi.CreateDatabase();

            dbi.CreateSchema();

            using (var context = ContextManager.Instance.CreateContext(ConnectionMode.AutoOpen, TransactionMode.AutoCommit))
            {
                // Create a cluster
                var ci = new ClusterInstaller(context);
                var cluster = ci.Install();

                // Create a federation
                var fi = new FederationInstaller(cluster);
                var federation = fi.Install();
            }

            //dbi.DropDatabase(true);
        }
Exemple #2
0
        public override void Run()
        {
            base.Run();

            Console.Write("Creating cluster... ");

            using (Context context = ContextManager.Instance.CreateContext(ConnectionMode.AutoOpen, TransactionMode.ManualCommit))
            {
                try
                {
                    var i = new ClusterInstaller(context);

                    i.Install(true, clusterName, adminUsername, adminEmail, adminPassword);

                    context.CommitTransaction();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Importing xml file failed.");
                    Console.WriteLine(ex.Message);

                    context.RollbackTransaction();
                }
            }

            Console.WriteLine("done.");
        }
Exemple #3
0
        public override void Run()
        {
            base.Run();

            Console.Write("Creating admin user... ");

            using (Context context = ContextManager.Instance.CreateContext(ConnectionMode.AutoOpen, TransactionMode.AutoCommit))
            {
                try
                {
                    var f = new EntityFactory(context);
                    var c = f.LoadEntity<Cluster>(clusterName);

                    var ci = new ClusterInstaller(c);
                    ci.GenerateAdmin(false, adminUsername, adminEmail, adminPassword);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("failed.");
                    Console.WriteLine(ex.Message);

                    context.RollbackTransaction();
                }
            }

            Console.WriteLine("done.");
        }
Exemple #4
0
        public override void Run()
        {
            Console.Write("Creating cluster... ");

            using (Context context = ContextManager.Instance.CreateContext(ConnectionMode.AutoOpen, TransactionMode.ManualCommit))
            {
                var i = new ClusterInstaller(context);

                i.Install(true, clusterName, adminUsername, adminEmail, adminPassword);

                context.CommitTransaction();
            }

            Console.WriteLine("done.");
        }