#69810: Additional test by Lahvac that I forget to check in platform_32247-50_root release50_fixes_base winsys_psplit_checkpoint1
authorjtulach@netbeans.org
Fri, 09 Dec 2005 19:21:01 +0000
changeset 99eab10c1be646
parent 98 1742afcac4a2
child 100 5b33852fa4e9
#69810: Additional test by Lahvac that I forget to check in
openide.util/test/unit/src/org/openide/util/lookup/SimpleProxyLookupTest.java
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/openide.util/test/unit/src/org/openide/util/lookup/SimpleProxyLookupTest.java	Fri Dec 09 19:21:01 2005 +0000
     1.3 @@ -0,0 +1,49 @@
     1.4 +/*
     1.5 + *                 Sun Public License Notice
     1.6 + *
     1.7 + * The contents of this file are subject to the Sun Public License
     1.8 + * Version 1.0 (the "License"). You may not use this file except in
     1.9 + * compliance with the License. A copy of the License is available at
    1.10 + * http://www.sun.com/
    1.11 + *
    1.12 + * The Original Code is NetBeans. The Initial Developer of the Original
    1.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
    1.14 + * Microsystems, Inc. All Rights Reserved.
    1.15 + */
    1.16 +
    1.17 +package org.openide.util.lookup;
    1.18 +
    1.19 +import java.lang.ref.WeakReference;
    1.20 +import org.netbeans.junit.NbTestCase;
    1.21 +import org.openide.util.Lookup;
    1.22 +import org.openide.util.Lookup.Provider;
    1.23 +import org.openide.util.Lookup.Result;
    1.24 +import org.openide.util.Lookup.Template;
    1.25 +
    1.26 +/**
    1.27 + *
    1.28 + * @author Jan Lahoda
    1.29 + */
    1.30 +public class SimpleProxyLookupTest extends NbTestCase {
    1.31 +    
    1.32 +    public SimpleProxyLookupTest(String testName) {
    1.33 +        super(testName);
    1.34 +    }
    1.35 +
    1.36 +    protected void setUp() throws Exception {
    1.37 +    }
    1.38 +
    1.39 +    public void test69810() throws Exception {
    1.40 +        Lookup.Template t = new Lookup.Template(String.class);
    1.41 +        SimpleProxyLookup spl = new SimpleProxyLookup(new Provider() {
    1.42 +            public Lookup getLookup() {
    1.43 +                return Lookups.fixed(new Object[] {"test1", "test2"});
    1.44 +            }
    1.45 +        });
    1.46 +        
    1.47 +        assertGC("", new WeakReference(spl.lookup(t)));
    1.48 +        
    1.49 +        spl.lookup(new Lookup.Template(Object.class)).allInstances();
    1.50 +    }
    1.51 +    
    1.52 +}