Author: pete.muir(a)jboss.org
Date: 2008-12-07 13:44:32 -0500 (Sun, 07 Dec 2008)
New Revision: 448
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarmOffice.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
Log:
Update tests for type safe and name based resolution and instantiation and implement
manager injection
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-07
18:08:47 UTC (rev 447)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -49,6 +49,7 @@
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.bean.AbstractBean;
+import org.jboss.webbeans.bean.ManagerBean;
import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.bean.proxy.ProxyPool;
import org.jboss.webbeans.contexts.ContextMap;
@@ -82,7 +83,7 @@
private List<Bean<?>> beans;
private Set<Decorator> decorators;
private Set<Interceptor> interceptors;
-
+
@SuppressWarnings("unchecked")
public ManagerImpl()
{
@@ -104,6 +105,7 @@
protected void initStandardBeans()
{
addBean(new
SimpleBean<DefaultEnterpriseBeanLookup>(DefaultEnterpriseBeanLookup.class, this));
+ addBean(new ManagerBean(this));
}
/**
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -0,0 +1,84 @@
+/**
+ *
+ */
+package org.jboss.webbeans.bean;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.webbeans.Dependent;
+import javax.webbeans.Standard;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
+import org.jboss.webbeans.util.Reflections;
+
+public class ManagerBean extends Bean<Manager>
+{
+
+ private static Set<Class<?>> types =
Reflections.getTypeHierachy(Manager.class);
+ private static final Set<Annotation> BINDING = new
HashSet<Annotation>(Arrays.asList(new CurrentAnnotationLiteral()));
+
+ public ManagerBean(Manager manager)
+ {
+ super(manager);
+ }
+
+ @Override
+ public Manager create()
+ {
+ return getManager();
+ }
+
+ @Override
+ public void destroy(Manager instance)
+ {
+ //No -op
+ }
+
+ @Override
+ public Set<Annotation> getBindingTypes()
+ {
+ return BINDING;
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Standard.class;
+ }
+
+ @Override
+ public String getName()
+ {
+ return null;
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ @Override
+ public Set<Class<?>> getTypes()
+ {
+ return types;
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return false;
+ }
+
+}
\ No newline at end of file
Property changes on:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ManagerBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BoostrapTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -27,6 +27,7 @@
import org.jboss.webbeans.test.beans.Tiger;
import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.ejb.model.valid.Hound;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
import org.testng.annotations.Test;
@@ -140,11 +141,14 @@
public void testRegisterProducerMethodBean()
{
bootstrap.registerBeans(TarantulaProducer.class);
- assert manager.getBeans().size() == 3;
+ assert manager.getBeans().size() == 4;
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
for (Bean<?> bean : manager.getBeans())
{
- classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ if (bean instanceof AbstractBean)
+ {
+ classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ }
}
assert classes.containsKey(TarantulaProducer.class);
assert classes.containsKey(Tarantula.class);
@@ -158,12 +162,14 @@
public void testRegisterMultipleEnterpriseAndSimpleBean()
{
bootstrap.registerBeans(Hound.class, Elephant.class, Panther.class, Tiger.class,
Tuna.class, Salmon.class, SeaBass.class, Sole.class);
- assert manager.getBeans().size() == 9;
+ assert manager.getBeans().size() == 8 + MockManagerImpl.BUILT_IN_BEANS;
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
for (Bean<?> bean : manager.getBeans())
{
-
- classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ if (bean instanceof AbstractBean)
+ {
+ classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ }
}
assert classes.containsKey(DefaultEnterpriseBeanLookup.class);
assert classes.containsKey(Hound.class);
@@ -196,12 +202,14 @@
{
bootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(Hound.class, Elephant.class, Panther.class,
Tiger.class, Tuna.class, Salmon.class, SeaBass.class, Sole.class)), null, null));
- assert manager.getBeans().size() == 9;
+ assert manager.getBeans().size() == 10;
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>,
Bean<?>>();
for (Bean<?> bean : manager.getBeans())
{
-
- classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ if (bean instanceof AbstractBean)
+ {
+ classes.put(((AbstractBean<?, ?>) bean).getType(), bean);
+ }
}
assert classes.containsKey(DefaultEnterpriseBeanLookup.class);
assert classes.containsKey(Hound.class);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -23,7 +23,7 @@
{
@Test(groups = "Reflections")
- @SpecAssertion(section = { "4.4", "4.8" })
+ @SpecAssertion(section = { "4.4", "5.8" })
public void testReflectionsUsedForNormalScope()
{
Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
@@ -33,7 +33,7 @@
}
@Test(groups = "Reflections")
- @SpecAssertion(section = { "4.4", "4.8" })
+ @SpecAssertion(section = { "4.4", "5.8" })
public void testReflectionsNotUsedForPseudoScope()
{
Bean<Fox> foxBean = BeanFactory.createSimpleBean(Fox.class);
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -45,13 +45,13 @@
@Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9")
public void testParameterizedTypeWithWildcardParameter()
{
- manager.resolveByType(new TypeLiteral<ParameterizedBean<?>>(){});
+ manager.getInstanceByType(new TypeLiteral<ParameterizedBean<?>>(){});
}
@Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9")
public <T> void testParameterizedTypeWithTypeParameter()
{
- manager.resolveByType(new TypeLiteral<ParameterizedBean<T>>(){});
+ manager.getInstanceByType(new TypeLiteral<ParameterizedBean<T>>(){});
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ManagerTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -1,21 +1,25 @@
package org.jboss.webbeans.test;
+import static org.jboss.webbeans.util.BeanFactory.createSimpleBean;
+
import javax.webbeans.ContextNotActiveException;
import javax.webbeans.RequestScoped;
import javax.webbeans.manager.Context;
import org.jboss.webbeans.contexts.AbstractContext;
import org.jboss.webbeans.contexts.RequestContext;
+import org.jboss.webbeans.test.beans.FishFarmOffice;
import org.testng.annotations.Test;
@SpecVersion("PDR")
public class ManagerTest extends AbstractTest
{
- @Test(groups={"stub", "manager", "injection",
"deployment"}) @SpecAssertion(section="4.8")
+ @Test(groups={"manager", "injection", "deployment"})
@SpecAssertion(section="5.8")
public void testInjectingManager()
{
- assert false;
+ FishFarmOffice fishFarmOffice = createSimpleBean(FishFarmOffice.class).create();
+ assert fishFarmOffice.manager != null;
}
@Test(expectedExceptions={ContextNotActiveException.class},
groups={"manager"}) @SpecAssertion(section="8.6")
@@ -55,7 +59,7 @@
}
- @Test(groups={"stub", "manager", "ejb3"})
@SpecAssertion(section="4.8")
+ @Test(groups={"stub", "manager", "ejb3"})
@SpecAssertion(section="5.8")
public void testManagerLookupInJndi()
{
assert false;
@@ -64,7 +68,7 @@
/*
- @Test(groups="manager") @SpecAssertion(section="4.8")
+ @Test(groups="manager") @SpecAssertion(section="5.8")
public void test
{
assert false;
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -17,25 +17,25 @@
public class ResolutionByNameTest extends AbstractTest
{
- @Test(groups={"stub", "el"})
@SpecAssertion(section="4.10")
+ @Test(groups={"stub", "el"})
@SpecAssertion(section="5.11")
public void testELResolver()
{
assert false;
}
- @Test(groups={"stub", "el"})
@SpecAssertion(section="4.10.2")
+ @Test(groups={"stub", "el"})
@SpecAssertion(section="5.11.2")
public void testELResolverRegisteredWithJsf()
{
assert false;
}
- @Test(groups={"stub", "el"})
@SpecAssertion(section="4.10.2")
+ @Test(groups={"stub", "el"})
@SpecAssertion(section="5.11.2")
public void testELResolverRegisteredWithServlet()
{
assert false;
}
- @Test @SpecAssertion(section="4.10.1")
+ @Test @SpecAssertion(section="5.11.1")
public void testNamedBasedResolution()
{
@@ -67,7 +67,7 @@
assert manager.resolveByName("whitefish").contains(plaiceBean);
}
- @Test(groups="resolution") @SpecAssertion(section="4.10.1")
+ @Test(groups="resolution") @SpecAssertion(section="5.11.1")
public void testNoWebBeansFound() throws Exception
{
Bean<Cod> codBean = createSimpleBean(Cod.class);
@@ -79,9 +79,15 @@
assert manager.resolveByName("foo").size() == 0;
}
+ @Test(groups="stub") @SpecAssertion(section="5.11.1")
+ public void testOnlyHigestPrecedenceResolved()
+ {
+ assert false;
+ }
+
/*
- @Test(groups="el") @SpecAssertion(section="4.10")
+ @Test(groups="el") @SpecAssertion(section="5.11")
public void test
{
assert false;
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -37,11 +37,13 @@
import org.jboss.webbeans.test.beans.Spider;
import org.jboss.webbeans.test.beans.SpiderProducer;
import org.jboss.webbeans.test.beans.Tuna;
+import org.jboss.webbeans.test.beans.broken.ParameterizedBean;
import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import
org.jboss.webbeans.test.bindings.BindingTypeWithBindingAnnotationMemberAnnotationLiteral;
import
org.jboss.webbeans.test.bindings.BindingTypeWithBindingArrayTypeMemberAnnotationLiteral;
import org.jboss.webbeans.test.bindings.ChunkyAnnotationLiteral;
import org.jboss.webbeans.test.bindings.ExpensiveAnnotationLiteral;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.Test;
@SpecVersion("20081206")
@@ -61,7 +63,7 @@
}
@Test(groups="resolution") @SpecAssertion(section="5.9.2")
- public void testSingleApiTypeWithCurrent() throws Exception
+ public void testDefaultBindingTypeAssumed() throws Exception
{
AnnotatedField<Tuna> tunaField = new
AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"),
fishFarmClass);
Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
@@ -71,6 +73,18 @@
assert possibleTargets.contains(tunaBean);
}
+ @Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9")
+ public void testParameterizedTypeWithWildcardParameter()
+ {
+ manager.resolveByType(new TypeLiteral<ParameterizedBean<?>>(){});
+ }
+
+ @Test(groups="resolution",
expectedExceptions=IllegalArgumentException.class)
@SpecAssertion(section="5.9")
+ public <T> void testParameterizedTypeWithTypeParameter()
+ {
+ manager.resolveByType(new TypeLiteral<ParameterizedBean<T>>(){});
+ }
+
@Test(groups="resolution",
expectedExceptions=DuplicateBindingTypeException.class)
@SpecAssertion(section="5.9.2")
public void testDuplicateBindingTypesUsed()
{
@@ -130,7 +144,7 @@
assert possibleTargets.contains(haddockBean);
}
- @Test(groups="resolution") @SpecAssertion(section={"5.9.2",
"5.9.4"})
+ @Test(groups="resolution") @SpecAssertion(section={"5.9.2"})
public void testResolveByType() throws Exception
{
Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
@@ -155,7 +169,7 @@
assert manager.resolveByType(Animal.class, new
CurrentAnnotationLiteral()).contains(haddockBean);
}
- @Test(groups="injection") @SpecAssertion(section="2.3.5")
+ @Test(groups="injection")
@SpecAssertion(section={"2.3.5","5.9.2.2"})
public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
{
Bean<Cod> codBean = createSimpleBean(Cod.class);
@@ -235,8 +249,40 @@
assert manager.resolveByType(Animal.class, new AnnotationLiteral<Whitefish>()
{}).contains(plaiceBean);
}
+
@Test(groups="resolution") @SpecAssertion(section="5.9.2")
+ public void testNoWebBeansFound() throws Exception
+ {
+ AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() ==
0;
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section={"5.9.2",
"2.2"})
+ public void testResolveObject() throws Exception
+ {
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
+ manager.addBean(plaiceBean);
+ manager.addBean(salmonBean);
+ manager.addBean(soleBean);
+
+ assert manager.resolveByType(Object.class).size() == 3 +
MockManagerImpl.BUILT_IN_BEANS;
+ assert manager.resolveByType(Object.class).contains(plaiceBean);
+ assert manager.resolveByType(Object.class).contains(salmonBean);
+ assert manager.resolveByType(Object.class).contains(soleBean);
+
+ }
+
+ @Test(groups="resolution") @SpecAssertion(section="5.9.2.1")
public void testResolveByTypeWithNonBindingMembers() throws Exception
{
AnnotatedField<Animal> veryExpensiveWhitefishField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("veryExpensiveWhitefish"),
fishFarmClass);
@@ -266,37 +312,6 @@
assert beans.contains(roundWhiteFishBean);
}
- @Test(groups="resolution") @SpecAssertion(section="5.9.2")
- public void testNoWebBeansFound() throws Exception
- {
- AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
- Bean<Sole> soleBean = createSimpleBean(Sole.class);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
- manager.addBean(plaiceBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
-
- assert manager.resolveByType(Tuna.class, new CurrentAnnotationLiteral()).size() ==
0;
- }
-
- @Test(groups="resolution") @SpecAssertion(section={"5.9.2",
"2.2"})
- public void testResolveObject() throws Exception
- {
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
- Bean<Sole> soleBean = createSimpleBean(Sole.class);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
- manager.addBean(plaiceBean);
- manager.addBean(salmonBean);
- manager.addBean(soleBean);
-
- assert manager.resolveByType(Object.class).size() == 4;
- assert manager.resolveByType(Object.class).contains(plaiceBean);
- assert manager.resolveByType(Object.class).contains(salmonBean);
- assert manager.resolveByType(Object.class).contains(soleBean);
-
- }
-
@Test(groups="resolution", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="5.9.2.1")
public void testArrayValuedAnnotationMemberWithoutNonBinding()
{
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -38,6 +38,7 @@
import org.jboss.webbeans.test.beans.nonBeans.ServletRequestListenerBean;
import org.jboss.webbeans.test.beans.nonBeans.UIComponentBean;
import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockWebBeanDiscovery;
import org.testng.annotations.Test;
@@ -88,21 +89,21 @@
public void testClassesImplementingServletInterfacesNotDiscoveredAsSimpleBeans()
{
bootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(FilterBean.class,
HttpSessionListenerBean.class, ServletBean.class, ServletContextListenerBean.class,
ServletRequestListenerBean.class)), null, null));
- assert manager.getBeans().size() == 1;
+ assert manager.getBeans().size() == MockManagerImpl.BUILT_IN_BEANS;
}
@Test
public void testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean()
{
bootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(EnterpriseBeanWebBean.class)), null, null));
- assert manager.getBeans().size() == 1;
+ assert manager.getBeans().size() == MockManagerImpl.BUILT_IN_BEANS;
}
@Test
public void testClassExtendingUiComponentNotDiscoveredAsSimpleBean()
{
bootstrap.boot(new MockWebBeanDiscovery(new
HashSet<Class<?>>(Arrays.asList(UIComponentBean.class)), null, null));
- assert manager.getBeans().size() == 1;
+ assert manager.getBeans().size() == MockManagerImpl.BUILT_IN_BEANS;
}
@Test(groups="stub")
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarmOffice.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarmOffice.java
(rev 0)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarmOffice.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.beans;
+
+import javax.webbeans.Current;
+import javax.webbeans.manager.Manager;
+
+public class FishFarmOffice
+{
+
+ @Current public Manager manager;
+
+}
Property changes on:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/FishFarmOffice.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java 2008-12-07
18:08:47 UTC (rev 447)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java 2008-12-07
18:44:32 UTC (rev 448)
@@ -12,6 +12,9 @@
public class MockManagerImpl extends ManagerImpl
{
+
+ public static int BUILT_IN_BEANS = 2;
+
private Object event = null;
private Annotation[] eventBindings = null;
private Class<? extends Object> observedEventType = null;