Skip to content

Commit 525da15

Browse files
author
Greenwood
committed
fixing unit test, naming and extension
1 parent 8512498 commit 525da15

File tree

1 file changed

+11
-3
lines changed
  • json-path/src/test/java/com/jayway/jsonpath/internal/function

1 file changed

+11
-3
lines changed

json-path/src/test/java/com/jayway/jsonpath/internal/function/Issue191.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,24 @@
1515
* Shows aggregation across fields rather than within a single entity.
1616
*
1717
*/
18-
public class Issue191 extends com.jayway.jsonpath.internal.function.BaseFunctionTest {
18+
public class Issue191 {
1919

2020
private Configuration conf = Configurations.GSON_CONFIGURATION;
2121

2222
@Test
2323
public void testResultSetNumericComputation() {
2424
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");
25-
Long value = JsonPath.parse(stream).read("$.max($..timestamp)", Long.class);
25+
Long value = JsonPath.parse(stream).read("$.sum($..timestamp)", Long.class);
2626
assertEquals("Expected the max function to consume the aggregation parameters and calculate the max over the result set",
27-
Long.valueOf(1427310341), value);
27+
Long.valueOf(35679716813L), value);
28+
}
29+
30+
@Test
31+
public void testMultipleResultSetSums() {
32+
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");
33+
Long value = JsonPath.parse(stream).read("$.sum($..timestamp, $..cpus)", Long.class);
34+
assertEquals("Expected the max function to consume the aggregation parameters and calculate the max over the result set",
35+
Long.valueOf(35679716835L), value);
2836
}
2937

3038
@Test

0 commit comments

Comments
 (0)