clarencen/lshift — Issue #249: Constrained date range gets widened
Author: clarencen
Created: 2011-11-14 22:42:15+00:00
State: open

Consider the following test:

@@@
@Test
def dateRangeShouldNotWiden = {
val dateConstraint = DateRangeConstraint("bizDate", new LocalDate(2011,04,01), new LocalDate(2011,04,29))
val bucketing = Map("bizDate" -> YearlyCategoryFunction)

val remote = ArrayBuffer(AggregateDigest(Buffer("2011"),"2abbcf10cf9ae11c53191eaf8b121104"))
val local = List(AggregateDigest(List("2011"),"ae15bc55642738b49b0bad51c420e33b"))
val actions = DigestDifferencingUtils.differenceAggregates(remote,local,bucketing, Seq(dateConstraint))

assertEquals(1, actions.length)

val queryAction = actions(0).asInstanceOf[AggregateQueryAction]

assertEquals(1, queryAction.constraints.length)
assertEquals(dateConstraint, queryAction.constraints(0))

}
@@@

Currently this test fails...