public void testFilterSegments() throws Exception
{
List<LogicalSegment> segments = new TimeBoundaryQueryQueryToolChest().filterSegments(
null,
Arrays.asList(
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01/P1D");
}
},
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01T01/PT1H");
}
},
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01T02/PT1H");
}
}
)
);
Assert.assertEquals(segments.size(), 3);
List<LogicalSegment> expected = Arrays.asList(
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01/P1D");
}
},
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01T01/PT1H");
}
},
new LogicalSegment()
{
@Override
public Interval getInterval()
{
return new Interval("2013-01-01T02/PT1H");