Example #1
0
        public void LoadInfrastructure(InfrastructureLookup pLookup)
        {
            if (pLookup == null)
            {
                return;
            }

            if (!InfrastructureLookup.ValidateCode(pLookup.Code))
            {
                return;
            }

            ICollection <DbParameter> parameters = new List <DbParameter>
            {
                new OracleParameter(ITICDbTable.INFRASTRUCTURE_CODE_COLUMN, OracleType.VarChar)
                {
                    Value = pLookup.Code
                }
            };

            using (IDataReader reader = DbHelper.ExecuteReader(_transaction, _query.SelectInfrastructureByCode, parameters))
            {
                if (reader.Read())
                {
                    pLookup.Name     = DbHelper.GetString(reader, ITICDbTable.INFRASTRUCTURE_NAME_COLUMN);
                    pLookup.IsLoaded = true;
                }
            }
        }
Example #2
0
        private InfrastructureLookup LoadInfrastructure(object pHelper)
        {
            HierarchyParallelContext helper = pHelper as HierarchyParallelContext;

            if (helper == null)
            {
                return(null);
            }

            InfrastructureLookup result = helper.Hierarchy.GenerateInfrastructure(
                DbHelper.GetString(helper.Reader, ITICDbTable.INFRASTRUCTURE_CODE_COLUMN),
                DbHelper.GetString(helper.Reader, ITICDbTable.INFRASTRUCTURE_NAME_COLUMN));

            result.IsLoaded = true;
            return(result);
        }
        public void LoadInfrastructure_Test()
        {
            const string CODE = "DCM";
            const string NAME = "DCMS";

            InfrastructureLookup lookup = new InfrastructureLookup(CODE, null);

            using (DataTransactionBase dt = new OracleDataTransaction(Configuration.ITICConnectionString))
            {
                ITICGateway gateway = new ITICGateway(dt.Transaction);
                gateway.LoadInfrastructure(lookup);
            }

            Assert.IsNotNull(lookup);
            Assert.AreEqual(CODE, lookup.Code);
            Assert.AreEqual(NAME, lookup.Name);
            Assert.IsTrue(lookup.IsLoaded);
            Assert.IsFalse(lookup.IsDefault);
        }
        private Domain.Profile CreateTestProfile()
        {
            Domain.Profile result = new Domain.Profile();
            result.ProvisioningPlans = new List <ProvisioningPlan>
            {
                new ProvisioningPlan()
            };
            result.ActiveProvisioningPlan = result.ProvisioningPlans[0];

            // ITIC
            InfrastructureLookup     inf = new InfrastructureLookup("III", "Test Infrastructure");
            CapabilityLookup         cap = new CapabilityLookup("SSS", "Test Capability");
            LogicalSystemGroupLookup lsg = new LogicalSystemGroupLookup("LSG8", "Test LSG");

            result.ITICCode = new ITIC(inf, cap, lsg);

            // Platform Stack
            FilterLookup mjf = new FilterLookup("MjF");
            FilterLookup mnf = new FilterLookup("MiF");
            StackLookup  ps  = new StackLookup("WIN_x86_2008R_64_2.7.0_GREEN_SK", "Test Windows 2008 64bit Build 2.7.0", "Test descr");

            result.ActiveProvisioningPlan.PlatformStack = new PlatformStack(mjf, mnf, new FilterLookup("64bit"), new FilterLookup("2.7.0"), ps);

            // Application Stacks
            mjf = new FilterLookup("MjF2");
            mnf = new FilterLookup("MiF2");
            ps  = new StackLookup("TEST_APP_STACK", "Test 2", "Test descr 2");
            result.ActiveProvisioningPlan.ApplicationStacks.Add(new Stack(mjf, mnf, ps));
            mjf = new FilterLookup("MjF3");
            mnf = new FilterLookup("MiF3");
            ps  = new StackLookup("TEST_APP_STACK_3", "Test 3", "Test descr 3");
            result.ActiveProvisioningPlan.ApplicationStacks.Add(new Stack(mjf, mnf, ps));

            // Provisioning Plan Extras
            PlanActionLookup p = new PlanActionLookup()
            {
                Code = "CODE1", Name = "NAME1", Description = "DESc1", IsSelected = true
            };

            result.ActiveProvisioningPlan.InitialWorkflows.Add(p);
            p = new PlanActionLookup()
            {
                Code = "CODE2", Name = "NAME2", Description = "DESc2", IsSelected = true
            };
            result.ActiveProvisioningPlan.CommonPlanActions.Add(p);
            p = new PlanActionLookup()
            {
                Code = "CODE3", Name = "NAME3", Description = "DESc3", IsSelected = true
            };
            result.ActiveProvisioningPlan.FinalWorkflows.Add(p);

            // Post Configuration Actions
            PlanActionLookup pca = new PlanActionLookup()
            {
                Code = "PCA1", Name = "PCA1_NAME1", Description = "PCA1_DESc1", IsSelected = true, IsTextBox = true, DefaultValue = "TEST VALUE"
            };

            result.ActiveProvisioningPlan.AdvancedConfigurationActions.Add(pca);

            return(result);
        }