Use java.lang.ref.Cleaner in controller.cluster.io
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / cluster / io / FileBackedOutputStreamTest.java
index a7abf7c..ff5d61b 100644 (file)
@@ -52,7 +52,6 @@ public class FileBackedOutputStreamTest {
     @Before
     public void setup() {
         deleteTempFiles(TEMP_DIR);
     @Before
     public void setup() {
         deleteTempFiles(TEMP_DIR);
-        FileBackedOutputStream.REFERENCE_CACHE.clear();
     }
 
     @After
     }
 
     @After
@@ -76,8 +75,6 @@ public class FileBackedOutputStreamTest {
             assertArrayEquals("Read bytes", bytes, fbos.asByteSource().read());
             assertArrayEquals("Read bytes", bytes, fbos.asByteSource().read());
 
             assertArrayEquals("Read bytes", bytes, fbos.asByteSource().read());
             assertArrayEquals("Read bytes", bytes, fbos.asByteSource().read());
 
-            assertEquals("Reference cache size", 0, FileBackedOutputStream.REFERENCE_CACHE.size());
-
             fbos.cleanup();
         }
 
             fbos.cleanup();
         }
 
@@ -112,12 +109,8 @@ public class FileBackedOutputStreamTest {
 
             inputStream.close();
 
 
             inputStream.close();
 
-            assertEquals("Reference cache size", 1, FileBackedOutputStream.REFERENCE_CACHE.size());
-
             fbos.cleanup();
 
             fbos.cleanup();
 
-            assertEquals("Reference cache size", 0, FileBackedOutputStream.REFERENCE_CACHE.size());
-
             assertNull("Found unexpected temp file", findTempFileName(TEMP_DIR));
         }
 
             assertNull("Found unexpected temp file", findTempFileName(TEMP_DIR));
         }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.