risdenk commented on code in PR #953:
URL: https://github.com/apache/solr/pull/953#discussion_r998866952
##########
solr/modules/sql/src/test/org/apache/solr/handler/sql/TestSQLHandler.java:
##########
@@ -2177,43 +2176,43 @@ public void testTimeSeriesGroupingFacet() throws
Exception {
tuples = getTuples(sParams, baseUrl);
- assert (tuples.size() == 6);
+ assertEquals(6, tuples.size());
tuple = tuples.get(0);
- assert (tuple.getLong("year_i") == 2015);
- assert (tuple.getLong("month_i") == 11);
- assert (tuple.getLong("day_i") == 8);
- assert (tuple.getDouble("EXPR$3") == 42); // sum(item_i)
+ assertEquals(2015, (long) tuple.getLong("year_i"));
Review Comment:
Hmmm so `tuple.getLong` returns a `Long` because it also returns `null`
sometimes. Changing to `long` can't be done for `tuple.getLong` since then
`null` can't be returned. `3L` is still a `long` and can't be compared with
`Long` apparently. I could change it to
```
assertEquals(Long.valueOf(3), tuple.getLong("myId"))
```
but that seems worse.
I don't have any other ideas right now :/
##########
solr/modules/sql/src/test/org/apache/solr/handler/sql/TestSQLHandler.java:
##########
@@ -2308,43 +2308,43 @@ public void testParallelTimeSeriesGrouping() throws
Exception {
tuples = getTuples(sParams, baseUrl);
- assert (tuples.size() == 6);
+ assertEquals(6, tuples.size());
tuple = tuples.get(0);
- assert (tuple.getLong("year_i") == 2015);
- assert (tuple.getLong("month_i") == 11);
- assert (tuple.getLong("day_i") == 8);
- assert (tuple.getDouble("EXPR$3") == 42); // sum(item_i)
+ assertEquals(2015, (long) tuple.getLong("year_i"));
Review Comment:
Hmmm so `tuple.getLong` returns a `Long` because it also returns `null`
sometimes. Changing to `long` can't be done for `tuple.getLong` since then
`null` can't be returned. `3L` is still a `long` and can't be compared with
`Long` apparently. I could change it to
```
assertEquals(Long.valueOf(3), tuple.getLong("myId"))
```
but that seems worse.
I don't have any other ideas right now :/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]