use of com.dailystudio.dataobject.query.QueryToken in project devbricks by dailystudio.
the class ColumnTest method testNotNull.
public void testNotNull() {
Column column = null;
column = new IntegerColumn("intVal");
assertNotNull(column);
assertEquals(new QueryToken("intVal NOTNULL"), column.notNull());
column = new LongColumn("longVal");
assertNotNull(column);
assertEquals(new QueryToken("longVal NOTNULL"), column.notNull());
column = new DoubleColumn("doubleVal");
assertNotNull(column);
assertEquals(new QueryToken("doubleVal NOTNULL"), column.notNull());
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken("textVal NOTNULL"), column.notNull());
}
use of com.dailystudio.dataobject.query.QueryToken in project devbricks by dailystudio.
the class ColumnTest method testINOperator.
public void testINOperator() {
Column column = null;
column = new IntegerColumn("intVal");
assertNotNull(column);
assertEquals(new QueryToken("( intVal >= 1000 ) AND ( intVal <= 2000 )"), column.in(1000, 2000));
column = new LongColumn("longVal");
assertNotNull(column);
assertEquals(new QueryToken("( longVal >= 12345678987654321 ) AND ( longVal <= 987654321012345678 )"), column.in(12345678987654321l, 987654321012345678l));
column = new DoubleColumn("doubleVal");
assertNotNull(column);
assertEquals(new QueryToken("( doubleVal >= 1.4142135 ) AND ( doubleVal <= 3.141592653 )"), column.in(1.4142135, 3.141592653));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken("( textVal >= \'ABC\' ) AND ( textVal <= \'DEF\' )"), column.in("ABC", "DEF"));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken(), column.in(1000, 2000));
}
use of com.dailystudio.dataobject.query.QueryToken in project devbricks by dailystudio.
the class ColumnTest method testEQOperator.
public void testEQOperator() {
Column column = null;
column = new IntegerColumn("intVal");
assertNotNull(column);
assertEquals(new QueryToken("intVal == 1000"), column.eq(1000));
column = new LongColumn("longVal");
assertNotNull(column);
assertEquals(new QueryToken("longVal == 987654321012345678"), column.eq(987654321012345678l));
column = new DoubleColumn("doulbeVal");
assertNotNull(column);
assertEquals(new QueryToken("doulbeVal == 3.141592653"), column.eq(3.141592653));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken("textVal == \'this is \"string\" eq. 123?\'"), column.eq("this is \"string\" eq. 123?"));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken(), column.eq(1000));
}
use of com.dailystudio.dataobject.query.QueryToken in project devbricks by dailystudio.
the class ColumnTest method testLTEOperator.
public void testLTEOperator() {
Column column = null;
column = new IntegerColumn("intVal");
assertNotNull(column);
assertEquals(new QueryToken("intVal <= 1000"), column.lte(1000));
column = new LongColumn("longVal");
assertNotNull(column);
assertEquals(new QueryToken("longVal <= 987654321012345678"), column.lte(987654321012345678l));
column = new DoubleColumn("doubleVal");
assertNotNull(column);
assertEquals(new QueryToken("doubleVal <= 3.141592653"), column.lte(3.141592653));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken("textVal <= \'this is \"string\" lte. 123?\'"), column.lte("this is \"string\" lte. 123?"));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken(), column.lte(1000));
}
use of com.dailystudio.dataobject.query.QueryToken in project devbricks by dailystudio.
the class ColumnTest method testLTOperator.
public void testLTOperator() {
Column column = null;
column = new IntegerColumn("intVal");
assertNotNull(column);
assertEquals(new QueryToken("intVal < 1000"), column.lt(1000));
column = new LongColumn("longVal");
assertNotNull(column);
assertEquals(new QueryToken("longVal < 987654321012345678"), column.lt(987654321012345678l));
column = new DoubleColumn("doubleVal");
assertNotNull(column);
assertEquals(new QueryToken("doubleVal < 3.141592653"), column.lt(3.141592653));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken("textVal < \'this is \"string\" lt. 123?\'"), column.lt("this is \"string\" lt. 123?"));
column = new TextColumn("textVal");
assertNotNull(column);
assertEquals(new QueryToken(), column.lt(1000));
}
Aggregations