StarTreeQueryImpl implements StarTreeQuery { @Override public DimensionKey getDimensionKey() { return dimensionKey; } StarTreeQueryImpl(StarTreeConfig config,
                           DimensionKey dimensionKey,
                           TimeRange timeRange); @Override Set<String> getStarDimensionNames(); @Override DimensionKey getDimensionKey(); @Override TimeRange getTimeRange(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEqualsNoTime() throws Exception { StarTreeQuery q1 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .build(config); StarTreeQuery q2 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .build(config); StarTreeQuery q3 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "*", "*")) .build(config); Assert.assertEquals(q1, q2); Assert.assertNotEquals(q1, q3); }
@Test public void testEqualsTimeRange() throws Exception { StarTreeQuery q1 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .setTimeRange(new TimeRange(1L, 3L)) .build(config); StarTreeQuery q2 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .setTimeRange(new TimeRange(1L, 3L)) .build(config); StarTreeQuery q3 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .build(config); StarTreeQuery q4 = new StarTreeQueryImpl.Builder() .setDimensionKey(getDimensionKey("*", "B0", "*")) .setTimeRange(new TimeRange(1L, 4L)) .build(config); Assert.assertEquals(q2, q1); Assert.assertNotEquals(q3, q1); Assert.assertNotEquals(q4, q1); }