diff options
author | James Moger <james.moger@gitblit.com> | 2016-04-04 19:32:44 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2016-04-04 19:32:44 -0400 |
commit | 2523ad5454716a9e08f0d3220a92760aa50773e2 (patch) | |
tree | 71a5404dfdaadcef114fa27ebc47b7023b371f3f /src/test | |
parent | 27979f07905dbf95b478a48babc99643d71bfdec (diff) | |
download | iciql-2523ad5454716a9e08f0d3220a92760aa50773e2.tar.gz iciql-2523ad5454716a9e08f0d3220a92760aa50773e2.zip |
Fixes #21: Order by descending on primitives
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/iciql/test/ModelsTest.java | 2 | ||||
-rw-r--r-- | src/test/java/com/iciql/test/PrimitivesTest.java | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/test/java/com/iciql/test/ModelsTest.java b/src/test/java/com/iciql/test/ModelsTest.java index a5474df..4230f4e 100644 --- a/src/test/java/com/iciql/test/ModelsTest.java +++ b/src/test/java/com/iciql/test/ModelsTest.java @@ -173,6 +173,6 @@ public class ModelsTest { .orderByDesc(SupportedTypes.SAMPLE.id) .selectDistinct(SupportedTypes.SAMPLE.id); assertEquals(10, ids.size()); - assertEquals("[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]", ids.toString()); + assertEquals("[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", ids.toString()); } } diff --git a/src/test/java/com/iciql/test/PrimitivesTest.java b/src/test/java/com/iciql/test/PrimitivesTest.java index 938fd32..6250649 100644 --- a/src/test/java/com/iciql/test/PrimitivesTest.java +++ b/src/test/java/com/iciql/test/PrimitivesTest.java @@ -106,14 +106,13 @@ public class PrimitivesTest { // insert random models in reverse order
List<PrimitivesModel> models = PrimitivesModel.getList();
- PrimitivesModel model = models.get(0);
Collections.reverse(models);
// insert them in reverse order
db.insertAll(models);
PrimitivesModel p = new PrimitivesModel();
- List<Long> list = db.from(p)/*.orderByDesc(p.myLong)*/.select(p.myLong);
+ List<Long> list = db.from(p).orderByDesc(p.myLong).select(p.myLong);
assertEquals(models.size(), list.size());
- assertEquals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]", list.toString());
+ assertEquals("[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", list.toString());
}
}
|