Esempio n. 1
0
        private CTestStandSeq genInstrListFromTest(CTest TestContainer)
        {
            CTestStandSeq SubSeq = new CTestStandSeq();
            SubSeq.identifier = TestContainer.Title;
            SubSeq.Title = TestContainer.Title;

            foreach (CStep step in TestContainer)
            {
                logger.Debug("Processing step");
                SubSeq.Add(new CTsLabel("===================================="));
                SubSeq.Add(new CTsLabel("========  " + step.title));
                SubSeq.Add(new CTsLabel("===================================="));

                if (step.DescAction.Length > 0) SubSeq.Add(new CTsLabel("= Actions : " + step.DescAction));
                logger.Debug("Processing actions.");
                foreach(CInstruction instr in step.actions)
                {
                    logger.Debug("Processing action.");
                     SubSeq.Add(CTsInstrFactory.getTsEquivFromInstr(instr));
                     logger.Debug("End of action processing.");
                }

                if (step.DescCheck.Length > 0) SubSeq.Add(new CTsLabel("= Checks : " + step.DescCheck));
                foreach (CInstruction instr in step.checks)
                {
                    logger.Debug("Processing check.");
                    SubSeq.Add(CTsInstrFactory.getTsEquivFromInstr(instr));
                    logger.Debug("End of check processing.");
                }
            }
            return SubSeq;
        }
Esempio n. 2
0
        public void GenerateAllSteps()
        {
            CTsInstrFactory.loadConfiguration("C:\\macros_alstom\\Configuration\\LocationConfiguration.xml");
                CTestContainer container = new CTestContainer();

                CTest test = new CTest("Test_1", "This is my description");

                CStep step = new CStep("Step 1", null, null);
        }
Esempio n. 3
0
        public void GenerateScenario()
        {
            CTestContainer container = new CTestContainer();
                container.description = "Test container";
                for (int testIndex = 1; testIndex <= 3; testIndex++)
                {
                    CTest test = new CTest("Test_1." + testIndex, "Test descriptor #" + testIndex);

                    for (int stepIndex = 1; stepIndex < 2; stepIndex++)
                    {
                        string title = "Step " + testIndex + "." + stepIndex;
                        CStep step = new CStep(
                            title,
                             "Action description for " + title,
                             "Check description for " + title
                            );

                        for (int actionIndex = 1; actionIndex < 10; actionIndex++)
                        {
                            CInstruction action = new CInstrForce();
                            CVariableBool var = new CVariableBool("Var" + actionIndex, "Section1/ENV", "/path/to/application" + actionIndex, "true");
                            action.data = var;
                            step.actions.Add(action);
                        }

                        for (int checkIndex = 1; checkIndex < 10; checkIndex++)
                        {
                            CInstruction action = new CInstrTest();
                            CVariableBool var = new CVariableBool("Var" + checkIndex, "Section2/ENV", "/path/to/application" + checkIndex, "true");
                            action.data = var;
                            step.checks.Add(action);
                        }
                        test.Add(step);
                    }
                    container.Add(test);
                }

                string URIFilename = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) + Path.DirectorySeparatorChar + "templates" + Path.DirectorySeparatorChar + "ST-TestStand4" + Path.DirectorySeparatorChar;
                Uri uri = new Uri(URIFilename);

                TestStandGen.TestStandGen.genSequence(container, "C:\\macros_alstom\\test\\genTest.seq", uri.LocalPath);

                Assert.IsTrue(true);
        }
Esempio n. 4
0
        private CTest parseAsTest(string title)
        {
            logger.Debug(String.Format("Extracting columns for action table."));
            Excel.ListColumns lcActionsTableColumns = loActionsTable.ListColumns;

            tableStructure = checkAndDetermineTablecolumns(lcActionsTableColumns);

            object[,] actionsValues = preloadTable(this.actionTableName);

            logger.Debug(String.Format("Extracting columns for checks table."));
            Excel.ListColumns lcChecksTableColumns = loChecksTable.ListColumns;

            object[,] checksValues = preloadTable(this.checkTableName);

            CTest parseSingleTest = new CTest(title, "Description");
            logger.Debug(String.Format("Creating Test : {0}", parseSingleTest.ToString()));

            //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            //' Writing inputs
            //'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            logger.Debug(String.Format("Found {0} Excel columns to process.", lcActionsTableColumns.Count));
            for (int CurrentColumn = tableStructure.FirstColumnIndex; CurrentColumn < lcActionsTableColumns.Count; CurrentColumn++)
            {
                logger.Info(String.Format("Processing Column {0}.", lcActionsTableColumns[CurrentColumn+1].Name));
                CStep o_step = new CStep(lcActionsTableColumns[CurrentColumn+1].Name+" : Title retrieval " + getComment(), "Action comment retrieval " + getComment(), "Checks comment retrieval " + getComment());

                logger.Debug(String.Format("Processing Actions table."));
                fillWithActions(o_step, TableTypes.TABLE_ACTIONS, loActionsTable, actionsValues, CurrentColumn);

                logger.Debug(String.Format("Processing Timer table."));
                addTempoIfExists(o_step, loActionsTable, CurrentColumn);

                logger.Debug(String.Format("Processing Checks table."));
                fillWithActions(o_step, TableTypes.TABLE_CHECKS, loChecksTable, checksValues, CurrentColumn);

                logger.Debug(String.Format("Adding step to results."));
                parseSingleTest.Add(o_step);
            }
            return parseSingleTest;
        }