1 19 20 package org.netbeans.modules.apisupport.project.ui.customizer; 21 22 import java.lang.ref.Reference ; 23 import java.lang.ref.WeakReference ; 24 import org.netbeans.api.project.Project; 25 import org.netbeans.api.project.ui.OpenProjects; 26 import org.netbeans.modules.apisupport.project.NbModuleProject; 27 import org.netbeans.modules.apisupport.project.TestBase; 28 29 34 public class CustomizerLibrariesTest extends TestBase { 35 36 public CustomizerLibrariesTest(String testName) { 37 super(testName); 38 } 39 40 public void testCustomizerLibrariesCanBeGCedAfterProjectIsClosed() throws Exception { 41 NbModuleProject p = generateStandaloneModule("module1"); 42 SingleModuleProperties props = SingleModulePropertiesTest.loadProperties(p); 43 CustomizerLibraries panel = new CustomizerLibraries(props); 44 panel.refresh(); 45 Reference ref = new WeakReference (panel); 46 OpenProjects.getDefault().close(new Project[] { p }); 47 panel = null; 48 p = null; 49 props = null; 50 assertGC("CustomizerLibraries panel cannot be GCed", ref); 51 } 52 53 } | Popular Tags |