From 6dfa14082d68a154c7ce7753cd5d57924d4b382a Mon Sep 17 00:00:00 2001 From: Zellweger Christof Ralf Date: Wed, 1 Jul 2015 16:51:22 +0200 Subject: [PATCH] ATEST-81: - tracking down bugs and trying to fix --- .../java/ch/psi/daq/rest/RestApplication.java | 5 - .../ch/psi/daq/rest/config/RestConfig.java | 18 +- .../rest/controller/DaqRestController.java | 6 +- .../psi/daq/rest/queries/AbstractQuery.java | 194 ------------------ .../daq/rest/queries/BinningStrategyEnum.java | 16 -- .../psi/daq/rest/queries/PulseRangeQuery.java | 71 ------- .../psi/daq/rest/queries/TimeRangeQuery.java | 97 --------- .../rest/response/ResponseStreamWriter.java | 6 +- .../controller/DaqRestControllerTest.java | 18 +- .../rest/queries/AbstractQueryTestTest.java | 10 +- .../test/rest/queries/TimeRangeQueryTest.java | 14 +- .../test/rest/query/DummyQueryProcessor.java | 6 +- 12 files changed, 40 insertions(+), 421 deletions(-) delete mode 100644 src/main/java/ch/psi/daq/rest/queries/AbstractQuery.java delete mode 100644 src/main/java/ch/psi/daq/rest/queries/BinningStrategyEnum.java delete mode 100644 src/main/java/ch/psi/daq/rest/queries/PulseRangeQuery.java delete mode 100644 src/main/java/ch/psi/daq/rest/queries/TimeRangeQuery.java diff --git a/src/main/java/ch/psi/daq/rest/RestApplication.java b/src/main/java/ch/psi/daq/rest/RestApplication.java index 172290e..f61fce4 100644 --- a/src/main/java/ch/psi/daq/rest/RestApplication.java +++ b/src/main/java/ch/psi/daq/rest/RestApplication.java @@ -4,17 +4,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; -import org.springframework.context.annotation.Import; - -import ch.psi.daq.hazelcast.config.HazelcastClientConfig; -import ch.psi.daq.hazelcast.config.HazelcastConfig; /** * Entry point to our rest-frontend of the data acquisition (DAQ) application which most importantly * wires all the @RestController annotated classes. */ @SpringBootApplication -@Import({HazelcastConfig.class, HazelcastClientConfig.class}) public class RestApplication extends SpringBootServletInitializer { diff --git a/src/main/java/ch/psi/daq/rest/config/RestConfig.java b/src/main/java/ch/psi/daq/rest/config/RestConfig.java index caba027..9aa21b3 100644 --- a/src/main/java/ch/psi/daq/rest/config/RestConfig.java +++ b/src/main/java/ch/psi/daq/rest/config/RestConfig.java @@ -13,31 +13,33 @@ import com.fasterxml.jackson.databind.ObjectMapper; import ch.psi.daq.common.statistic.StorelessStatistics; import ch.psi.daq.domain.cassandra.ChannelEvent; +import ch.psi.daq.hazelcast.config.HazelcastClientConfig; import ch.psi.daq.hazelcast.config.HazelcastConfig; import ch.psi.daq.rest.model.PropertyFilterMixin; import ch.psi.daq.rest.response.ResponseStreamWriter; @Configuration -@PropertySource(value = { "classpath:rest.properties" }) -@PropertySource(value = { "file:${user.home}/.config/daq/rest.properties" }, ignoreResourceNotFound = true) +@PropertySource(value = {"classpath:rest.properties"}) +@PropertySource(value = {"file:${user.home}/.config/daq/rest.properties"}, ignoreResourceNotFound = true) public class RestConfig { @Autowired private Environment env; - + // a nested configuration // this guarantees that the ordering of the properties file is as expected // see: // https://jira.spring.io/browse/SPR-10409?focusedCommentId=101393&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-101393 - @Configuration - @Import({HazelcastConfig.class}) - static class InnerConfiguration { } - + @Configuration + @Import({HazelcastConfig.class, HazelcastClientConfig.class}) + static class InnerConfiguration { + } + @Bean public JsonFactory jsonFactory() { return new JsonFactory(); } - + @Bean public ResponseStreamWriter responseStreamWriter() { return new ResponseStreamWriter(); diff --git a/src/main/java/ch/psi/daq/rest/controller/DaqRestController.java b/src/main/java/ch/psi/daq/rest/controller/DaqRestController.java index 22c6ee5..8b537e8 100644 --- a/src/main/java/ch/psi/daq/rest/controller/DaqRestController.java +++ b/src/main/java/ch/psi/daq/rest/controller/DaqRestController.java @@ -26,10 +26,10 @@ import ch.psi.daq.cassandra.writer.CassandraWriter; import ch.psi.daq.domain.DataType; import ch.psi.daq.domain.cassandra.ChannelEvent; import ch.psi.daq.domain.cassandra.DataEvent; +import ch.psi.daq.hazelcast.query.AbstractQuery; +import ch.psi.daq.hazelcast.query.PulseRangeQuery; +import ch.psi.daq.hazelcast.query.TimeRangeQuery; import ch.psi.daq.hazelcast.query.processor.QueryProcessor; -import ch.psi.daq.rest.queries.AbstractQuery; -import ch.psi.daq.rest.queries.PulseRangeQuery; -import ch.psi.daq.rest.queries.TimeRangeQuery; import ch.psi.daq.rest.response.ResponseStreamWriter; @RestController diff --git a/src/main/java/ch/psi/daq/rest/queries/AbstractQuery.java b/src/main/java/ch/psi/daq/rest/queries/AbstractQuery.java deleted file mode 100644 index 8f58c6d..0000000 --- a/src/main/java/ch/psi/daq/rest/queries/AbstractQuery.java +++ /dev/null @@ -1,194 +0,0 @@ -package ch.psi.daq.rest.queries; - -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.List; - -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.util.Assert; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - -import ch.psi.daq.cassandra.reader.Ordering; -import ch.psi.daq.hazelcast.query.Aggregation; -import ch.psi.daq.hazelcast.query.AggregationType; -import ch.psi.daq.hazelcast.query.Query; -import ch.psi.daq.hazelcast.query.bin.BinningStrategy; -import ch.psi.daq.hazelcast.query.bin.BinningStrategyFactory; -import ch.psi.daq.hazelcast.query.range.QueryRange; - -/** - * - * @author zellweger_c - * - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "queryType") -@JsonSubTypes( -{ - @Type(value = PulseRangeQuery.class, name = "pulserange"), - @Type(value = TimeRangeQuery.class, name = "timerange"), -}) -public abstract class AbstractQuery implements Query { - - private static final long serialVersionUID = 1L; - - private static Logger logger = LoggerFactory.getLogger(AbstractQuery.class); - - private List channels; - - private LinkedHashSet fields; - - private List aggregations; - - private AggregationType aggregationType; - - private boolean aggregateChannels; - - private Ordering ordering; - - private BinningStrategy binningStrategy; - - private BinningStrategyEnum binningStrategyEnum; - - private QueryRange queryRange; - - /** - * Constructor. - * - * @param ordering whether to add a 'orderBy' clause into the database query - * @param channels all the channelIds (channel names) we want to query - * @param fields the fields (who map to fields in the DB) we are interested in returning to the - * client, needs to be in insertion order (hence the {@link LinkedHashSet} type) - * @param binningStrategyEnum enum that maps the user's String to a concrete - * {@link BinningStrategy} implementation - * @param binLengthOrCount depending on the chosen binning strategy, this field defines either the - * count (how many pulse ids are to be put inside 1 bin) or the time frame for 1 bin - * @param aggregateChannels whether aggregation will include all channels, default is on a - * per-channel basis - * @param aggregationType defines whether aggregation takes place in an index- or value-based - * manner - * @param aggregations list of aggregations / statistics to calculate, e.g. min, max and average - * @param queryRange object containing the ranges for either pulse-based queries or time-based - * queries - */ - @JsonCreator - public AbstractQuery( - // note that those annotations are needed for the polymorphic - // mapping to work correctly - @JsonProperty(value = "ordering") Ordering ordering, - @JsonProperty(value = "channels") List channels, - @JsonProperty(value = "fields") LinkedHashSet fields, - @JsonProperty(value = "binningStrategy") BinningStrategyEnum binningStrategyEnum, - @JsonProperty(value = "binDuration") long binLengthOrCount, - @JsonProperty(value = "aggregateChannels") boolean aggregateChannels, - @JsonProperty(value = "aggregationType") AggregationType aggregationType, - @JsonProperty(value = "aggregations") List aggregations, - @JsonProperty(value = "queryRange") QueryRange queryRange) { - - this.ordering = ordering; - this.aggregateChannels = aggregateChannels; - this.aggregationType = aggregationType; - this.aggregations = aggregations; - this.queryRange = queryRange; - - Assert.notNull(channels, "channel name must not be null."); - Assert.notNull(fields, "field, i.e. property, names must not be null."); - - this.channels = channels; - this.fields = fields; - - this.binningStrategyEnum = binningStrategyEnum; // can be null: default then will be - // BinCountBinningStrategy - - - if (binningStrategyEnum != null) { - switch (binningStrategyEnum) { - case count: - this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binLengthOrCount); - break; - case length: - this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), binLengthOrCount); - break; - default: - logger.warn("No binning strategy has been set. Selecting BinningStrategyBinCount."); - this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binLengthOrCount); - } - } else { - this.binningStrategy = BinningStrategyFactory.getBinningStrategy(getQueryRange(), (int) binLengthOrCount); - } - } - - /** - * {@inheritDoc} - */ - @Override - public List getChannels() { - return Collections.unmodifiableList(channels); - } - - /** - * {@inheritDoc} - */ - @Override - public Ordering getOrdering() { - return ordering; - } - - /** - * {@inheritDoc} - */ - @Override - public AggregationType getAggregationType() { - return aggregationType; - } - - - @Override - public boolean isAggregateChannels() { - return aggregateChannels; - } - - public BinningStrategyEnum getBinningStrategyEnum() { - return binningStrategyEnum; - } - - @Override - public BinningStrategy getBinningStrategy() { - return binningStrategy; - } - - public LinkedHashSet getFields() { - return fields; - } - - public List getAggregations() { - return aggregations; - } - - /** - * {@inheritDoc} - */ - @Override - public QueryRange getQueryRange() { - return queryRange; - } - - public void setQueryRange(QueryRange queryRange) { - this.queryRange = queryRange; - } - - @Override - public String toString() { - return ReflectionToStringBuilder.reflectionToString(this); - } - -} diff --git a/src/main/java/ch/psi/daq/rest/queries/BinningStrategyEnum.java b/src/main/java/ch/psi/daq/rest/queries/BinningStrategyEnum.java deleted file mode 100644 index 08fcd45..0000000 --- a/src/main/java/ch/psi/daq/rest/queries/BinningStrategyEnum.java +++ /dev/null @@ -1,16 +0,0 @@ -package ch.psi.daq.rest.queries; - -import ch.psi.daq.hazelcast.query.bin.BinningStrategy; - -/** - * Defines the strategies that map to the similarly named {@link BinningStrategy} implementations. - *

- * This enum is used for type-safety and simplicity for the rest interface. - * - */ -public enum BinningStrategyEnum { - - length, - - count -} diff --git a/src/main/java/ch/psi/daq/rest/queries/PulseRangeQuery.java b/src/main/java/ch/psi/daq/rest/queries/PulseRangeQuery.java deleted file mode 100644 index 87b5378..0000000 --- a/src/main/java/ch/psi/daq/rest/queries/PulseRangeQuery.java +++ /dev/null @@ -1,71 +0,0 @@ -package ch.psi.daq.rest.queries; - -import java.util.LinkedHashSet; -import java.util.List; - -import org.apache.commons.lang3.builder.ToStringBuilder; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -import ch.psi.daq.cassandra.reader.Ordering; -import ch.psi.daq.hazelcast.query.Aggregation; -import ch.psi.daq.hazelcast.query.AggregationType; -import ch.psi.daq.hazelcast.query.bin.BinningStrategy; -import ch.psi.daq.hazelcast.query.range.QueryRange; - -/** - * - */ -public class PulseRangeQuery extends AbstractQuery { - - - private static final long serialVersionUID = 1L; - - /** - * Constructor. - * - * @param ordering whether to add a 'orderBy' clause into the database query - * @param channels all the channelIds (channel names) we want to query - * @param fields the fields (who map to fields in the DB) we are interested in returning to the - * client, needs to be in insertion order (hence the {@link LinkedHashSet} type) - * @param binningStrategyEnum enum that maps the user's String to a concrete - * {@link BinningStrategy} implementation - * @param binLengthOrCount depending on the chosen binning strategy, this field defines either the - * count (how many pulse ids are to be put inside 1 bin) or the time frame for 1 bin - * @param aggregateChannels whether aggregation will include all channels, default is on a - * per-channel basis - * @param aggregationType defines whether aggregation takes place in an index- or value-based - * manner - * @param aggregations list of aggregations / statistics to calculate, e.g. min, max and average - * @param queryRange object containing the ranges for either pulse-based queries or time-based - * queries - */ - @JsonCreator - public PulseRangeQuery( - // note that those annotations are needed for the polymorphic - // mapping to work correctly - @JsonProperty(value = "ordering") Ordering ordering, - @JsonProperty(value = "channels") List channels, - @JsonProperty(value = "fields") LinkedHashSet fields, - @JsonProperty(value = "binningStrategy") BinningStrategyEnum binningStrategyEnum, - @JsonProperty(value = "binDuration") long binLengthOrCount, - @JsonProperty(value = "aggregateChannels") boolean aggregateChannels, - @JsonProperty(value = "aggregationType") AggregationType aggregationType, - @JsonProperty(value = "aggregations") List aggregations, - @JsonProperty(value = "queryRange") QueryRange queryRange) { - - super(ordering, channels, fields, binningStrategyEnum, binLengthOrCount, aggregateChannels, aggregationType, - aggregations, queryRange); - - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - -} diff --git a/src/main/java/ch/psi/daq/rest/queries/TimeRangeQuery.java b/src/main/java/ch/psi/daq/rest/queries/TimeRangeQuery.java deleted file mode 100644 index 53f42ae..0000000 --- a/src/main/java/ch/psi/daq/rest/queries/TimeRangeQuery.java +++ /dev/null @@ -1,97 +0,0 @@ -package ch.psi.daq.rest.queries; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.LinkedHashSet; -import java.util.List; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonProperty; - -import ch.psi.daq.cassandra.reader.Ordering; -import ch.psi.daq.hazelcast.query.Aggregation; -import ch.psi.daq.hazelcast.query.AggregationType; -import ch.psi.daq.hazelcast.query.bin.BinningStrategy; -import ch.psi.daq.hazelcast.query.range.QueryRange; - -public class TimeRangeQuery extends AbstractQuery { - - private static final long serialVersionUID = 1L; - - public static final String DATE_FORMAT_STRING = "yyyy/MM/dd hh:mm:ss.SSS"; - private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_STRING); - private static Logger logger = LoggerFactory.getLogger(TimeRangeQuery.class); - - /** - * Constructor - * - * @param ordering whether to add a 'orderBy' clause into the database query - * @param channels all the channelIds (channel names) we want to query - * @param fields the fields (who map to fields in the DB) we are interested in returning to the - * client, needs to be in insertion order (hence the {@link LinkedHashSet} type) - * @param binningStrategyEnum enum that maps the user's String to a concrete - * {@link BinningStrategy} implementation - * @param binLengthOrCount depending on the chosen binning strategy, this field defines either the - * count (how many pulse ids are to be put inside 1 bin) or the time frame for 1 bin - * @param aggregateChannels whether aggregation will include all channels, default is on a - * per-channel basis - * @param aggregationType defines whether aggregation takes place in an index- or value-based - * manner - * @param aggregations list of aggregations / statistics to calculate, e.g. min, max and average - * @param queryRange object containing the ranges for either pulse-based queries or time-based - * queries - * @param startDateTime if set, the date string (format is: - * {@link TimeRangeQuery#DATE_FORMAT_STRING} will be parsed and converted into - * milliseconds - * @param endDateTime set, the date string (format is: {@link TimeRangeQuery#DATE_FORMAT_STRING} - * will be parsed and converted into milliseconds - */ - @JsonCreator - public TimeRangeQuery( - // note that those annotations are needed for the polymorphic - // mapping to work correctly - @JsonProperty(value = "ordering") Ordering ordering, - @JsonProperty(value = "channels") List channels, - @JsonProperty(value = "fields") LinkedHashSet fields, - @JsonProperty(value = "binningStrategy") BinningStrategyEnum binningStrategyEnum, - @JsonProperty(value = "binDuration") long binLengthOrCount, - @JsonProperty(value = "aggregateChannels") boolean aggregateChannels, - @JsonProperty(value = "aggregationType") AggregationType aggregationType, - @JsonProperty(value = "aggregations") List aggregations, - @JsonProperty(value = "queryRange") QueryRange queryRange, - @JsonProperty(value = "startDateTime") String startDateTime, - @JsonProperty(value = "endDateTime") String endDateTime) { - - super(ordering, channels, fields, binningStrategyEnum, binLengthOrCount, aggregateChannels, aggregationType, - aggregations, queryRange); - - if (startDateTime != null && endDateTime != null) { - logger.info("startDateTime and endDateTime specified. This takes precedence over the start / end fields."); - try { - Date startDate = DATE_FORMAT.parse(startDateTime); - Date endDate = DATE_FORMAT.parse(endDateTime); - - getQueryRange().setTimeRange(startDate.getTime(), queryRange.getStartNanos(), endDate.getTime(), - queryRange.getEndNanos()); - } catch (ParseException e) { - logger.error("Parsing the start- and/or endDate was unsuccessful. " - + "The format must be '" + DATE_FORMAT_STRING + "'", e); - } - } - - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } - -} diff --git a/src/main/java/ch/psi/daq/rest/response/ResponseStreamWriter.java b/src/main/java/ch/psi/daq/rest/response/ResponseStreamWriter.java index bba5e4c..3a4963a 100644 --- a/src/main/java/ch/psi/daq/rest/response/ResponseStreamWriter.java +++ b/src/main/java/ch/psi/daq/rest/response/ResponseStreamWriter.java @@ -14,9 +14,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import ch.psi.daq.domain.cassandra.DataEvent; -import ch.psi.daq.rest.queries.AbstractQuery; - import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; @@ -25,6 +22,9 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; +import ch.psi.daq.domain.cassandra.DataEvent; +import ch.psi.daq.hazelcast.query.AbstractQuery; + /** * Takes a Java 8 stream and writes it to the output stream provided by the {@link ServletResponse} * of the current request. diff --git a/src/test/java/ch/psi/daq/test/rest/controller/DaqRestControllerTest.java b/src/test/java/ch/psi/daq/test/rest/controller/DaqRestControllerTest.java index d5960e3..8d9f47a 100644 --- a/src/test/java/ch/psi/daq/test/rest/controller/DaqRestControllerTest.java +++ b/src/test/java/ch/psi/daq/test/rest/controller/DaqRestControllerTest.java @@ -10,19 +10,19 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultHandlers; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; -import ch.psi.daq.cassandra.reader.Ordering; -import ch.psi.daq.hazelcast.query.AggregationType; -import ch.psi.daq.hazelcast.query.range.QueryRange; -import ch.psi.daq.hazelcast.query.range.QueryRangeImpl; -import ch.psi.daq.rest.queries.BinningStrategyEnum; -import ch.psi.daq.rest.queries.PulseRangeQuery; -import ch.psi.daq.rest.queries.TimeRangeQuery; -import ch.psi.daq.test.rest.AbstractDaqRestTest; - import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import ch.psi.daq.cassandra.reader.Ordering; +import ch.psi.daq.hazelcast.query.AggregationType; +import ch.psi.daq.hazelcast.query.BinningStrategyEnum; +import ch.psi.daq.hazelcast.query.PulseRangeQuery; +import ch.psi.daq.hazelcast.query.TimeRangeQuery; +import ch.psi.daq.hazelcast.query.range.QueryRange; +import ch.psi.daq.hazelcast.query.range.QueryRangeImpl; +import ch.psi.daq.test.rest.AbstractDaqRestTest; + /** * Tests the {@link DaqController} implementation. */ diff --git a/src/test/java/ch/psi/daq/test/rest/queries/AbstractQueryTestTest.java b/src/test/java/ch/psi/daq/test/rest/queries/AbstractQueryTestTest.java index 7475057..93b5e0a 100644 --- a/src/test/java/ch/psi/daq/test/rest/queries/AbstractQueryTestTest.java +++ b/src/test/java/ch/psi/daq/test/rest/queries/AbstractQueryTestTest.java @@ -8,18 +8,18 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + import ch.psi.daq.cassandra.reader.Ordering; import ch.psi.daq.hazelcast.query.AggregationType; +import ch.psi.daq.hazelcast.query.BinningStrategyEnum; +import ch.psi.daq.hazelcast.query.TimeRangeQuery; import ch.psi.daq.hazelcast.query.bin.BinningStrategyBinCount; import ch.psi.daq.hazelcast.query.bin.BinningStrategyLengthPulse; import ch.psi.daq.hazelcast.query.bin.BinningStrategyLengthTime; import ch.psi.daq.hazelcast.query.range.QueryRange; import ch.psi.daq.hazelcast.query.range.QueryRangeImpl; -import ch.psi.daq.rest.queries.BinningStrategyEnum; -import ch.psi.daq.rest.queries.TimeRangeQuery; - -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; @RunWith(BlockJUnit4ClassRunner.class) public class AbstractQueryTestTest extends AbstractQueryTest { diff --git a/src/test/java/ch/psi/daq/test/rest/queries/TimeRangeQueryTest.java b/src/test/java/ch/psi/daq/test/rest/queries/TimeRangeQueryTest.java index d847dbd..931d90e 100644 --- a/src/test/java/ch/psi/daq/test/rest/queries/TimeRangeQueryTest.java +++ b/src/test/java/ch/psi/daq/test/rest/queries/TimeRangeQueryTest.java @@ -8,16 +8,16 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; -import ch.psi.daq.cassandra.reader.Ordering; -import ch.psi.daq.hazelcast.query.AggregationType; -import ch.psi.daq.hazelcast.query.range.QueryRange; -import ch.psi.daq.hazelcast.query.range.QueryRangeImpl; -import ch.psi.daq.rest.queries.BinningStrategyEnum; -import ch.psi.daq.rest.queries.TimeRangeQuery; - import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import ch.psi.daq.cassandra.reader.Ordering; +import ch.psi.daq.hazelcast.query.AggregationType; +import ch.psi.daq.hazelcast.query.BinningStrategyEnum; +import ch.psi.daq.hazelcast.query.TimeRangeQuery; +import ch.psi.daq.hazelcast.query.range.QueryRange; +import ch.psi.daq.hazelcast.query.range.QueryRangeImpl; + @RunWith(BlockJUnit4ClassRunner.class) public class TimeRangeQueryTest extends AbstractQueryTest { diff --git a/src/test/java/ch/psi/daq/test/rest/query/DummyQueryProcessor.java b/src/test/java/ch/psi/daq/test/rest/query/DummyQueryProcessor.java index fd96466..0ffa7be 100644 --- a/src/test/java/ch/psi/daq/test/rest/query/DummyQueryProcessor.java +++ b/src/test/java/ch/psi/daq/test/rest/query/DummyQueryProcessor.java @@ -10,14 +10,14 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + import ch.psi.daq.domain.cassandra.ChannelEvent; import ch.psi.daq.domain.cassandra.DataEvent; import ch.psi.daq.hazelcast.query.Query; import ch.psi.daq.hazelcast.query.processor.QueryProcessor; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - /** * @author zellweger_c *