We need to use AbstractLookup because of a bug in Lookups.fixed when dealling with lookup by ID
authorJaroslav Tulach <jtulach@netbeans.org>
Wed, 03 Feb 2010 00:26:11 +0100
changeset 9735653a70ebb56
parent 972 a2947558c966
child 974 da4eb49856cd
We need to use AbstractLookup because of a bug in Lookups.fixed when dealling with lookup by ID
spring.lookup/src/test/java/org/apidesign/spring/LookupBasedApplicationContextTest.java
     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"},