|
24 | 24 | import java.util.concurrent.ScheduledExecutorService; |
25 | 25 | import java.util.concurrent.TimeUnit; |
26 | 26 |
|
27 | | -import static junit.framework.Assert.assertEquals; |
| 27 | +import static org.junit.Assert.assertEquals; |
28 | 28 | import static org.junit.Assert.assertFalse; |
29 | 29 | import static org.junit.Assert.assertNull; |
30 | 30 | import static org.junit.Assert.assertTrue; |
31 | 31 |
|
32 | | -public class IntegrationTest { |
| 32 | +public class IntegrationTest extends AbstractIntegrationTest { |
33 | 33 | private final String keyName = IntegrationTest.class.getCanonicalName(); |
34 | | - private Redis redis; |
35 | | - private Socket socket; |
36 | | - |
37 | | - @Test |
38 | | - public void tmp () throws IOException { |
39 | | - redis.call("SELECT", "0"); |
40 | | - System.out.println( |
41 | | - new SerializedHashMap<>(redis, "nl.melp.linkchecker.LinkChecker.report.statuses").keySet().size() |
42 | | - ); |
43 | | - } |
44 | | - |
45 | | - @Before |
46 | | - public void init() throws IOException { |
47 | | - socket = new Socket("localhost", 6379); |
48 | | - redis = new Redis(socket); |
49 | | - redis.call("SELECT", "15"); |
50 | | - Assert.assertEquals("Refusing to run on non-empty database", 0, ((List<?>) redis.call("KEYS", "*")).size()); |
51 | | - } |
52 | | - |
53 | | - @After |
54 | | - public void cleanup() throws IOException { |
55 | | - int size = ((List<?>) redis.call("KEYS", "*")).size(); |
56 | | - redis.call("QUIT"); |
57 | | - if (!socket.isClosed()) { |
58 | | - socket.close(); |
59 | | - } |
60 | | - if (size > 0) { |
61 | | - Assert.fail("This test is littering"); |
62 | | - } |
63 | | - } |
64 | | - |
65 | 34 |
|
66 | 35 | @Test |
67 | 36 | public void testList() throws IOException { |
@@ -293,8 +262,8 @@ public void testSerializedMappedSet() throws IOException { |
293 | 262 | assertTrue(values.get("foo").contains("bar")); |
294 | 263 | assertTrue(secondary.get("foo").contains("bar")); |
295 | 264 | values.get("foo").remove("bar"); |
296 | | - assertEquals(1, values.size()); |
297 | | - assertEquals(1, secondary.size()); |
| 265 | + assertEquals(0, values.size()); |
| 266 | + assertEquals(0, secondary.size()); |
298 | 267 | values.clear(); |
299 | 268 | assertEquals(0, values.size()); |
300 | 269 | assertEquals(0, secondary.size()); |
@@ -383,6 +352,5 @@ public void testSerializedMappedSetKeySynchronization() throws IOException { |
383 | 352 |
|
384 | 353 | Assert.assertEquals(0, map.size()); |
385 | 354 | Assert.assertEquals(0, secondary.size()); |
386 | | - |
387 | 355 | } |
388 | 356 | } |
0 commit comments