]> source.dussan.org Git - iciql.git/commitdiff
Adjust column selection unit test
authorJames Moger <james.moger@gitblit.com>
Tue, 5 Apr 2016 00:48:59 +0000 (20:48 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 5 Apr 2016 00:48:59 +0000 (20:48 -0400)
src/test/java/com/iciql/test/ModelsTest.java
src/test/java/com/iciql/test/models/SupportedTypes.java

index 4230f4e843de7ecaf987e4bd32315aae4c4758c2..0b43c570d1f3cea7a243a08801f2f75efc4e7df3 100644 (file)
@@ -170,8 +170,8 @@ public class ModelsTest {
                assertEquals(10, myStrings.size());
 
                List<Integer> ids = db.from(SupportedTypes.SAMPLE)
-                               .orderByDesc(SupportedTypes.SAMPLE.id)
-                               .selectDistinct(SupportedTypes.SAMPLE.id);
+                               .orderByDesc(SupportedTypes.SAMPLE.myInteger)
+                               .selectDistinct(SupportedTypes.SAMPLE.myInteger);
                assertEquals(10, ids.size());
                assertEquals("[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]", ids.toString());
        }
index 3b0e694e0112c288e3d294b4fe0161d85f85c7c3..e04a3abc060d96ae166876549017635b9ae959de 100644 (file)
@@ -74,7 +74,7 @@ public class SupportedTypes implements Serializable {
        private Short myShort;
 
        @IQColumn
-       private Integer myInteger;
+       public Integer myInteger;
 
        @IQColumn
        private Long myLong;
@@ -138,7 +138,9 @@ public class SupportedTypes implements Serializable {
 
                long oneday = 24 * 60 * 60 * 1000L;
                for (int i = 0; i < 10; i++) {
-                       list.add(randomValue(now - (i * oneday)));
+                       SupportedTypes s = randomValue(now - (i * oneday));
+                       s.myInteger = i + 1;
+                       list.add(s);
                }
                return list;
        }
@@ -149,7 +151,6 @@ public class SupportedTypes implements Serializable {
                s.myBool = new Boolean(rand.nextBoolean());
                s.myByte = new Byte((byte) rand.nextInt(Byte.MAX_VALUE));
                s.myShort = new Short((short) rand.nextInt(Short.MAX_VALUE));
-               s.myInteger = new Integer(rand.nextInt());
                s.myLong = new Long(rand.nextLong());
                s.myFloat = new Float(rand.nextFloat());
                s.myDouble = new Double(rand.nextDouble());