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));
}
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));
}
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));
}
Aggregations