Search in sources :

Example 1 with ReleaseIdComparator

use of org.kie.api.builder.ReleaseIdComparator in project drools by kiegroup.

the class ReleaseIdTest method testDecendingSort.

@Test
public void testDecendingSort() {
    List<ReleaseId> list = newUnsortedList();
    list.sort(new ReleaseIdComparator(DESCENDING));
    assertSame(gav7, list.get(0));
    assertSame(gav6, list.get(1));
    assertSame(gav5, list.get(2));
    assertSame(gav4, list.get(3));
    assertSame(gav3, list.get(4));
    assertSame(gav2, list.get(5));
    assertSame(gav1, list.get(6));
    assertSame(gav0, list.get(7));
}
Also used : ReleaseId(org.kie.api.builder.ReleaseId) ReleaseIdComparator(org.kie.api.builder.ReleaseIdComparator) Test(org.junit.Test)

Example 2 with ReleaseIdComparator

use of org.kie.api.builder.ReleaseIdComparator in project drools by kiegroup.

the class ReleaseIdTest method testAscendingSort.

@Test
public void testAscendingSort() {
    List<ReleaseId> list = newUnsortedList();
    list.sort(new ReleaseIdComparator(ASCENDING));
    assertSame(gav0, list.get(0));
    assertSame(gav1, list.get(1));
    assertSame(gav2, list.get(2));
    assertSame(gav3, list.get(3));
    assertSame(gav4, list.get(4));
    assertSame(gav5, list.get(5));
    assertSame(gav6, list.get(6));
    assertSame(gav7, list.get(7));
}
Also used : ReleaseId(org.kie.api.builder.ReleaseId) ReleaseIdComparator(org.kie.api.builder.ReleaseIdComparator) Test(org.junit.Test)

Example 3 with ReleaseIdComparator

use of org.kie.api.builder.ReleaseIdComparator in project drools by kiegroup.

the class ReleaseIdTest method testDefaultSort.

@Test
public void testDefaultSort() {
    List<ReleaseId> list = newUnsortedList();
    list.sort(new ReleaseIdComparator());
    assertSame(gav0, list.get(0));
    assertSame(gav1, list.get(1));
    assertSame(gav2, list.get(2));
    assertSame(gav3, list.get(3));
    assertSame(gav4, list.get(4));
    assertSame(gav5, list.get(5));
    assertSame(gav6, list.get(6));
    assertSame(gav7, list.get(7));
}
Also used : ReleaseId(org.kie.api.builder.ReleaseId) ReleaseIdComparator(org.kie.api.builder.ReleaseIdComparator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 ReleaseId (org.kie.api.builder.ReleaseId)3 ReleaseIdComparator (org.kie.api.builder.ReleaseIdComparator)3