import static junit.framework.Assert.*;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
import javax.naming.InitialContext;
import org.junit.Test;
+import org.wamblee.cdi.SimpleInjectorTest.X;
+import org.wamblee.cdi.SimpleInjectorTest.Y;
import org.wamblee.inject.InjectorFactory;
import org.wamblee.inject.InjectorFactoryBuilder;
import org.wamblee.test.jndi.StubInitialContextFactory;
import static junit.framework.Assert.*;
import static org.mockito.Mockito.*;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
import javax.naming.InitialContext;
import org.junit.After;
import org.junit.Test;
import org.wamblee.inject.Injector;
import org.wamblee.inject.InjectorFactory;
+import org.wamblee.inject.InjectorFactoryBuilder;
import org.wamblee.inject.SimpleInjector;
import org.wamblee.test.jndi.StubInitialContextFactory;
// verify the custom injector was called.
assertSame(singleton, pojo.getSingleton());
}
+
+ @RequestScoped
+ public static class Y {
+
+ }
+ public static class X {
+ @Inject
+ private Y y;
+
+ }
+
+ @Test
+ public void testInjectStorage() throws Exception {
+ X x = new X();
+ InjectorFactoryBuilder.setInjectorFactory(null);
+ InjectorFactoryBuilder.getInjector().inject(x);
+ }
+
+ @Test
+ public void testInjectStorage2() {
+ X x = new X();
+ InjectorFactoryBuilder.setInjectorFactory(null);
+ InjectorFactoryBuilder.getInjector().inject(x);
+ }
+
}