/**
         * CreateTestSet will create or modify and existing Test Set folder structure to conform
         * with the structure specified in the resource file called "folder_structure.xml"
         * A TestProgramSet object instance will be returned for the name specified.
         */
        public static TestProgramSet CreateTestSet( String testSetName )
        {
            Stream stream =
                ProjectManager.Instance.GetType().Assembly.GetManifestResourceStream( Resources.FileStructure );
            if (stream == null)
                throw new Exception( "Failed to load the File Structure resources." );
            var reader = new XmlTextReader( stream );
            var document = new XmlDocument();
            document.Load( reader );
            XmlElement root = document.DocumentElement;

            string testSetPath = GetTestSetPath();
            testSetName = CleanTestSetName( testSetName );

            String rootPathName = Path.Combine( testSetPath, testSetName );
            var testSet = new TestProgramSet();
            testSet._testSetName = testSetName;
            if (!Directory.Exists( rootPathName ))
                testSet._testSetDirectory = Directory.CreateDirectory( rootPathName );
            else
                testSet._testSetDirectory = new DirectoryInfo( rootPathName );

            ProcessFolderNode( root, rootPathName );
            return testSet;
        }
Exemple #2
0
        /**
         * CreateTestSet will create or modify and existing Test Set folder structure to conform
         * with the structure specified in the resource file called "folder_structure.xml"
         * A TestProgramSet object instance will be returned for the name specified.
         */

        public static TestProgramSet CreateTestSet(String testSetName)
        {
            Stream stream =
                ProjectManager.Instance.GetType().Assembly.GetManifestResourceStream(Resources.FileStructure);

            if (stream == null)
            {
                throw new Exception("Failed to load the File Structure resources.");
            }
            var reader   = new XmlTextReader(stream);
            var document = new XmlDocument();

            document.Load(reader);
            XmlElement root = document.DocumentElement;

            string testSetPath = GetTestSetPath();

            testSetName = CleanTestSetName(testSetName);

            String rootPathName = Path.Combine(testSetPath, testSetName);
            var    testSet      = new TestProgramSet();

            testSet._testSetName = testSetName;
            if (!Directory.Exists(rootPathName))
            {
                testSet._testSetDirectory = Directory.CreateDirectory(rootPathName);
            }
            else
            {
                testSet._testSetDirectory = new DirectoryInfo(rootPathName);
            }

            ProcessFolderNode(root, rootPathName);
            return(testSet);
        }
Exemple #3
0
        public static TestProgramSet OpenTestSet(String testSetName)
        {
            string testSetPath = GetTestSetPath();

            testSetName = CleanTestSetName(testSetName);
            string         fullPath = Path.Combine(testSetPath, testSetName);
            TestProgramSet testSet  = CreateTestSet(testSetName);  //new TestProgramSet();

            testSet._testSetDirectory = new DirectoryInfo(fullPath);
            testSet._testSetName      = testSetName;
            return(testSet);
        }
Exemple #4
0
        public static bool SelectTestSet(out TestProgramSet testSet)
        {
            testSet = null;
            string testSetPath = GetTestSetPath();
            //FileManager.OpenFolder(out testSetPath);
            var form = new DirectorySelectionForm(testSetPath);

            form.Text = @"Select Test Program Set Project";
            if (DialogResult.OK == form.ShowDialog())
            {
                using (new HourGlass())
                {
                    string testSetName = form.SelectedFolder;
                    testSet = OpenTestSet(testSetName);
                }
            }
            return(testSet != null);
        }
 private static void SaveProjectInfo( ProjectInfo projectInfo, TestProgramSet currentTestProgramSet )
 {
     FileManager.WriteFile( currentTestProgramSet.TestSetDirectory.FullName + @"\project-info.xml",
                            Encoding.UTF8.GetBytes( projectInfo.Serialize() ) );
 }
 public void Close()
 {
     if (CurrentTestProgramSet != null)
     {
         OnProjectClosing();
         FormManager.CloseAllForms();
         string name = CurrentTestProgramSet.TestSetName;
         CurrentTestProgramSet.Close();
         CurrentTestProgramSet = null;
         OnProjectClosed();
         LogManager.Trace( "Project \"{0}\" has been closed", name );
     }
 }
 public static bool SelectTestSet( out TestProgramSet testSet )
 {
     testSet = null;
     string testSetPath = GetTestSetPath();
     //FileManager.OpenFolder(out testSetPath);
     var form = new DirectorySelectionForm( testSetPath );
     form.Text = @"Select Test Program Set Project";
     if (DialogResult.OK == form.ShowDialog())
     {
         using (new HourGlass())
         {
             string testSetName = form.SelectedFolder;
             testSet = OpenTestSet( testSetName );
         }
     }
     return testSet != null;
 }