Skip to content

Commit

Permalink
Show server replies
Browse files Browse the repository at this point in the history
and, remove repeating tests to avoid code repitition
  • Loading branch information
sazzad16 committed May 5, 2024
1 parent c9b19fd commit 54b02ef
Showing 1 changed file with 14 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import redis.clients.jedis.timeseries.*;
import redis.clients.jedis.util.KeyValue;

@RunWith(Parameterized.class)
public class TimeSeriesTest extends RedisModuleCommandsTestBase {

@BeforeClass
Expand All @@ -33,8 +32,8 @@ public static void prepare() {
//// RedisModuleCommandsTestBase.tearDown();
// }

public TimeSeriesTest(RedisProtocol protocol) {
super(protocol);
public TimeSeriesTest() {
super(null);
}

@Test
Expand Down Expand Up @@ -291,35 +290,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() {
Expand Down

0 comments on commit 54b02ef

Please sign in to comment.