We need to use AbstractLookup because of a bug in Lookups.fixed when dealling with lookup by ID
1.1 --- a/spring.lookup/src/test/java/org/apidesign/spring/LookupBasedApplicationContextTest.java Wed Feb 03 00:04:30 2010 +0100
1.2 +++ b/spring.lookup/src/test/java/org/apidesign/spring/LookupBasedApplicationContextTest.java Wed Feb 03 00:26:11 2010 +0100
1.3 @@ -52,6 +52,7 @@
1.4 import org.openide.util.lookup.AbstractLookup;
1.5 import org.openide.util.lookup.AbstractLookup.Content;
1.6 import org.openide.util.lookup.AbstractLookup.Pair;
1.7 +import org.openide.util.lookup.InstanceContent;
1.8 import org.openide.util.lookup.Lookups;
1.9 import org.springframework.beans.factory.BeanDefinitionStoreException;
1.10 import org.springframework.beans.factory.NoSuchBeanDefinitionException;
1.11 @@ -165,7 +166,9 @@
1.12 }
1.13
1.14 public void testCooperationWithAutowire() throws Exception {
1.15 - Lookup base = Lookups.fixed(Long.valueOf(1000L));
1.16 + InstanceContent ic = new InstanceContent();
1.17 + Lookup base = new AbstractLookup(ic);
1.18 + ic.add(Long.valueOf(1000L));
1.19 ApplicationContext baseCtx = SpringAndLookup.create(base, "base");
1.20 ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
1.21 new String[] {"cooperation-with-autowire.xml"},