Skip to content

Commit

Permalink
TEST: Fix expected result invoking getStat.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 authored and jhpark816 committed Oct 12, 2023
1 parent 54a8417 commit 340cfcb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/java/net/spy/memcached/ProtocolBaseCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testAssertions() {
public void testGetStats() throws Exception {
Map<SocketAddress, Map<String, String>> stats = client.getStats();
System.out.println("Stats: " + stats);
assertEquals(1, stats.size());
assertEquals(client.getAllNodes().size(), stats.size());
Map<String, String> oneStat = stats.values().iterator().next();
assertTrue(oneStat.containsKey("total_items"));
}
Expand All @@ -64,7 +64,7 @@ public void testGetStatsSlabs() throws Exception {
client.set("slabinitializer", 0, "hi");
Map<SocketAddress, Map<String, String>> stats = client.getStats("slabs");
System.out.println("Stats: " + stats);
assertEquals(1, stats.size());
assertEquals(client.getAllNodes().size(), stats.size());
Map<String, String> oneStat = stats.values().iterator().next();
assertTrue(oneStat.containsKey("0:chunk_size"));
}
Expand All @@ -79,7 +79,7 @@ public void testGetStatsSizes() throws Exception {
client.set("sizeinitializer", 0, "hi");
Map<SocketAddress, Map<String, String>> stats = client.getStats("sizes");
System.out.println("Stats: " + stats);
assertEquals(1, stats.size());
assertEquals(client.getAllNodes().size(), stats.size());
Map<String, String> oneStat = stats.values().iterator().next();
assertEquals("1", oneStat.get("96"));
}
Expand All @@ -91,7 +91,7 @@ public void testGetStatsCacheDump() throws Exception {
Map<SocketAddress, Map<String, String>> stats =
client.getStats("cachedump 0 10000");
System.out.println("Stats: " + stats);
assertEquals(1, stats.size());
assertEquals(client.getAllNodes().size(), stats.size());
Map<String, String> oneStat = stats.values().iterator().next();
String val = oneStat.get("dumpinitializer");
assertTrue(val + "doesn't match", val.matches("\\[acctime=\\d+, exptime=\\d+\\]"));
Expand Down

0 comments on commit 340cfcb

Please sign in to comment.