Index: test/unit/src/org/openide/util/lookup/ProxyLookupTest.java =================================================================== RCS file: /cvs/openide/util/test/unit/src/org/openide/util/lookup/ProxyLookupTest.java,v retrieving revision 1.2 diff -c -r1.2 ProxyLookupTest.java *** test/unit/src/org/openide/util/lookup/ProxyLookupTest.java 12 Jun 2005 15:44:27 -0000 1.2 --- test/unit/src/org/openide/util/lookup/ProxyLookupTest.java 15 Jun 2005 10:03:35 -0000 *************** *** 164,169 **** --- 164,199 ---- doProxyLookupTemplateCaching(lookups, true); } + public void testProxyLookupViaTemplateNotDelegates(){ + final boolean classLookupPerformed[] = new boolean[1]; + classLookupPerformed[0] = false; + + final boolean templateLookupPerformed[] = new boolean[1]; + templateLookupPerformed[0] = false; + + Lookup mySingleLookup = new Lookup(){ + public Result lookup(Template template) { + templateLookupPerformed[0] = true; + return null; + } + + public Object lookup(Class clazz) { + classLookupPerformed[0] = true; + return null; + } + }; + + Lookup lookupArray[] = new Lookup[1]; + lookupArray[0] = mySingleLookup; + + ProxyLookup proxyLookup = new ProxyLookup(lookupArray); + proxyLookup.lookup(Object.class); + proxyLookup.lookup(new Lookup.Template(Object.class)); + assertTrue("Class lookup performing", classLookupPerformed[0]); //NOI18N + assertTrue("Template lookup performing", templateLookupPerformed[0]);//NOI18N + } + + /** Index 0 of lookups will be modified, the rest is up to the * setup code. */