mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
re OpenHFT/Chronicle-Map#134 Reflection based access to Cleaner compatible with 8 and 9+ JDKs.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user