1 19 20 package org.openide.util.lookup; 21 22 import java.lang.ref.WeakReference ; 23 import org.netbeans.junit.NbTestCase; 24 import org.openide.util.Lookup; 25 import org.openide.util.Lookup.Provider; 26 import org.openide.util.Lookup.Result; 27 import org.openide.util.Lookup.Template; 28 29 33 public class SimpleProxyLookupTest extends NbTestCase { 34 35 public SimpleProxyLookupTest(String testName) { 36 super(testName); 37 } 38 39 protected void setUp() throws Exception { 40 } 41 42 public void test69810() throws Exception { 43 Lookup.Template t = new Lookup.Template(String .class); 44 SimpleProxyLookup spl = new SimpleProxyLookup(new Provider() { 45 public Lookup getLookup() { 46 return Lookups.fixed(new Object [] {"test1", "test2"}); 47 } 48 }); 49 50 assertGC("", new WeakReference (spl.lookup(t))); 51 52 spl.lookup(new Lookup.Template(Object .class)).allInstances(); 53 } 54 55 } 56 | Popular Tags |