Explorar el Código

Adjust column selection unit test

tags/release-2.0.0
James Moger hace 8 años
padre
commit
e3d0688e8c

+ 2
- 2
src/test/java/com/iciql/test/ModelsTest.java Ver fichero

@@ -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());
}

+ 4
- 3
src/test/java/com/iciql/test/models/SupportedTypes.java Ver fichero

@@ -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());

Cargando…
Cancelar
Guardar