Skip to content

Commit

Permalink
[JENKINS-26690] Noting merge of #1586.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Feb 27, 2015
2 parents a452023 + db1f805 commit dac7dfe
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Errors in Dashboard View plugin since 1.597.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-26690">issue 26690</a>)
<li class="rfe">
Map Queue.Item.id onto Run
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-27096">issue 27096</a>)
Expand Down
Expand Up @@ -550,7 +550,7 @@ public boolean equals(Object o) {

private static final Comparator<Integer> COMPARATOR = new Comparator<Integer>() {
@Override public int compare(Integer o1, Integer o2) {
return o2 - o1;
return -o1.compareTo(o2);
}
};

Expand Down
Expand Up @@ -40,7 +40,6 @@
import java.util.logging.Level;
import org.junit.BeforeClass;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.Issue;

/**
* @author Kohsuke Kawaguchi
Expand Down Expand Up @@ -133,6 +132,21 @@ public void firstKey() {
}
}

@Issue("JENKINS-26690")
@Test public void headMap() {
assertEquals("[]", a.headMap(Integer.MAX_VALUE).keySet().toString());
assertEquals("[]", a.headMap(6).keySet().toString());
assertEquals("[]", a.headMap(5).keySet().toString());
assertEquals("[5]", a.headMap(4).keySet().toString());
assertEquals("[5]", a.headMap(3).keySet().toString());
assertEquals("[5, 3]", a.headMap(2).keySet().toString());
assertEquals("[5, 3]", a.headMap(1).keySet().toString());
assertEquals("[5, 3, 1]", a.headMap(0).keySet().toString());
assertEquals("[5, 3, 1]", a.headMap(-1).keySet().toString());
assertEquals("[5, 3, 1]", a.headMap(-2).keySet().toString()); // this failed
assertEquals("[5, 3, 1]", a.headMap(Integer.MIN_VALUE).keySet().toString());
}

@Test
public void lastKey() {
assertEquals(1, a.lastKey().intValue());
Expand Down

0 comments on commit dac7dfe

Please sign in to comment.