From 127cf7f8c38595b6b6453a1f90155c1445c3e6c2 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Sun, 5 May 2024 17:35:09 +0600 Subject: [PATCH] Show server replies and, remove repeating tests to avoid code repitition --- .../modules/timeseries/TimeSeriesTest.java | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/test/java/redis/clients/jedis/modules/timeseries/TimeSeriesTest.java b/src/test/java/redis/clients/jedis/modules/timeseries/TimeSeriesTest.java index 97f80c96d2..d86ae2ab92 100644 --- a/src/test/java/redis/clients/jedis/modules/timeseries/TimeSeriesTest.java +++ b/src/test/java/redis/clients/jedis/modules/timeseries/TimeSeriesTest.java @@ -291,35 +291,21 @@ public void testAdd() { @Test public void testCreateIgnore() { assertEquals("OK", client.tsCreate("series-ignore", - TSCreateParams.createParams().ignore(5, 2))); + TSCreateParams.createParams().ignore(5, 3))); //System.out.println(client.tsInfo("series-ignore").getProperties()); // doesn't provide IGNORE info client.tsAdd("series-ignore", 0, 0); - System.out.println(client.tsAdd("series-ignore", 100, 20)); // should fail, doesn't fail - // TODO: complete tests - } - - @Test - public void testAlterIgnore() { - assertEquals("OK", client.tsCreate("series-ignore")); - assertEquals("OK", client.tsAlter("series-ignore", - TSAlterParams.alterParams().ignore(5, 2))); - //System.out.println(client.tsInfo("series-ignore").getProperties()); // doesn't provide IGNORE info - - client.tsAdd("series-ignore", 0, 0); - System.out.println(client.tsAdd("series-ignore", 100, 20)); // should fail, doesn't fail - // TODO: complete tests - } - - @Test - public void testAddIgnore() { - assertEquals(0, client.tsAdd("series-ignore", 0, 0, - TSCreateParams.createParams().ignore(5, 2))); - //System.out.println(client.tsInfo("series-ignore").getProperties()); // doesn't provide IGNORE info - - System.out.println(client.tsAdd("series-ignore", 100, 20)); // should fail, doesn't fail - // TODO: complete tests + System.out.println(client.tsAdd("series-ignore", 1, 1)); // should be ignored? doesn't get ignored + System.out.println(client.tsGet("series-ignore")); // >> (1:1.0) + System.out.println(client.tsRange("series-ignore", 0, 1000)); // >> [(0:0.0), (1:1.0)] + System.out.println(client.tsInfo("series-ignore").getProperties().get("totalSamples")); // >> 2 + System.out.println(client.tsAdd("series-ignore", 100, 20)); // should be ignored, doesn't get ignored + System.out.println(client.tsGet("series-ignore")); // >> (100:20.0) + System.out.println(client.tsRange("series-ignore", 0, 1000)); // >> [(0:0.0), (1:1.0), (100:20.0)] + System.out.println(client.tsInfo("series-ignore").getProperties().get("totalSamples")); // >> 3 + // TODO: complete test } + // TODO: more tests from TS.ALTER and TS.ADD instead of TS.CREATE. @Test public void issue75() {