@Test public void lookup_Finds_WithBetweenOperator() throws Exception { RowMeta meta = keysMeta.clone(); meta.setValueMeta( 3, new ValueMetaDate() ); meta.addValueMeta( new ValueMetaInteger() ); ReadAllCache cache = buildCache( "<>,IS NOT NULL,BETWEEN,IS NULL" ); Object[] found = cache.getRowFromCache( meta, new Object[] { -1L, null, new Date( 140 ), new Date( 160 ), null } ); assertArrayEquals( "(140 <= keys[2] <= 160) --> row 4", data[ 4 ], found ); }
@Test public void lookup_DoesNotFind_WithBetweenOperator() throws Exception { RowMeta meta = keysMeta.clone(); meta.setValueMeta( 3, new ValueMetaDate() ); meta.addValueMeta( new ValueMetaInteger() ); ReadAllCache cache = buildCache( "<>,IS NOT NULL,BETWEEN,IS NULL" ); Object[] found = cache.getRowFromCache( meta, new Object[] { -1L, null, new Date( 1000 ), new Date( 2000 ), null } ); assertNull( "(1000 <= keys[2] <= 2000) --> none", found ); }