public void ViewGetGenericTest()
        {
            // Arrange
            JenkinsModelListView listView = null;
            JenkinsModelMyView   myView   = null;
            JenkinsModelAllView  allView  = null;
            JenkinsJenkinsciCategorizedJobsView  categorizedJobsView = null;
            JenkinsPluginsViewDashboardDashboard dashboard           = null;
            JenkinsTikalMultiJobView             multiJobView        = null;

            // Act
            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                listView            = jenkins.GetViewAsync <JenkinsModelListView>("ListView").Result;
                myView              = jenkins.GetViewAsync <JenkinsModelMyView>("MyView").Result;
                allView             = jenkins.GetViewAsync <JenkinsModelAllView>("all").Result;
                categorizedJobsView = jenkins.GetViewAsync <JenkinsJenkinsciCategorizedJobsView>("Categorization").Result;
                dashboard           = jenkins.GetViewAsync <JenkinsPluginsViewDashboardDashboard>("Dashboard").Result;
                multiJobView        = jenkins.GetViewAsync <JenkinsTikalMultiJobView>("MultiJob").Result;
            }

            // Assert
            Assert.IsNotNull(listView, nameof(listView));
            Assert.AreEqual("hudson.model.ListView", listView.Class, nameof(listView.Class));
            Assert.AreEqual("ListView", listView.Name, nameof(listView.Name));
            Assert.AreEqual("ListView Description", listView.Description, nameof(listView.Description));
            Assert.AreEqual($"{this.host}view/ListView/", listView.Url, nameof(listView.Url));

            Assert.IsNotNull(myView, nameof(myView));
            Assert.IsNotNull(allView, nameof(allView));
            Assert.IsNotNull(categorizedJobsView, nameof(categorizedJobsView));
            Assert.IsNotNull(dashboard, nameof(dashboard));
            Assert.IsNotNull(multiJobView, nameof(multiJobView));
        }
예제 #2
0
        public void ViewTest()
        {
            string           viewName = "View 2";
            JenkinsModelView view     = null;

            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                view = jenkins.GetViewAsync(viewName).Result;
            }

            Assert.IsNotNull(view);
            Assert.AreEqual(viewName, view.Name, "Name");
        }
예제 #3
0
 internal JenkinsView(Jenkins jenkins, string viewName)
 {
     this.jenkins          = jenkins;
     this.modelView        = JenkinsRun.Run(() => jenkins.GetViewAsync <JenkinsModelView>(viewName).Result);
     this.isCompleteLoaded = true;
 }
예제 #4
0
 /// <summary>
 /// Update the view data.
 /// </summary>
 public void Update()
 {
     this.modelView = JenkinsRun.Run(() => jenkins.GetViewAsync <JenkinsModelView>(this.Name).Result);
 }