View Javadoc
1   /**
2    * Copyright 2005-2016 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.testtools.selenium;
17  
18  import org.junit.After;
19  import org.junit.Before;
20  import org.junit.Test;
21  
22  import java.net.MalformedURLException;
23  import java.util.Set;
24  
25  /**
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public class JenkinsLastCompletedBuildNumber extends JenkinsJsonJobResultsBase {
29  
30      @Before
31      public void setUp() throws MalformedURLException, InterruptedException {
32          super.setUp();
33      }
34  
35      @After
36      public void tearDown() {
37          closeAndQuitWebDriver();
38      }
39  
40      @Test
41      public void testLastCompletedBuildNumber() throws Exception {
42          String lastNumbers = "";
43          Set<String> jobs = jobsBuildsMap.keySet();
44          for (String job : jobs) {
45              try {
46                  String jobNumber = fetchLastCompletedBuildNumber(job);
47                  lastNumbers += job + ":" + jobNumber + ",";
48              } catch (Exception e) {
49                  System.err.println(job + ":" + e.getMessage());
50                  passed = false;
51              }
52          }
53          System.out.println(lastNumbers.substring(0, lastNumbers.length() - 1));
54      }
55  
56  }