001/** 002 * Copyright 2005-2015 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.testtools.selenium; 017 018import org.junit.After; 019import org.junit.Before; 020import org.junit.Test; 021 022import java.net.MalformedURLException; 023import java.util.Set; 024 025/** 026 * @author Kuali Rice Team (rice.collab@kuali.org) 027 */ 028public class JenkinsLastCompletedBuildNumber extends JenkinsJsonJobResultsBase { 029 030 @Before 031 public void setUp() throws MalformedURLException, InterruptedException { 032 super.setUp(); 033 } 034 035 @After 036 public void tearDown() { 037 closeAndQuitWebDriver(); 038 } 039 040 @Test 041 public void testLastCompletedBuildNumber() throws Exception { 042 String lastNumbers = ""; 043 Set<String> jobs = jobsBuildsMap.keySet(); 044 for (String job : jobs) { 045 try { 046 String jobNumber = fetchLastCompletedBuildNumber(job); 047 lastNumbers += job + ":" + jobNumber + ","; 048 } catch (Exception e) { 049 System.err.println(job + ":" + e.getMessage()); 050 passed = false; 051 } 052 } 053 System.out.println(lastNumbers.substring(0, lastNumbers.length() - 1)); 054 } 055 056}