Skip to content

Commit

Permalink
[JENKINS-32651] Bump core dependency to 1.509 + fix tests
Browse files Browse the repository at this point in the history
This is required to build against JDK 7/8
  • Loading branch information
ydubreuil committed Jan 27, 2016
1 parent 3b10254 commit e13d28d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .gitignore
@@ -0,0 +1,13 @@
/*.iml
/.idea

### Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.399</version><!-- which version of Jenkins is this plugin built against? -->
<version>1.509</version><!-- which version of Jenkins is this plugin built against? -->
</parent>

<artifactId>build-metrics</artifactId>
Expand Down
Expand Up @@ -17,10 +17,10 @@ public void testFailureRate(){
jbsr.add(createJobResult("build job 1", true));
jbsr.add(createJobResult("build job 1", false));
StatsFactory sf = StatsFactory.generateStats(jbsr);
assertEquals("StatsFactory.failureRate", 50.00, sf.getFailureRate());
assertEquals("StatsFactory.failureRate", 50.00, sf.getFailureRate(), 0);

for(StatsModel stat: sf.getStats()){
assertEquals("StatsModel.failureRate", 50.00, stat.getFailureRate());
assertEquals("StatsModel.failureRate", 50.00, stat.getFailureRate(), 0);
}
}

Expand Down
Expand Up @@ -7,16 +7,16 @@ public class StatsMathTest {
@Test
public void testRoundTwoDecimals(){
double d1 = 1.2345;
assertEquals(d1 + " rounded to two decimal places", 1.23, StatsMath.roundTwoDecimals(d1));
assertEquals(d1 + " rounded to two decimal places", 1.23, StatsMath.roundTwoDecimals(d1), 0);
}

@Test
public void testPercent(){
double subVal = 2;
double totalVal = 3;
assertEquals("zero total", 0.00, StatsMath.getPercent(subVal, 0));
assertEquals("2/3", 66.67, StatsMath.getPercent(subVal, totalVal));
assertEquals("1/1", 100.00, StatsMath.getPercent(1, 1));
assertEquals("3/2", 150.00, StatsMath.getPercent(3, 2));
assertEquals("zero total", 0.00, StatsMath.getPercent(subVal, 0), 0);
assertEquals("2/3", 66.67, StatsMath.getPercent(subVal, totalVal), 0);
assertEquals("1/1", 100.00, StatsMath.getPercent(1, 1), 0);
assertEquals("3/2", 150.00, StatsMath.getPercent(3, 2), 0);
}
}

0 comments on commit e13d28d

Please sign in to comment.