Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HolodeckFixture"/> class.
        /// </summary>
        public HolodeckFixture()
        {
            if (Holodeck.HolodeckALocations == null)
            {
                throw new ConfigurationErrorsException("Holodeck A could not be found on this machine");
            }

            if (Holodeck.HolodeckBLocations == null)
            {
                throw new ConfigurationErrorsException("Holodeck B could not be found on this machine");
            }

            var service = new FileSystemService();

            service.CleanUpFiles(Holodeck.HolodeckALocations.InputPath);
            service.CleanUpFiles(Holodeck.HolodeckBLocations.InputPath);

            service.CleanUpFiles(Holodeck.HolodeckALocations.PModePath);
            service.CleanUpFiles(Holodeck.HolodeckBLocations.PModePath);

            service.CleanUpFiles(Holodeck.HolodeckALocations.OutputPath);
            service.CleanUpFiles(Holodeck.HolodeckBLocations.OutputPath);

            ////service.RemoveDirectory(Holodeck.HolodeckALocations.DbPath);
            ////service.RemoveDirectory(Holodeck.HolodeckBLocations.DbPath);

            Process holodeckA = StartHolodeck(Holodeck.HolodeckALocations.BinaryPath);
            Process holodeckB = StartHolodeck(Holodeck.HolodeckBLocations.BinaryPath);

            _parentProcess = new ParentProcess(holodeckA, holodeckB);

            // Make sure the Holodeck MSH's are started before continuing.
            System.Threading.Thread.Sleep(6000);
        }