Search in sources :

Example 6 with RangeSet

use of hudson.model.Fingerprint.RangeSet in project hudson-2.x by hudson.

the class FingerprintTest method testMerge.

public void testMerge() {
    RangeSet x = new RangeSet();
    x.add(1);
    x.add(2);
    x.add(3);
    x.add(5);
    x.add(6);
    assertEquals("[1,4),[5,7)", x.toString());
    RangeSet y = new RangeSet();
    y.add(3);
    y.add(4);
    y.add(5);
    assertEquals("[3,6)", y.toString());
    x.add(y);
    assertEquals("[1,7)", x.toString());
}
Also used : RangeSet(hudson.model.Fingerprint.RangeSet)

Example 7 with RangeSet

use of hudson.model.Fingerprint.RangeSet in project hudson-2.x by hudson.

the class FingerprintTest method testMerge3.

public void testMerge3() {
    RangeSet x = new RangeSet();
    x.add(1);
    x.add(5);
    assertEquals("[1,2),[5,6)", x.toString());
    RangeSet y = new RangeSet();
    y.add(3);
    y.add(5);
    y.add(7);
    assertEquals("[3,4),[5,6),[7,8)", y.toString());
    x.add(y);
    assertEquals("[1,2),[3,4),[5,6),[7,8)", x.toString());
}
Also used : RangeSet(hudson.model.Fingerprint.RangeSet)

Aggregations

RangeSet (hudson.model.Fingerprint.RangeSet)7 BuildPtr (hudson.model.Fingerprint.BuildPtr)2 FingerprintAction (hudson.tasks.Fingerprinter.FingerprintAction)2 SC_INTERNAL_SERVER_ERROR (javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR)1