re OpenHFT/Chronicle-Map#134 Reflection based access to Cleaner compatible with 8 and 9+ JDKs.

This commit is contained in:
Paweł Dąbrowski
2018-04-23 17:33:43 +02:00
parent e7c7dd8975
commit f2064f4db4
4 changed files with 78 additions and 2 deletions
@@ -0,0 +1,23 @@
package net.openhft.chronicle.hash.impl.util;
import org.junit.Test;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertTrue;
public class CleanerUtilsTest {
@Test
public void testClean() throws InterruptedException {
CountDownLatch latch = new CountDownLatch(1);
Object ob = new Object();
Cleaner cleaner = CleanerUtils.createCleaner(ob, latch::countDown);
cleaner.clean();
assertTrue(latch.await(1, TimeUnit.SECONDS));
}
}