Skip to content

Commit

Permalink
Test MS mind names
Browse files Browse the repository at this point in the history
EltonCN committed Dec 11, 2024
1 parent 8bf0293 commit 3606ce2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/test/java/br/unicamp/cst/memorystorage/MemoryStorageTest.java
Original file line number Diff line number Diff line change
@@ -76,6 +76,32 @@ public void tearDown() throws Exception {
commands.flushall().get();
}

@Test
public void testMindName() throws Exception{
MemoryStorageCodelet msCodelet = new MemoryStorageCodelet(mind, "Mind1");
msCodelet.setTimeStep(50);
mind.insertCodelet(msCodelet);

RedisURI uri = RedisURI.Builder
.redis("localhost", 6379)
.build();
RedisClient client = RedisClient.create(uri);

MemoryStorageCodelet msCodelet2 = new MemoryStorageCodelet(mind, "Mind2", client);
msCodelet2.setTimeStep(50);
mind.insertCodelet(msCodelet2);

mind.start();

Set<String> members = commands.smembers("Mind1:nodes").get();
assertEquals(1, members.size());
assertTrue(members.contains("node"));

Set<String> members2 = commands.smembers("Mind2:nodes").get();
assertEquals(1, members2.size());
assertTrue(members2.contains("node"));
}

@Test
public void nodeEnterTest() throws Exception {
MemoryStorageCodelet msCodelet = new MemoryStorageCodelet(mind);

0 comments on commit 3606ce2

Please sign in to comment.