Beispiel #1
0
        /// <summary>
        /// try to update the connection with a minimum of API calls to testlink
        /// </summary>
        /// <param name="newData"></param>
        private void updateConnectionData(TestLinkFixtureAttribute newData)
        {
            bool connectionDifferent = true;
            bool devKeyDifferent     = true;
            bool projectDifferent    = true;
            bool planDifferent       = true;
            bool testSuiteDifferent  = true;

            if (newData == null)
            {
                //log.Error("No TestLinkFixture detected");
                basicConnectionValid = false;
                projectDataValid     = false;
                connectionData       = null;
                return;
            }


            if (connectionData != null)
            {
                if (newData.Url == connectionData.Url)
                {
                    connectionDifferent = false;
                    if (newData.DevKey == connectionData.DevKey)
                    {
                        devKeyDifferent = false;
                        if (connectionData.ProjectName == newData.ProjectName)
                        {
                            projectDifferent = false;
                            if (connectionData.TestPlan == newData.TestPlan)
                            {
                                planDifferent      = false;
                                testSuiteDifferent = connectionData.TestSuite != newData.TestSuite;
                            }
                        }
                    }
                }
            }
            connectionData = newData;
            platformName   = connectionData.PlatformName;

            //attempt a new connection if url or devkey are different
            if (connectionDifferent || devKeyDifferent)
            {
                basicConnectionValid = basicConnection(newData.DevKey, newData.Url);
            }


            if (basicConnectionValid)
            {
                projectDataValid = updateData(projectDifferent, planDifferent, testSuiteDifferent);
            }
        }
        /// <summary>
        /// need to override this because we need to be able to compare them
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            TestLinkFixtureAttribute other = obj as TestLinkFixtureAttribute;

            if (other == null)
            {
                return(false);
            }
            return((other.devKey.Equals(devKey)) &&
                   (other.configFile.Equals(configFile)) &&
                   (other.projectName.Equals(projectName)) &&
                   (other.testPlan.Equals(testPlan)) &&
                   (other.testSuite.Equals(testSuite)) &&
                   (other.url.Equals(url)) &&
                   (other.userId.Equals(userId)));
        }
Beispiel #3
0
        public object Clone()
        {
            TestLinkFixtureAttribute tlfa = new TestLinkFixtureAttribute();

            tlfa.devKey      = devKey;
            tlfa.configFile  = configFile;
            tlfa.projectName = projectName;
            tlfa.testPlan    = testPlan;
            tlfa.testSuite   = testSuite;
            tlfa.url         = url;
            tlfa.buildName   = buildName;
            tlfa.enabled     = enabled;
            tlfa.userId      = userId;

            return(tlfa);
        }
        public object Clone()
        {
            TestLinkFixtureAttribute tlfa = new TestLinkFixtureAttribute();
            tlfa.devKey = devKey;
            tlfa.configFile = configFile;
            tlfa.projectName = projectName;
            tlfa.testPlan = testPlan;
            tlfa.testSuite = testSuite;
            tlfa.url = url;
            tlfa.buildName = buildName;
            tlfa.enabled = enabled;
            tlfa.userId = userId;

            return tlfa;
        }
 private void SetupProxy(TestLinkFixtureAttribute tlfa)
 {
     if (serverUrl != tlfa.Url)
     {
         serverUrl = tlfa.Url;
         proxy = new TestLink(tlfa.DevKey, tlfa.Url);
         allProjects = proxy.GetProjects();
     }
 }
 /// <summary>
 /// get the specific project and associated plans for this TestLinkFixture
 /// </summary>
 /// <param name="tlfa"></param>
 /// <returns>a valid testplanID or 0 if testplan or project was not found</returns>
 private int GetProjectAndPlans(TestLinkFixtureAttribute tlfa)
 {
     // make sure proxy is right
     SetupProxy(tlfa);
     int testPlanId = 0;
     if ((currentProject == null) || (currentProject.name != tlfa.ProjectName))
     {
         currentProject = null;
         plans = null;
         foreach (TestProject project in allProjects)
             if (project.name == tlfa.ProjectName)
             {
                 currentProject = project;
                 plans = proxy.GetProjectTestPlans(project.id);
                 break;
             }
         if (currentProject == null)
         {
             return 0;
         }
     }
     // now that currentProject and plans are up to date
     foreach (TestPlan plan in plans)
         if (plan.name == tlfa.TestPlan)
         {
             testPlanId = plan.id;
             break;
         }
     return testPlanId;
 }
        /// <summary>
        /// try to update the connection with a minimum of API calls to testlink
        /// </summary>
        /// <param name="newData"></param>
        private void updateConnectionData(TestLinkFixtureAttribute newData)
        {
            bool connectionDifferent = true;
            bool devKeyDifferent = true;
            bool projectDifferent = true;
            bool planDifferent = true;
            bool testSuiteDifferent = true;

            if (newData == null)
            {
                //log.Error("No TestLinkFixture detected");
                basicConnectionValid = false;
                projectDataValid = false;
                connectionData = null;
                return;
            }

            if (connectionData != null)
            {
                if (newData.Url == connectionData.Url)
                {
                    connectionDifferent = false;
                    if (newData.DevKey == connectionData.DevKey)
                    {
                        devKeyDifferent = false;
                        if (connectionData.ProjectName == newData.ProjectName)
                        {
                            projectDifferent = false;
                            if (connectionData.TestPlan == newData.TestPlan)
                            {
                                planDifferent = false;
                                testSuiteDifferent = connectionData.TestSuite != newData.TestSuite;

                            }
                        }
                    }
                }
            }
            connectionData = newData;
            platformName = connectionData.PlatformName;

            //attempt a new connection if url or devkey are different
            if (connectionDifferent || devKeyDifferent)
            {
                basicConnectionValid = basicConnection(newData.DevKey, newData.Url);
            }

            if (basicConnectionValid)
                projectDataValid = updateData(projectDifferent, planDifferent, testSuiteDifferent);
        }