Beispiel #1
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(
                XTestCaseNames.TestCase
                , XTestResultNames.TestResult
                ));
 }
        protected override void OnChildrenLoaded()
        {
            base.OnChildrenLoaded();

            _expResults = DataElement.Elements(XNames.ExpectedTestResult)
                          .SelectEntities <ExpectedTestResultEntity>()
                          .ToDictionary(e => e.Key); // If duplicate keys exist, an error will be thrown
        }
Beispiel #3
0
        protected override void OnChildrenLoaded()
        {
            base.OnChildrenLoaded();

            _contexts = DataElement.Elements(ContextXName)
                        .SelectEntities <TContext>()
                        .ToDictionary(ctx => ctx.Name); // If duplicate keys exist, an error will be thrown
        }
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(
                XNames.TestClass
                , XNames.Placeholder
                , XConcurrencyNames.Error
                ));
 }
 protected override IEnumerable <XElement> GetChildElements()
 {
     return(DataElement.Elements()
            .Where(el =>
                   el.Name == XSessionNames.Pluginengine ||
                   el.Name == XSessionNames.Run
                   ));
 }
Beispiel #6
0
 public MSBuildProject(XElement xel)
     : base(xel)
 {
     // Since each instance is mutable, we create the objects for the configurations right now.
     _configurations = DataElement
                       .Elements(XSessionMSBuildNames.ProjectConfiguration)
                       .Select(x => new MSBuildProjectConfiguration(x))
                       .ToArray();
 }
Beispiel #7
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     // NOTE: We purposely don't include the SessionState element
     return(DataElement.Elements(
                XNames.Testlist
                , XNames.TestProject
                , XNames.TestAssembly
                ));
 }
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     // NOTE: I'm making sure these get returned in the order in the schema
     // since I'm doing a custom union with nested elements
     return(DataElement.Elements(XConcurrencyNames.Error)
            .Union(DataElement.Elements(XChessNames.ChessResults).Elements(XChessNames.Result))
            .Union(DataElement.Elements(TestRunEntity.TestRunXNames))
            );
 }
Beispiel #9
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement
            .Elements(
                XNames.ExpectedTestResult
                , XNames.ExpectedRegressionTestResult
                , XNames.ExpectedChessResult
                , XNames.TaskoMeter
                ));
 }
Beispiel #10
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(
                XNames.CustomBuild,
                XNames.MSBuild,
                XNames.Testlist,
                XNames.TestProject,
                XNames.TestAssembly,
                XNames.Include,
                XNames.Placeholder
                ));
 }
Beispiel #11
0
        protected override IEnumerable <XElement> GetChildEntityElements()
        {
            // Start with the build runs
            IEnumerable <XElement> children;

            if (_msbuildProj == null)
            {
                children = Enumerable.Empty <XElement>();
            }
            else
            {
                children = _msbuildProj.DataElement.Elements(XSessionNames.BuildRun);
            }

            return(children
                   .Concat(DataElement
                           .Elements(
                               XNames.TestAssembly
                               , XNames.Include          // For loading the test assembly once we know what it's full location is from the project file
                               , XNames.Placeholder
                               , XConcurrencyNames.Error // Failure to load the project file
                               )));
        }
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(ChildEntityXNames));
 }
Beispiel #13
0
        public bool TryLoadProjectFile()
        {
            // Remove our previous error
            // It's not in the try-catch because any error is due to other code, not due to a loading failure.
            if (ProjectLoadError != null)
            {
                ProjectLoadError.DataElement.Remove();
            }

            XElement xmsbProj = null;
            XElement xerror   = null;

            try
            {
                xmsbProj = MSBuildProject.ParseProjectFileToXElement(SourceFilePath);
                if (xmsbProj == null)
                {
                    xerror = XNames.CreateXError("Project file could not be found.");
                }

                // Replace existing element or add it
                // Note: The element isn't an entity
                if (_msbuildProj != null)
                {
                    // We replace so the order of the child elements are preserved (i.e. if a TestAssembly el also exists)
                    Debug.Assert(_msbuildProj.DataElement.Parent == this.DataElement);

                    // move the previous runs to the new project element
                    var prevRuns = _msbuildProj.DataElement.Elements(XSessionNames.BuildRun).ToArray();
                    foreach (var prevRun in prevRuns)
                    {
                        prevRun.Remove();
                        xmsbProj.Add(prevRun);
                    }

                    //
                    _msbuildProj.DataElement.ReplaceWith(xmsbProj);
                }
                else
                {
                    DataElement.Add(xmsbProj);
                }

                // create the new one
                _msbuildProj = new MSBuildProject(xmsbProj);
            }
            catch (Exception ex)
            {
                xerror = XNames.CreateXError("An error occurred trying to parse the project file.", ex);
            }

            if (xerror != null)
            {
                // Clear out the existing extra elements if they exist
                var elementsToRemove = DataElement.Elements(XSessionMSBuildNames.Project, XNames.TestAssembly, XNames.Include);
                foreach (var xel in elementsToRemove)
                {
                    xel.Remove();
                }

                // Add the error and then eject
                this.AddEntity <ErrorEntity>(xerror);
                return(false);
            }

            // Make sure we use the correct configuration name
            if (Configuration != null && !_msbuildProj.Configurations.Any(cfg => cfg.Configuration == Configuration))
            {
                Configuration = null; // Reset to use the default configuration
            }
            else  // Call the changed event manually so we get a new ProjectConfiguration obj that's part of the new MSBuildProject instance
            {
                OnConfigurationChanged();
            }

            return(true);
        }
Beispiel #14
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(XConcurrencyNames.Error));
 }
Beispiel #15
0
 public IEnumerable <string> GetShellLines()
 {
     return(DataElement
            .Elements(XNames.Shellline)
            .SelectXValues());
 }
Beispiel #16
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     // Need to also allow the ContextXName elements too
     return(DataElement
            .Elements(ContextXName, XSessionNames.MCutTestRun));
 }
Beispiel #17
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement
            .Elements(XSessionNames.MCutTestRun));
 }
Beispiel #18
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement.Elements(XNames.ChessContext, XNames.TestMethod));
 }
Beispiel #19
0
 protected override IEnumerable <XElement> GetChildEntityElements()
 {
     return(DataElement
            .Elements(XNames.ChessContext, XNames.ExpectedChessResult)
            .Union(base.GetChildEntityElements()));
 }
Beispiel #20
0
 public IEnumerable <string> GetCommandLineArgs()
 {
     return(DataElement
            .Elements(XNames.Arg)
            .SelectXValues());
 }
 protected override IEnumerable <XElement> DescendantXRuns()
 {
     return(DataElement
            .Elements(TestEntityXNames)
            .Descendants(XSessionNames.MCutTestRun));
 }
Beispiel #22
0
 protected override IEnumerable <XElement> DescendantXRuns()
 {
     return(DataElement.Elements(XTestResultNames.TestResult)
            .Descendants(XSessionNames.MCutTestRun));
 }