Author: nickarls
Date: 2008-12-05 06:44:38 -0500 (Fri, 05 Dec 2008)
New Revision: 411
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.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/CommonWebBeanTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.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/NameTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.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/ScopeTypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.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/StereotypesTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
Log:
ManagerImpl.instance()
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-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -73,6 +73,8 @@
public class ManagerImpl implements Manager
{
+ public static final String JNDI_KEY = "java:comp/Manager";
+
private static ManagerImpl instance = new ManagerImpl();
public static ManagerImpl instance()
@@ -95,9 +97,9 @@
{
this.metaDataCache = new MetaDataCache();
this.beans = new CopyOnWriteArrayList<Bean<?>>();
- this.eventManager = new EventManager(this);
- this.resolver = new Resolver(this);
- this.proxyPool = new ProxyPool(this);
+ this.eventManager = new EventManager();
+ this.resolver = new Resolver();
+ this.proxyPool = new ProxyPool();
this.decorators = new HashSet<Decorator>();
this.interceptors = new HashSet<Interceptor>();
initEnabledDeploymentTypes();
@@ -110,7 +112,7 @@
*/
protected void initStandardBeans()
{
- addBean(new
SimpleBean<DefaultEnterpriseBeanLookup>(DefaultEnterpriseBeanLookup.class, this));
+ addBean(new
SimpleBean<DefaultEnterpriseBeanLookup>(DefaultEnterpriseBeanLookup.class));
}
/**
@@ -688,4 +690,10 @@
return buffer.toString();
}
+ // TODO: Temp
+ public static void setInstance(ManagerImpl manager)
+ {
+ ManagerImpl.instance = manager;
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/Resolver.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -92,11 +92,8 @@
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
- private ManagerImpl manager;
-
- public Resolver(ManagerImpl manager)
+ public Resolver()
{
- this.manager = manager;
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
this.resolvedInjectionPoints = new
ConcurrentCache<ResolvableAnnotatedItem<?,?>, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String,
Set<Bean<?>>>();
@@ -118,7 +115,7 @@
public Set<Bean<T>> call() throws Exception
{
- Set<Bean<T>> beans =
retainHighestPrecedenceBeans(getMatchingBeans(element, manager.getBeans(),
manager.getMetaDataCache()), manager.getEnabledDeploymentTypes());
+ Set<Bean<T>> beans =
retainHighestPrecedenceBeans(getMatchingBeans(element, ManagerImpl.instance().getBeans(),
ManagerImpl.instance().getMetaDataCache()),
ManagerImpl.instance().getEnabledDeploymentTypes());
if (element.getType().isPrimitive())
{
for (Bean<?> bean : beans)
@@ -150,6 +147,7 @@
* Resolve all injection points added using
* {@link #addInjectionPoints(Collection)}
*/
+ @SuppressWarnings("unchecked")
public void resolveInjectionPoints()
{
for (final AnnotatedItem injectable : injectionPoints)
@@ -188,7 +186,7 @@
if (element.getType().equals(Object.class))
{
// TODO Fix this cast
- beans = new HashSet<Bean<T>>((List) manager.getBeans());
+ beans = new HashSet<Bean<T>>((List)
ManagerImpl.instance().getBeans());
}
else
{
@@ -205,17 +203,18 @@
return resolvedNames.putIfAbsent(name, new
Callable<Set<Bean<?>>>()
{
+ @SuppressWarnings("unchecked")
public Set<Bean<?>> call() throws Exception
{
Set<Bean<?>> beans = new HashSet<Bean<?>>();
- for (Bean<?> bean : manager.getBeans())
+ for (Bean<?> bean : ManagerImpl.instance().getBeans())
{
if ((bean.getName() == null && name == null) || (bean.getName() !=
null && bean.getName().equals(name)))
{
beans.add(bean);
}
}
- return retainHighestPrecedenceBeans((Set) beans,
manager.getEnabledDeploymentTypes());
+ return retainHighestPrecedenceBeans((Set) beans,
ManagerImpl.instance().getEnabledDeploymentTypes());
}
});
@@ -252,6 +251,7 @@
}
}
+ @SuppressWarnings("unchecked")
private static <T> Set<Bean<T>> getMatchingBeans(AnnotatedItem<T,
?> element, List<Bean<?>> beans, MetaDataCache metaDataCache)
{
Set<Bean<T>> resolvedBeans = new HashSet<Bean<T>>();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -90,8 +90,6 @@
// Logger
private LogProvider log = Logging.getLogProvider(AbstractBean.class);
- // Reference to WBRI manager
- private ManagerImpl manager;
private Set<Annotation> bindingTypes;
protected String name;
protected Class<? extends Annotation> scopeType;
@@ -112,10 +110,9 @@
*
* @param manager The Web Beans manager
*/
- public AbstractBean(ManagerImpl manager)
+ public AbstractBean()
{
- super(manager);
- this.manager = manager;
+ super(ManagerImpl.instance());
}
/**
@@ -123,7 +120,7 @@
*/
protected void init()
{
- mergedStereotypes = new MergedStereotypes<T,
E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class), manager);
+ mergedStereotypes = new MergedStereotypes<T,
E>(getAnnotatedItem().getMetaAnnotations(Stereotype.class));
initType();
initPrimitive();
log.debug("Building Web Bean bean metadata for " + getType());
@@ -226,7 +223,7 @@
if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
{
- this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(),
getMergedStereotypes().getPossibleDeploymentTypes());
+ this.deploymentType =
getDeploymentType(ManagerImpl.instance().getEnabledDeploymentTypes(),
getMergedStereotypes().getPossibleDeploymentTypes());
log.trace("Deployment type " + deploymentType + " specified by
stereotype");
return;
}
@@ -493,17 +490,6 @@
}
/**
- * Returns the Web Beans manager reference
- *
- * @return The manager
- */
- @Override
- protected ManagerImpl getManager()
- {
- return manager;
- }
-
- /**
* Returns the merged sterotypes of the bean
*
* @return The set of merged stereotypes
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -29,7 +29,6 @@
import javax.webbeans.Observes;
import javax.webbeans.Produces;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -62,9 +61,9 @@
* @param xmlAnnotatedItem Annotations read from XML
* @param manager The Web Beans manager
*/
- public AbstractClassBean(Class<T> type, ManagerImpl manager)
+ public AbstractClassBean(Class<T> type)
{
- super(manager);
+ super();
this.annotatedItem = new AnnotatedClassImpl<T>(type);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -58,9 +58,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public EnterpriseBean(Class<T> type, ManagerImpl manager)
+ public EnterpriseBean(Class<T> type)
{
- super(type, manager);
+ super(type);
init();
}
@@ -139,14 +139,14 @@
}
if (!isDefinedInXml())
{
- if
(!getManager().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
+ if
(!ManagerImpl.instance().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
{
throw new DefinitionException("Annotation defined specializing EJB must
have EJB superclass");
}
}
else
{
- if
(getManager().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
+ if
(ManagerImpl.instance().getMetaDataCache().getEjbMetaData(getAnnotatedItem().getSuperclass().getType()).isEjb())
{
throw new DefinitionException("XML defined specializing EJB must have
annotation defined EJB implementation");
}
@@ -225,7 +225,7 @@
@Override
public T create()
{
- T instance = (T)
getManager().getInstanceByType(EnterpriseBeanLookup.class).lookup(ejbMetaData.getEjbName());
+ T instance = (T)
ManagerImpl.instance().getInstanceByType(EnterpriseBeanLookup.class).lookup(ejbMetaData.getEjbName());
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
@@ -254,7 +254,7 @@
{
for (AnnotatedMethod<Object> initializer : getInitializerMethods())
{
- initializer.invoke(getManager(), instance);
+ initializer.invoke(instance);
}
}
@@ -275,7 +275,7 @@
{
for (AnnotatedField<?> field : getInjectableFields())
{
- field.inject(instance, getManager());
+ field.inject(instance);
}
}
@@ -307,7 +307,7 @@
if (superclass != null)
{
// TODO look up this bean and do this via init
- return new EnterpriseBean(superclass, getManager());
+ return new EnterpriseBean(superclass);
}
else
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EventBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -25,7 +25,6 @@
import javax.webbeans.Event;
import javax.webbeans.Standard;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -57,9 +56,9 @@
* @param manager The Web Beans manager
*/
@SuppressWarnings("unchecked")
- public EventBean(AnnotatedField<T> field, ManagerImpl manager)
+ public EventBean(AnnotatedField<T> field)
{
- super(manager);
+ super();
this.annotatedItem = (AnnotatedField<Event<T>>) field;
init();
}
@@ -167,7 +166,7 @@
@Override
public Event<T> create()
{
- return new EventImpl<T>(getManager(),
annotatedItem.getBindingTypesAsArray());
+ return new EventImpl<T>(annotatedItem.getBindingTypesAsArray());
}
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/MergedStereotypes.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
-import java.util.Map.Entry;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem.AnnotationMap;
@@ -44,20 +43,20 @@
private Set<Class<?>> requiredTypes;
// The supported scopes
private Set<Class<? extends Annotation>> supportedScopes;
-
+
/**
* Constructor
*
* @param stereotypeAnnotations The stereotypes to merge
* @param manager The Web Beans manager
*/
- public MergedStereotypes(Set<Annotation> stereotypeAnnotations, ManagerImpl
manager)
+ public MergedStereotypes(Set<Annotation> stereotypeAnnotations)
{
possibleDeploymentTypes = new AnnotationMap();
possibleScopeTypes = new HashSet<Annotation>();
requiredTypes = new HashSet<Class<?>>();
supportedScopes = new HashSet<Class<? extends Annotation>>();
- merge(stereotypeAnnotations, manager);
+ merge(stereotypeAnnotations);
}
/**
@@ -66,12 +65,12 @@
* @param stereotypeAnnotations The stereotype annotations
* @param manager The Web Beans manager
*/
- protected void merge(Set<Annotation> stereotypeAnnotations, ManagerImpl
manager)
+ protected void merge(Set<Annotation> stereotypeAnnotations)
{
for (Annotation stereotypeAnnotation : stereotypeAnnotations)
{
// Retrieve and merge all metadata from stereotypes
- StereotypeModel<?> stereotype =
manager.getMetaDataCache().getStereotype(stereotypeAnnotation.annotationType());
+ StereotypeModel<?> stereotype =
ManagerImpl.instance().getMetaDataCache().getStereotype(stereotypeAnnotation.annotationType());
if (stereotype == null)
{
throw new IllegalStateException("Stereotype " +
stereotypeAnnotation + " not registered with container");
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -58,9 +58,9 @@
* @param declaringBean The declaring bean instance
* @param manager The Web Beans manager
*/
- public ProducerMethodBean(Method method, AbstractClassBean<?> declaringBean,
ManagerImpl manager)
+ public ProducerMethodBean(Method method, AbstractClassBean<?> declaringBean)
{
- this(new AnnotatedMethodImpl<T>(method, declaringBean.getAnnotatedItem()),
declaringBean, manager);
+ this(new AnnotatedMethodImpl<T>(method, declaringBean.getAnnotatedItem()),
declaringBean);
}
/**
@@ -70,9 +70,9 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- public ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?>
declaringBean, ManagerImpl manager)
+ public ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?>
declaringBean)
{
- super(manager);
+ super();
this.method = method;
this.declaringBean = declaringBean;
init();
@@ -86,7 +86,7 @@
@Override
public T create()
{
- T instance = method.invoke(getManager(),
getManager().getInstance(getDeclaringBean()));
+ T instance =
method.invoke(ManagerImpl.instance().getInstance(getDeclaringBean()));
if (instance == null && !getScopeType().equals(Dependent.class))
{
throw new IllegalProductException("Cannot return null from a non-dependent
method");
@@ -177,7 +177,7 @@
*/
protected void initRemoveMethod()
{
- Set<AnnotatedMethod<Object>> disposalMethods =
getManager().resolveDisposalMethods(getType(), getBindingTypes().toArray(new
Annotation[0]));
+ Set<AnnotatedMethod<Object>> disposalMethods =
ManagerImpl.instance().resolveDisposalMethods(getType(), getBindingTypes().toArray(new
Annotation[0]));
if (disposalMethods.size() == 1)
{
removeMethod = disposalMethods.iterator().next();
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -26,7 +26,6 @@
import javax.webbeans.DefinitionException;
import javax.webbeans.Initializer;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -54,16 +53,16 @@
private AnnotatedMethod<Object> postConstruct;
private AnnotatedMethod<Object> preDestroy;
-
+
/**
* Constructor
*
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public SimpleBean(Class<T> type, ManagerImpl manager)
+ public SimpleBean(Class<T> type)
{
- super(type, manager);
+ super(type);
init();
}
@@ -75,7 +74,7 @@
@Override
public T create()
{
- T instance = constructor.newInstance(getManager());
+ T instance = constructor.newInstance();
bindDecorators();
bindInterceptors();
injectEjbAndCommonFields();
@@ -147,7 +146,7 @@
{
for (AnnotatedMethod<Object> initializer : getInitializerMethods())
{
- initializer.invoke(getManager(), instance);
+ initializer.invoke(instance);
}
}
@@ -168,7 +167,7 @@
{
for (AnnotatedField<?> injectableField : getInjectableFields())
{
- injectableField.inject(instance, getManager());
+ injectableField.inject(instance);
}
}
@@ -330,7 +329,7 @@
if (superclass != null)
{
// TODO look up this bean and do this via init
- return new SimpleBean(superclass, getManager());
+ return new SimpleBean(superclass);
}
else
{
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlEnterpriseBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.bean;
-import org.jboss.webbeans.ManagerImpl;
/**
* Represents an XML defined enterprise bean
@@ -35,9 +34,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public XmlEnterpriseBean(Class<T> type, ManagerImpl manager)
+ public XmlEnterpriseBean(Class<T> type)
{
- super(type, manager);
+ super(type);
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/XmlSimpleBean.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.bean;
-import org.jboss.webbeans.ManagerImpl;
/**
* Represents a simple, XML defined bean
@@ -35,9 +34,9 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- public XmlSimpleBean(Class<T> type, ManagerImpl manager)
+ public XmlSimpleBean(Class<T> type)
{
- super(type, manager);
+ super(type);
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyMethodHandler.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -43,7 +43,6 @@
private transient Bean<?> bean;
private int beanIndex;
- private static ManagerImpl manager;
/**
* Constructor
@@ -52,11 +51,10 @@
* @param beanIndex The index to the bean in the manager bean list
* @param manager The manager implementation
*/
- public ProxyMethodHandler(Bean<?> bean, int beanIndex, ManagerImpl manager)
+ public ProxyMethodHandler(Bean<?> bean, int beanIndex)
{
this.bean = bean;
this.beanIndex = beanIndex;
- ProxyMethodHandler.manager = manager;
}
/**
@@ -74,9 +72,9 @@
{
if (bean == null)
{
- bean = manager.getBeans().get(beanIndex);
+ bean = ManagerImpl.instance().getBeans().get(beanIndex);
}
- Context context = manager.getContext(bean.getScopeType());
+ Context context = ManagerImpl.instance().getContext(bean.getScopeType());
Object proxiedInstance = context.get(bean, true);
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
return proxiedMethod.invoke(proxiedInstance, args);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -47,12 +47,10 @@
* @author Nicklas Karlsson
*/
- private ManagerImpl manager;
private ConcurrentCache<Bean<? extends Object>, Object> pool;
- public ProxyPool(ManagerImpl manager)
+ public ProxyPool()
{
- this.manager = manager;
this.pool = new ConcurrentCache<Bean<? extends Object>, Object>();
}
@@ -113,7 +111,7 @@
* @throws IllegalAccessException When the proxy couldn't be created
*/
@SuppressWarnings("unchecked")
- private static <T> T createClientProxy(Bean<T> bean, int beanIndex,
ManagerImpl manager) throws RuntimeException
+ private static <T> T createClientProxy(Bean<T> bean, int beanIndex) throws
RuntimeException
{
ProxyFactory proxyFactory = new ProxyFactory();
TypeInfo typeInfo = getTypeInfo(bean.getTypes());
@@ -132,7 +130,7 @@
{
throw new RuntimeException("Could not access bean correctly when creating
client proxy for " + bean, e);
}
- ProxyMethodHandler proxyMethodHandler = new ProxyMethodHandler(bean, beanIndex,
manager);
+ ProxyMethodHandler proxyMethodHandler = new ProxyMethodHandler(bean, beanIndex);
((ProxyObject) clientProxy).setHandler(proxyMethodHandler);
return clientProxy;
}
@@ -153,12 +151,12 @@
public T call() throws Exception
{
- int beanIndex = manager.getBeans().indexOf(bean);
+ int beanIndex = ManagerImpl.instance().getBeans().indexOf(bean);
if (beanIndex < 0)
{
throw new DefinitionException(bean + " is not known to the
manager");
}
- return createClientProxy(bean, beanIndex, manager);
+ return createClientProxy(bean, beanIndex);
}
});
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/Bootstrap.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -36,6 +36,7 @@
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.JNDI;
/**
* Bootstrapping functionality that is run at application startup and detects
@@ -50,9 +51,6 @@
private static LogProvider log = Logging.getLogProvider(Bootstrap.class);
- // The Web Beans manager
- private ManagerImpl manager;
-
/**
* Constructor
*
@@ -60,20 +58,10 @@
*/
public Bootstrap()
{
- this(ManagerImpl.instance());
+ JNDI.set(ManagerImpl.JNDI_KEY, ManagerImpl.instance());
}
/**
- * Constructor
- *
- * @param manager The Web Beans manager
- */
- protected Bootstrap(ManagerImpl manager)
- {
- this.manager = manager;
- }
-
- /**
* Register any beans defined by the provided classes with the manager
*
* @param classes The classes to register
@@ -93,7 +81,7 @@
public void registerBeans(Iterable<Class<?>> classes)
{
Set<AbstractBean<?, ?>> beans = createBeans(classes);
- manager.setBeans(beans);
+ ManagerImpl.instance().setBeans(beans);
}
/**
@@ -126,27 +114,27 @@
for (Class<?> clazz : classes)
{
AbstractClassBean<?> bean;
- if (manager.getMetaDataCache().getEjbMetaData(clazz).isEjb())
+ if (ManagerImpl.instance().getMetaDataCache().getEjbMetaData(clazz).isEjb())
{
- bean = createEnterpriseBean(clazz, manager);
+ bean = createEnterpriseBean(clazz);
}
else
{
- bean = createSimpleBean(clazz, manager);
+ bean = createSimpleBean(clazz);
}
beans.add(bean);
- manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
+
ManagerImpl.instance().getResolver().addInjectionPoints(bean.getInjectionPoints());
for (AnnotatedMethod<Object> producerMethod : bean.getProducerMethods())
{
- ProducerMethodBean<?> producerMethodBean =
createProducerMethodBean(producerMethod.getType(), producerMethod, manager, bean);
+ ProducerMethodBean<?> producerMethodBean =
createProducerMethodBean(producerMethod.getType(), producerMethod, bean);
beans.add(producerMethodBean);
-
manager.getResolver().addInjectionPoints(producerMethodBean.getInjectionPoints());
+
ManagerImpl.instance().getResolver().addInjectionPoints(producerMethodBean.getInjectionPoints());
}
for (AnnotatedField<Object> eventField : bean.getEventFields())
{
- EventBean<?> eventBean = createEventBean(eventField.getType(),
eventField, manager);
+ EventBean<?> eventBean = createEventBean(eventField.getType(),
eventField);
beans.add(eventBean);
- manager.getResolver().addInjectionPoints(eventBean.getInjectionPoints());
+
ManagerImpl.instance().getResolver().addInjectionPoints(eventBean.getInjectionPoints());
}
log.info("Web Bean: " + bean);
}
@@ -171,7 +159,7 @@
}
registerBeans(webBeanDiscovery.discoverWebBeanClasses());
log.info("Validing Web Bean injection points");
- manager.getResolver().resolveInjectionPoints();
+ ManagerImpl.instance().getResolver().resolveInjectionPoints();
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionBeanMap.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -42,8 +42,6 @@
// The HTTP session to use as backing map
private HttpSession session;
- // The Web Beans manager
- private ManagerImpl manager;
// The storage prefix to put before names
private String keyPrefix;
@@ -53,10 +51,9 @@
* @param manager The Web Beans manager
* @param keyPrefix The storage names prefix
*/
- public SessionBeanMap(ManagerImpl manager, String keyPrefix)
+ public SessionBeanMap(String keyPrefix)
{
super();
- this.manager = manager;
this.keyPrefix = keyPrefix;
log.trace("SessionBeanMap created with prefix " + keyPrefix);
}
@@ -94,7 +91,7 @@
*/
private String getBeanKey(Contextual<?> bean)
{
- return keyPrefix + manager.getBeans().indexOf(bean);
+ return keyPrefix + ManagerImpl.instance().getBeans().indexOf(bean);
}
/**
@@ -189,7 +186,7 @@
if (name.startsWith(keyPrefix))
{
String id = name.substring(keyPrefix.length());
- Contextual<?> bean = manager.getBeans().get(Integer.parseInt(id));
+ Contextual<?> bean =
ManagerImpl.instance().getBeans().get(Integer.parseInt(id));
beans.add(bean);
}
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SessionContext.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -38,7 +38,7 @@
{
super(SessionScoped.class);
// Replaces the BeanMap implementation with a session-based one
- beans.set(new SessionBeanMap(manager, getScopeType().getName() + "#"));
+ beans.set(new SessionBeanMap(getScopeType().getName() + "#"));
log.trace("Created session context");
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/SharedContext.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,8 +21,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
/**
- * The abstraction of a shared context with common beans but with a private
- * active state
+ * The abstraction of a shared context with common beans and active state state
*
* @author Nicklas Karlsson
*
@@ -31,14 +30,13 @@
public class SharedContext extends AbstractContext
{
private BeanMap beans;
- private ThreadLocal<AtomicBoolean> active;
+ private AtomicBoolean active;
public SharedContext(Class<? extends Annotation> scopeType)
{
super(scopeType);
beans = new SimpleBeanMap();
- active = new ThreadLocal<AtomicBoolean>();
- active.set(new AtomicBoolean(true));
+ active = new AtomicBoolean(true);
}
/**
@@ -47,7 +45,7 @@
@Override
protected AtomicBoolean getActive()
{
- return active.get();
+ return active;
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -48,7 +48,7 @@
// The event type
private Class<T> eventType;
// The Web Beans manager
- protected ManagerImpl manager;
+ protected static final ManagerImpl manager = ManagerImpl.instance();
/**
* Constructor
@@ -56,9 +56,8 @@
* @param manager The Web Beans manager
* @param bindingTypes The binding types
*/
- public EventImpl(ManagerImpl manager, Annotation... bindingTypes)
+ public EventImpl(Annotation... bindingTypes)
{
- this.manager = manager;
this.bindingTypes = checkBindingTypes(bindingTypes);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventManager.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -134,8 +134,6 @@
// The map of registered observers for a give
private final RegisteredObserversMap registeredObservers;
- // The Web Beans manager
- private ManagerImpl manager;
// The current UserTransaction
UserTransaction userTransaction;
@@ -144,10 +142,9 @@
*
* @param manager The Web Beans manager
*/
- public EventManager(ManagerImpl manager)
+ public EventManager()
{
registeredObservers = new RegisteredObserversMap();
- this.manager = manager;
// TODO. Check where to *really* get this from
userTransaction = (UserTransaction)
JNDI.lookup("java:/UserTransaction");
}
@@ -239,7 +236,7 @@
*/
private <T> void deferEvent(T event, Observer<T> observer)
{
- TransactionListener transactionListener =
manager.getInstanceByType(TransactionListener.class);
+ TransactionListener transactionListener =
ManagerImpl.instance().getInstanceByType(TransactionListener.class);
DeferredEventNotification<T> deferredEvent = new
DeferredEventNotification<T>(event, observer);
transactionListener.registerSynhronization(deferredEvent);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -58,7 +58,6 @@
private final Class<T> eventType;
private TransactionObservationPhase transactionObservationPhase;
private boolean conditional;
- private ManagerImpl manager;
/**
* Creates an Observer which describes and encapsulates an observer method
@@ -72,9 +71,8 @@
* @param observer The observer method to notify
* @param eventType The type of event being observed
*/
- public ObserverImpl(ManagerImpl manager, final EventBean<T> eventBean, final
AnnotatedMethod<Object> observer, final Class<T> eventType)
+ public ObserverImpl(final EventBean<T> eventBean, final
AnnotatedMethod<Object> observer, final Class<T> eventType)
{
- this.manager = manager;
this.eventBean = eventBean;
this.observerMethod = observer;
this.eventType = eventType;
@@ -138,7 +136,7 @@
if (instance != null)
{
// TODO replace event parameter
- observerMethod.invoke(manager, instance);
+ observerMethod.invoke(instance);
}
}
@@ -154,7 +152,7 @@
protected Object getInstance(boolean conditional)
{
// Return the most specialized instance of the component
- return manager.getInstanceByType(eventBean.getType(),
eventBean.getBindingTypes().toArray(new Annotation[0]));
+ return ManagerImpl.instance().getInstanceByType(eventBean.getType(),
eventBean.getBindingTypes().toArray(new Annotation[0]));
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,8 +21,6 @@
import java.lang.reflect.Constructor;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* Represents a Class Constructor
*
@@ -56,7 +54,7 @@
* @param manager The Web Beans manager
* @return The created instance
*/
- public T newInstance(ManagerImpl manager);
+ public T newInstance();
/**
* Gets the declaring class of the annotation
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -19,8 +19,6 @@
import java.lang.reflect.Field;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* AnnotatedField provides a uniform access to the annotations on an annotated
* field
@@ -44,7 +42,7 @@
* @param instance The instance to inject
* @param manager The Web Beans manager
*/
- public void inject(Object instance, ManagerImpl manager);
+ public void inject(Object instance);
/**
* Gets an abstraction of the declaring class
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,8 +21,6 @@
import java.lang.reflect.Method;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
-
/**
* AnnotatedType provides a uniform access to the annotations on an annotated
* class defined either in Java or XML
@@ -57,7 +55,7 @@
* @param instance The instance to invoke
* @return A reference to the instance
*/
- public T invoke(ManagerImpl manager, Object instance);
+ public T invoke(Object instance);
/**
* Invokes the method
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -17,7 +17,6 @@
package org.jboss.webbeans.introspector;
-import org.jboss.webbeans.ManagerImpl;
/**
* AnnotatedParameter provides a uniform access to a method parameter defined
@@ -35,6 +34,6 @@
* @param manager The Web Beans Manager
* @return The value
*/
- public T getValue(ManagerImpl manager);
+ public T getValue();
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -34,7 +34,6 @@
import javax.webbeans.ScopeType;
import javax.webbeans.Stereotype;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedParameter;
@@ -205,13 +204,13 @@
* @return The object array of looked up values
*
*/
- protected static Object[]
getParameterValues(List<AnnotatedParameter<Object>> parameters, ManagerImpl
manager)
+ protected static Object[]
getParameterValues(List<AnnotatedParameter<Object>> parameters)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<AnnotatedParameter<Object>> iterator = parameters.iterator();
for (int i = 0; i < parameterValues.length; i++)
{
- parameterValues[i] = iterator.next().getValue(manager);
+ parameterValues[i] = iterator.next().getValue();
}
return parameterValues;
}
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -135,9 +135,9 @@
* @param manager The Web Beans manager
* @return The current value
*/
- public T getValue(ManagerImpl manager)
+ public T getValue()
{
- return manager.getInstanceByType(getType(),
getMetaAnnotationsAsArray(BindingType.class));
+ return ManagerImpl.instance().getInstanceByType(getType(),
getMetaAnnotationsAsArray(BindingType.class));
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -199,12 +199,12 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
*/
- public T newInstance(ManagerImpl manager)
+ public T newInstance()
{
try
{
// TODO: more details in the exceptions
- return getDelegate().newInstance(getParameterValues(parameters, manager));
+ return getDelegate().newInstance(getParameterValues(parameters));
}
catch (IllegalArgumentException e)
{
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -121,9 +121,9 @@
* @see org.jboss.webbeans.introspector.AnnotatedField#inject(Object,
* ManagerImpl)
*/
- public void inject(Object instance, ManagerImpl manager)
+ public void inject(Object instance)
{
- Reflections.setAndWrap(getDelegate(), instance, getValue(manager));
+ Reflections.setAndWrap(getDelegate(), instance, getValue());
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -236,9 +236,9 @@
* Object)
*/
@SuppressWarnings("unchecked")
- public T invoke(ManagerImpl manager, Object instance)
+ public T invoke(Object instance)
{
- return (T) Reflections.invokeAndWrap(getDelegate(), instance,
getParameterValues(parameters, manager));
+ return (T) Reflections.invokeAndWrap(getDelegate(), instance,
getParameterValues(parameters));
}
/**
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -130,9 +130,9 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedParameter
*/
- public T getValue(ManagerImpl manager)
+ public T getValue()
{
- return manager.getInstanceByType(getType(),
getMetaAnnotationsAsArray(BindingType.class));
+ return ManagerImpl.instance().getInstanceByType(getType(),
getMetaAnnotationsAsArray(BindingType.class));
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/BeanFactory.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -19,7 +19,6 @@
import java.lang.reflect.Method;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.EventBean;
@@ -45,9 +44,9 @@
* @param manager The Web Beans manager
* @return A Web Bean
*/
- public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz,
ManagerImpl manager)
+ public static <T> SimpleBean<T> createSimpleBean(Class<T> clazz)
{
- return new SimpleBean<T>(clazz, manager);
+ return new SimpleBean<T>(clazz);
}
/**
@@ -58,9 +57,9 @@
* @param manager The Web Beans manager
* @return A Web Bean
*/
- public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T>
clazz, ManagerImpl manager)
+ public static <T> XmlSimpleBean<T> createXmlSimpleBean(Class<T>
clazz)
{
- return new XmlSimpleBean<T>(clazz, manager);
+ return new XmlSimpleBean<T>(clazz);
}
/**
@@ -71,9 +70,9 @@
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T>
clazz, ManagerImpl manager)
+ public static <T> EnterpriseBean<T> createEnterpriseBean(Class<T>
clazz)
{
- return new EnterpriseBean<T>(clazz, manager);
+ return new EnterpriseBean<T>(clazz);
}
/**
@@ -84,9 +83,9 @@
* @param manager The Web Beans manager
* @return An Enterprise Web Bean
*/
- public static <T> XmlEnterpriseBean<T>
createXmlEnterpriseBean(Class<T> clazz, ManagerImpl manager)
+ public static <T> XmlEnterpriseBean<T>
createXmlEnterpriseBean(Class<T> clazz)
{
- return new XmlEnterpriseBean<T>(clazz, manager);
+ return new XmlEnterpriseBean<T>(clazz);
}
/**
@@ -99,9 +98,9 @@
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T>
createProducerMethodBean(Class<T> type, Method method, ManagerImpl manager,
AbstractClassBean<?> declaringBean)
+ public static <T> ProducerMethodBean<T>
createProducerMethodBean(Class<T> type, Method method, AbstractClassBean<?>
declaringBean)
{
- return new ProducerMethodBean<T>(method, declaringBean, manager);
+ return new ProducerMethodBean<T>(method, declaringBean);
}
/**
@@ -113,9 +112,9 @@
* @param declaringBean The declaring bean abstraction
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T>
createProducerMethodBean(Class<T> type, AnnotatedMethod<T> method, ManagerImpl
manager, AbstractClassBean<?> declaringBean)
+ public static <T> ProducerMethodBean<T>
createProducerMethodBean(Class<T> type, AnnotatedMethod<T> method,
AbstractClassBean<?> declaringBean)
{
- return new ProducerMethodBean<T>(method, declaringBean, manager);
+ return new ProducerMethodBean<T>(method, declaringBean);
}
/**
@@ -128,9 +127,9 @@
* @param declaringBean The declaring bean abstraction
* @return An event Web Bean
*/
- public static <T> EventBean<T> createEventBean(Class<T> type,
AnnotatedField<T> field, ManagerImpl manager)
+ public static <T> EventBean<T> createEventBean(Class<T> type,
AnnotatedField<T> field)
{
- return new EventBean<T>(field, manager);
+ return new EventBean<T>(field);
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/ConcurrentCache.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -26,6 +26,7 @@
return (Future<T>) super.get(key);
}
+ @SuppressWarnings("unchecked")
public <T extends V> T getValue(K key)
{
Future<T> value = (Future<T>) map.get(key);
@@ -57,6 +58,7 @@
}
}
+ @SuppressWarnings("unchecked")
public <E> E putIfAbsent(K key, Callable<E> callable)
{
Future<E> value = (Future<E>) map.get(key);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/JNDI.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.util;
+
/**
* Provides JNDI access abstraction
*
@@ -35,7 +36,7 @@
{
return lookup(name, Object.class);
}
-
+
/**
* Typed JNDI lookup
*
@@ -48,5 +49,10 @@
{
return null;
}
-
+
+ public static void set(String key, Object value)
+ {
+ // TODO stub
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -430,6 +430,8 @@
}
catch (IllegalArgumentException e)
{
+ System.out.println(method.getDeclaringClass() + " " +
instance.getClass());
+ e.printStackTrace();
throw new ExecutionException("Error invoking method " +
method.getName() + " on " + method.getDeclaringClass(), e);
}
catch (IllegalAccessException e)
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Strings.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -18,9 +18,7 @@
package org.jboss.webbeans.util;
import java.beans.Introspector;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
@@ -124,18 +122,4 @@
return buffer.toString();
}
- public static void main(String[] args)
- {
- Map map = new HashMap<String, Collection<?>>();
- Collection a = new ArrayList<String>();
- a.add("1");
- a.add("2");
- map.put("foo", a);
- Collection b = new ArrayList<String>();
- b.add("3");
- b.add("4");
- map.put("bar", b);
- System.out.println(mapToString("Header: ", map));
- }
-
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/examples/Tests.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -29,11 +29,11 @@
private void setupGameGenerator() throws NoSuchMethodException
{
- SimpleBean<Game> gameBean = BeanFactory.createSimpleBean(Game.class,
manager);
- SimpleBean<Generator> generatorBean =
BeanFactory.createSimpleBean(Generator.class, manager);
+ SimpleBean<Game> gameBean = BeanFactory.createSimpleBean(Game.class);
+ SimpleBean<Generator> generatorBean =
BeanFactory.createSimpleBean(Generator.class);
Method method = Generator.class.getDeclaredMethod("next");
method.setAccessible(true);
- ProducerMethodBean<Integer> nextBean =
BeanFactory.createProducerMethodBean(int.class, method, manager, generatorBean);
+ ProducerMethodBean<Integer> nextBean =
BeanFactory.createProducerMethodBean(int.class, method, generatorBean);
manager.addBean(gameBean);
manager.addBean(generatorBean);
@@ -68,10 +68,10 @@
private void setupTextTranslator()
{
- SimpleBean<SentenceParser> spBean =
BeanFactory.createSimpleBean(SentenceParser.class, manager);
- SimpleBean<SentenceTranslator> stBean =
BeanFactory.createSimpleBean(SentenceTranslator.class, manager);
- SimpleBean<MockSentenceTranslator> mstBean =
BeanFactory.createSimpleBean(MockSentenceTranslator.class, manager);
- SimpleBean<TextTranslator> ttBean =
BeanFactory.createSimpleBean(TextTranslator.class, manager);
+ SimpleBean<SentenceParser> spBean =
BeanFactory.createSimpleBean(SentenceParser.class);
+ SimpleBean<SentenceTranslator> stBean =
BeanFactory.createSimpleBean(SentenceTranslator.class);
+ SimpleBean<MockSentenceTranslator> mstBean =
BeanFactory.createSimpleBean(MockSentenceTranslator.class);
+ SimpleBean<TextTranslator> ttBean =
BeanFactory.createSimpleBean(TextTranslator.class);
manager.addBean(spBean);
manager.addBean(stBean);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -3,6 +3,7 @@
import javax.webbeans.Production;
import javax.webbeans.Standard;
+import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
@@ -21,7 +22,8 @@
public final void before()
{
manager = new MockManagerImpl();
- bootstrap = new MockBootstrap(manager);
+ ManagerImpl.setInstance(manager);
+ bootstrap = new MockBootstrap();
init();
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -31,7 +31,7 @@
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
{
- SimpleBean<Order> order = createSimpleBean(Order.class, manager);
+ SimpleBean<Order> order = createSimpleBean(Order.class);
assert order.getBindingTypes().size() == 1;
order.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -58,7 +58,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testBindingTypesDeclaredInJava()
{
- SimpleBean<Cat> cat = createSimpleBean(Cat.class, manager);
+ SimpleBean<Cat> cat = createSimpleBean(Cat.class);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
@@ -66,7 +66,7 @@
@Test @SpecAssertion(section="2.3.3")
public void testMultipleBindingTypes()
{
- SimpleBean<?> model = createSimpleBean(Cod.class, manager);
+ SimpleBean<?> model = createSimpleBean(Cod.class);
assert model.getBindingTypes().size() == 2;
}
@@ -111,7 +111,7 @@
@Test(groups={"stub", "webbeansxml"})
@SpecAssertion(section={"2.3.4", "2.3.1"})
public void testDefaultBindingTypeDeclaredInXml()
{
- SimpleBean<?> model = createSimpleBean(Tuna.class, manager);
+ SimpleBean<?> model = createSimpleBean(Tuna.class);
assert model.getBindingTypes().size() == 1;
assert model.getBindingTypes().contains(new CurrentAnnotationLiteral());
assert false;
@@ -122,11 +122,11 @@
@Test(groups={"injection", "producerMethod"})
@SpecAssertion(section="2.3.5")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(createProducerMethodBean(Tarantula.class, method, manager,
spiderProducer));
- Barn barn = createSimpleBean(Barn.class, manager).create();
+ manager.addBean(createProducerMethodBean(Tarantula.class, method, spiderProducer));
+ Barn barn = createSimpleBean(Barn.class).create();
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
@@ -146,12 +146,12 @@
@Test(groups={"injection", "producerMethod"})
public void testMethodWithBindingAnnotationsOnParametersAreInjected() throws
Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- manager.addBean(createProducerMethodBean(Tarantula.class, method, manager,
spiderProducer));
+ manager.addBean(createProducerMethodBean(Tarantula.class, method,
spiderProducer));
method = SpiderProducer.class.getMethod("produceSpiderFromInjection",
Tarantula.class);
- ProducerMethodBean<Spider> spiderBean =
createProducerMethodBean(Spider.class, method, manager, spiderProducer);
+ ProducerMethodBean<Spider> spiderBean =
createProducerMethodBean(Spider.class, method, spiderProducer);
Spider spider = spiderBean.create();
assert spider != null;
assert spider instanceof DefangedTarantula;
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-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ClientProxyTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -26,7 +26,7 @@
@SpecAssertion(section = { "4.4", "4.8" })
public void testReflectionsUsedForNormalScope()
{
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
Tuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -36,7 +36,7 @@
@SpecAssertion(section = { "4.4", "4.8" })
public void testReflectionsNotUsedForPseudoScope()
{
- Bean<Fox> foxBean = BeanFactory.createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = BeanFactory.createSimpleBean(Fox.class);
Fox fox = manager.getInstance(foxBean);
assert !Reflections.isProxy(fox);
}
@@ -57,7 +57,7 @@
@SpecAssertion(section = "4.4")
public void testSimpleWebBeanReflectionsIsSerializable() throws IOException,
ClassNotFoundException
{
- Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class,
manager);
+ Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -71,7 +71,7 @@
@SpecAssertion(section = "4.4.1")
public void testInjectionPointWithUnproxyableTypeWhichResolvesToNormalScopedWebBean()
{
- Bean<FinalTuna> tunaBean = BeanFactory.createSimpleBean(FinalTuna.class,
manager);
+ Bean<FinalTuna> tunaBean = BeanFactory.createSimpleBean(FinalTuna.class);
manager.addBean(tunaBean);
FinalTuna tuna = manager.getInstanceByType(FinalTuna.class);
assert false;
@@ -81,7 +81,7 @@
@SpecAssertion(section = "4.4.2")
public void testReflectionsInvocation()
{
- Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class,
manager);
+ Bean<TunedTuna> tunaBean = BeanFactory.createSimpleBean(TunedTuna.class);
manager.addBean(tunaBean);
TunedTuna tuna = manager.getInstance(tunaBean);
assert Reflections.isProxy(tuna);
@@ -90,7 +90,7 @@
@Test(groups = "Reflections", expectedExceptions=DefinitionException.class)
public void testGettingUnknownBeanFails() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
Tuna tuna = manager.getInstance(tunaBean);
assert false;
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/CommonWebBeanTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -29,41 +29,41 @@
@Test @SpecAssertion(section="2")
public void testApiTypesNonEmpty()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getTypes().size() > 0;
}
@Test @SpecAssertion(section="2")
public void testBindingTypesNonEmpty()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getBindingTypes().size() > 0;
}
@Test @SpecAssertion(section="2")
public void testHasScopeType()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2")
public void testHasDeploymentType()
{
- Bean<?> model = createSimpleBean(RedSnapper.class, manager);
+ Bean<?> model = createSimpleBean(RedSnapper.class);
assert model.getDeploymentType().equals(Production.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="4.2")
public void testIsNullable() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducerBean =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducerBean =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducerBean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- Bean<Integer> bean = createProducerMethodBean(int.class, method, manager,
spiderProducerBean);
+ Bean<Integer> bean = createProducerMethodBean(int.class, method,
spiderProducerBean);
assert !bean.isNullable();
method = SpiderProducer.class.getMethod("makeASpider");
- Bean<Spider> spiderBean = createProducerMethodBean(Spider.class, method,
manager, spiderProducerBean);
+ Bean<Spider> spiderBean = createProducerMethodBean(Spider.class, method,
spiderProducerBean);
assert spiderBean.isNullable();
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -66,7 +66,7 @@
//annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
//AnnotatedClass<Tuna> annotatedItem = new
SimpleAnnotatedClass<Tuna>(Tuna.class, annotations);
// TODO This should test a real class
- tuna = createSimpleBean(Tuna.class, manager);
+ tuna = createSimpleBean(Tuna.class);
om = new
AnnotatedMethodImpl<Object>(AnObserver.class.getMethod("observe", new
Class[] { Event.class }), new AnnotatedClassImpl<AnObserver>(AnObserver.class));
AnObserver observerInstance = new AnObserver();
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DependentContextTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -25,8 +25,8 @@
@Test(groups={"contexts", "injection"})
@SpecAssertion(section="8.3")
public void testInstanceNotSharedBetweenInjectionPoints()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert !foxRun.fox.equals(foxRun.anotherFox);
@@ -41,10 +41,10 @@
@Test(groups={"contexts", "producerMethod"})
@SpecAssertion(section="8.3")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean =
createProducerMethodBean(Tarantula.class, method, manager, spiderProducer);
+ ProducerMethodBean<Tarantula> tarantulaBean =
createProducerMethodBean(Tarantula.class, method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
Tarantula tarantula2 = tarantulaBean.create();
assert tarantula != null;
@@ -61,7 +61,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.3")
public void testContextGetWithCreateTrueReturnsNewInstance()
{
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
DependentContext context = new DependentContext();
context.setActive(true);
@@ -72,7 +72,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.3")
public void testContextGetWithCreateFalseReturnsNull()
{
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
DependentContext context = new DependentContext();
context.setActive(true);
@@ -102,8 +102,8 @@
public void testContextIsActiveDuringBeanCreation()
{
// Slightly roundabout, but I can't see a better way to test atm
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
@@ -118,8 +118,8 @@
@Test(groups={"contexts", "injection"})
@SpecAssertion(section="8.3")
public void testContextIsActiveDuringInjection()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox != null;
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeploymentTypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -25,7 +25,7 @@
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="2.5.1")
public void testNonBuiltInComponentUsesStandard()
{
- createSimpleBean(Gazelle.class, manager);
+ createSimpleBean(Gazelle.class);
}
@Test(groups={"stub", "annotationDefinition"})
@SpecAssertion(section="2.5.2")
@@ -49,7 +49,7 @@
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="2.5.3")
public void testTooManyDeploymentTypes()
{
- createSimpleBean(BeanWithTooManyDeploymentTypes.class, manager);
+ createSimpleBean(BeanWithTooManyDeploymentTypes.class);
}
@Test(groups={"stub", "webbeansxml"})
@SpecAssertion(section="2.5.4")
@@ -87,7 +87,7 @@
@Test @SpecAssertion(section="2.5.5")
public void testHighestPrecedenceDeploymentTypeFromStereotype()
{
- Bean<?> bean = createSimpleBean(Rhinoceros.class, manager);
+ Bean<?> bean = createSimpleBean(Rhinoceros.class);
assert bean.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -107,7 +107,7 @@
{
manager.setEnabledDeploymentTypes(Standard.class, AnotherDeploymentType.class,
HornedAnimalDeploymentType.class);
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
manager.addBean(bean);
manager.getInstanceByType(RedSnapper.class);
}
@@ -146,7 +146,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testWebBeanDeploymentTypeOverridesStereotype()
{
- Bean<Reindeer> bean = createSimpleBean(Reindeer.class, manager);
+ Bean<Reindeer> bean = createSimpleBean(Reindeer.class);
assert bean.getDeploymentType().equals(Production.class);
}
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventManagerTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -36,7 +36,7 @@
@Test(groups = "observerMethod")
public void testAddObserver()
{
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
eventManager.addObserver(observer, DangerCall.class);
DangerCall event = new DangerCall();
@@ -61,7 +61,7 @@
@Test(groups = { "observerMethod" })
public void testRemoveObserver()
{
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
eventManager.addObserver(observer, DangerCall.class);
eventManager.removeObserver(observer, DangerCall.class);
@@ -166,7 +166,7 @@
// }
//
// };
- EventManager eventManager = new EventManager(manager);
+ EventManager eventManager = new EventManager();
Observer<DangerCall> observer = new AnObserver<DangerCall>();
try
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -4,24 +4,12 @@
import java.util.ArrayList;
import java.util.List;
-import javax.webbeans.DuplicateBindingTypeException;
-import javax.webbeans.Event;
import javax.webbeans.Observer;
import javax.webbeans.Standard;
-import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
-import org.jboss.webbeans.test.annotations.Synchronous;
-import org.jboss.webbeans.test.annotations.Tame;
-import org.jboss.webbeans.test.beans.DangerCall;
-import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.RiverFishStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
import org.jboss.webbeans.test.mock.MockManagerImpl;
-import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
/**
* Tests for the implementation of an Event component.
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InitializerMethodTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -23,7 +23,7 @@
@Test(expectedExceptions=DefinitionException.class,
groups="initializerMethod") @SpecAssertion(section="3.7")
public void testStaticInitializerMethodNotAllowed()
{
- createSimpleBean(Dottrel.class, manager);
+ createSimpleBean(Dottrel.class);
}
@Test(groups={"stub", "initializerMethod", "servlet"})
@SpecAssertion(section="3.7")
@@ -65,10 +65,10 @@
@Test(groups={"initializerMethod"}) @SpecAssertion(section={"3.7",
"5.3", "3.7.2", "3.7.3"})
public void testMultipleInitializerMethodsAreCalled()
{
- manager.addBean(createSimpleBean(Fox.class, manager));
- manager.addBean(createSimpleBean(Chicken.class, manager));
+ manager.addBean(createSimpleBean(Fox.class));
+ manager.addBean(createSimpleBean(Chicken.class));
- Bean<ChickenHutch> chickenHutchBean = createSimpleBean(ChickenHutch.class,
manager);
+ Bean<ChickenHutch> chickenHutchBean = createSimpleBean(ChickenHutch.class);
ChickenHutch chickenHutch = chickenHutchBean.create();
assert chickenHutch.fox != null;
assert chickenHutch.chicken != null;
@@ -77,25 +77,25 @@
@Test(groups="initializerMethod",
expectedExceptions=DefinitionException.class) @SpecAssertion(section={"3.7.1",
"3.4.2"})
public void testInitializerMethodAnnotatedProduces()
{
- createSimpleBean(Pheasant.class, manager);
+ createSimpleBean(Pheasant.class);
}
@Test(groups="initializerMethod",
expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodAnnotatedDestructor()
{
- createSimpleBean(Shrike.class, manager);
+ createSimpleBean(Shrike.class);
}
@Test(groups="initializerMethod",
expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodHasParameterAnnotatedDisposes()
{
- createSimpleBean(Capercaillie.class, manager);
+ createSimpleBean(Capercaillie.class);
}
@Test(groups="initializerMethod",
expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.7.1")
public void testInitializerMethodHasParameterAnnotatedObserves()
{
- createSimpleBean(Grouse.class, manager);
+ createSimpleBean(Grouse.class);
}
@Test(groups={"stub", "initializerMethod",
"webbeansxml"}) @SpecAssertion(section="3.7.2")
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectionTests.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -32,10 +32,10 @@
@Test(groups={"injection", "producerMethod"})
@SpecAssertion(section="4.2")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
- Bean<SpiderNest> spiderNestBean = createSimpleBean(SpiderNest.class,
manager);
- manager.addBean(createProducerMethodBean(Integer.class,
SpiderProducer.class.getMethod("getWolfSpiderSize"), manager, spiderProducer));
+ Bean<SpiderNest> spiderNestBean = createSimpleBean(SpiderNest.class);
+ manager.addBean(createProducerMethodBean(Integer.class,
SpiderProducer.class.getMethod("getWolfSpiderSize"), spiderProducer));
SpiderNest spiderNest = spiderNestBean.create();
assert spiderNest.numberOfSpiders != null;
assert spiderNest.numberOfSpiders.equals(4);
@@ -44,17 +44,17 @@
@Test(groups={"injection", "producerMethod"},
expectedExceptions=NullableDependencyException.class)
@SpecAssertion(section="4.2")
public void testPrimitiveInjectionPointResolvesToNullableWebBean() throws Exception
{
- Bean<FarmHouse> farmHouseBean = createSimpleBean(FarmHouse.class, manager);
- SimpleBean<FarmHouseProducer> farmHouseProducerBean =
createSimpleBean(FarmHouseProducer.class, manager);
- manager.addBean(createProducerMethodBean(Integer.class,
FarmHouseProducer.class.getMethod("getNumberOfBedrooms"), manager,
farmHouseProducerBean));
+ Bean<FarmHouse> farmHouseBean = createSimpleBean(FarmHouse.class);
+ SimpleBean<FarmHouseProducer> farmHouseProducerBean =
createSimpleBean(FarmHouseProducer.class);
+ manager.addBean(createProducerMethodBean(Integer.class,
FarmHouseProducer.class.getMethod("getNumberOfBedrooms"),
farmHouseProducerBean));
farmHouseBean.create();
}
@Test(groups={"injection", "clientProxy"},
expectedExceptions=ContextNotActiveException.class)
@SpecAssertion(section="4.3")
public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class,
manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.tuna != null;
@@ -66,8 +66,8 @@
@Test(groups="injection") @SpecAssertion(section="4.3")
public void testInvokeDependentScopeWhenContextNotActive()
{
- Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class, manager);
- Bean<Fox> foxBean = createSimpleBean(Fox.class, manager);
+ Bean<FoxRun> foxRunBean = createSimpleBean(FoxRun.class);
+ Bean<Fox> foxBean = createSimpleBean(Fox.class);
manager.addBean(foxBean);
FoxRun foxRun = foxRunBean.create();
assert foxRun.fox.getName().equals("gavin");
@@ -76,8 +76,8 @@
@Test(groups="injection", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.6")
public void testInjectingStaticField()
{
- SimpleBean<BeanWithStaticBoundField> bean =
createSimpleBean(BeanWithStaticBoundField.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<BeanWithStaticBoundField> bean =
createSimpleBean(BeanWithStaticBoundField.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
BeanWithStaticBoundField instance = bean.create();
}
@@ -85,8 +85,8 @@
@Test(groups="injection",expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.6")
public void testInjectingFinalField()
{
- SimpleBean<BeanWithFinalBoundField> bean =
createSimpleBean(BeanWithFinalBoundField.class, manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<BeanWithFinalBoundField> bean =
createSimpleBean(BeanWithFinalBoundField.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
BeanWithFinalBoundField instance = bean.create();
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByNameTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -29,8 +29,8 @@
public void testNoWebBeansFound() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -41,9 +41,9 @@
public void testAmbiguousDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -54,13 +54,13 @@
@Test(groups={"resolution", "beanLifecycle"})
@SpecAssertion(section="4.10.1")
public void testGetInstanceByName()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
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-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InstantiationByTypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -35,7 +35,7 @@
@Test(groups={"resolution", "beanLifecycle"})
@SpecAssertion(section="4.9")
public void testCurrentBindingTypeAssumed()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
assert manager.getInstanceByType(Tuna.class) != null;
}
@@ -56,9 +56,9 @@
public void testAmbiguousDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -70,9 +70,9 @@
public void testUnsatisfiedDependencies() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -84,7 +84,7 @@
public void testUnproxyableDependencies() throws Exception
{
AnnotatedField<Plaice> plaiceField = new
AnnotatedFieldImpl<Plaice>(PlaiceFarm.class.getDeclaredField("plaice"),
fishFarmClass);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
manager.getInstanceByType(Plaice.class, new
AnnotationLiteral<Whitefish>(){});
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/MyTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test;
+
+import javax.webbeans.Event;
+import javax.webbeans.Observable;
+import javax.webbeans.RequestScoped;
+
+@RequestScoped
+public class MyTest
+{
+ @Observable Event<Param> paramEvent;
+}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NameTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -24,7 +24,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- SimpleBean<Moose> moose = createSimpleBean(Moose.class, manager);
+ SimpleBean<Moose> moose = createSimpleBean(Moose.class);
assert moose.getName().equals("aMoose");
}
@@ -80,7 +80,7 @@
@Test @SpecAssertion(section={"2.6.3", "3.2.7"})
public void testDefaultNamed()
{
- SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class, manager);
+ SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -108,7 +108,7 @@
@Test @SpecAssertion(section={"2.6.3", "2.7"})
public void testSterotypeDefaultsName()
{
- SimpleBean<RedSnapper> model = createSimpleBean(RedSnapper.class, manager);
+ SimpleBean<RedSnapper> model = createSimpleBean(RedSnapper.class);
assert model.getMergedStereotypes().isBeanNameDefaulted();
assert model.getName().equals("redSnapper");
}
@@ -116,14 +116,14 @@
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInJava()
{
- SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
@Test @SpecAssertion(section="2.6.4")
public void testNotNamedInXml()
{
- SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> model = createSimpleBean(SeaBass.class);
assert model.getName() == null;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NewEventTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -3,10 +3,15 @@
import java.lang.annotation.Annotation;
import java.util.Set;
+import javax.webbeans.Event;
import javax.webbeans.Observer;
import javax.webbeans.TypeLiteral;
+import org.jboss.webbeans.bean.EventBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.test.bindings.RoleBinding;
+import org.jboss.webbeans.util.BeanFactory;
import org.testng.annotations.Test;
/**
@@ -30,6 +35,17 @@
}
}
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void create() {
+ SimpleBean<MyTest> myTestBean = BeanFactory.createSimpleBean(MyTest.class);
+ for (AnnotatedField<Object> field : myTestBean.getEventFields()) {
+ EventBean eventBean = BeanFactory.createEventBean(field.getType(), field);
+ @SuppressWarnings("unused")
+ Event<Param> event = eventBean.create();
+ }
+ }
@Test(groups={"stub", "events"})
@SpecAssertion(section="7.1")
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/NormalContextTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -40,13 +40,13 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateFalseReturnsNull() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
assert context.get(tunaBean, false) == null;
}
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testGetWithCreateTrueReturnsBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
assert context.get(tunaBean, true) != null;
}
@@ -59,7 +59,7 @@
@Test(groups="contexts") @SpecAssertion(section="8.1")
public void testReturnsCorrectExistingBean() {
- Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = BeanFactory.createSimpleBean(Tuna.class);
Tuna firstTuna = context.get(tunaBean, true);
Tuna secondTuna = context.get(tunaBean, false);
assert firstTuna == secondTuna;
@@ -67,10 +67,10 @@
@Test(groups={"contexts", "producerMethod"})
@SpecAssertion(section="8.1")
public void testProducerMethodReturningNullOK() throws SecurityException,
NoSuchMethodException {
- SimpleBean<SpiderProducer> producer = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> producer =
createSimpleBean(SpiderProducer.class);
manager.addBean(producer);
Method nullProducer = SpiderProducer.class.getMethod("produceShelob");
- ProducerMethodBean<Tarantula> shelobBean =
createProducerMethodBean(Tarantula.class, nullProducer, manager, producer);
+ ProducerMethodBean<Tarantula> shelobBean =
createProducerMethodBean(Tarantula.class, nullProducer, producer);
assert shelobBean.create() == null;
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -63,7 +63,7 @@
//annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
//AnnotatedClass<Tuna> annotatedItem = new
SimpleAnnotatedClass<Tuna>(Tuna.class, annotations);
- tuna = createSimpleBean(Tuna.class, manager);
+ tuna = createSimpleBean(Tuna.class);
om = new
AnnotatedMethodImpl<Object>(AnObserver.class.getMethod("observe", new
Class[] { SampleEvent.class }), new
AnnotatedClassImpl<AnObserver>(AnObserver.class));
}
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java
(rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/Param.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test;
+
+public class Param
+{
+
+}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanLifecycleTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,10 +21,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="5.6")
public void testProducerMethodBeanCreate() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaBean =
createProducerMethodBean(Tarantula.class, method, manager, spiderProducer);
+ ProducerMethodBean<Tarantula> tarantulaBean =
createProducerMethodBean(Tarantula.class, method, spiderProducer);
Tarantula tarantula = tarantulaBean.create();
assert tarantula != null;
}
@@ -54,10 +54,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"3.4",
"5.6", "8.3"})
public void testProducerMethodReturnsNullIsDependent() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducer =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducer);
Method method = SpiderProducer.class.getMethod("getNullSpider");
- ProducerMethodBean<Spider> spiderBean =
createProducerMethodBean(Spider.class, method, manager, spiderProducer);
+ ProducerMethodBean<Spider> spiderBean =
createProducerMethodBean(Spider.class, method, spiderProducer);
Spider spider = spiderBean.create();
assert spider == null;
}
@@ -65,10 +65,10 @@
@Test(groups="producerMethod",
expectedExceptions=IllegalProductException.class) @SpecAssertion(section={"3.4",
"5.6"})
public void testProducerMethodReturnsNullIsNotDependent() throws Exception
{
- SimpleBean<BrokenSpiderProducer> spiderProducer =
createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> spiderProducer =
createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(spiderProducer);
Method method =
BrokenSpiderProducer.class.getMethod("getRequestScopedSpider");
- createProducerMethodBean(Spider.class, method, manager, spiderProducer).create();
+ createProducerMethodBean(Spider.class, method, spiderProducer).create();
}
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodBeanModelTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -34,20 +34,20 @@
@Test(groups="producerMethod") @SpecAssertion(section="2.5.3")
public void testProducerMethodInheritsDeploymentTypeOfDeclaringWebBean() throws
Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, bean);
tarantulaModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testStaticMethod() throws Exception
{
- SimpleBean<BeanWithStaticProducerMethod> bean =
createSimpleBean(BeanWithStaticProducerMethod.class, manager);
+ SimpleBean<BeanWithStaticProducerMethod> bean =
createSimpleBean(BeanWithStaticProducerMethod.class);
manager.addBean(bean);
Method method =
BeanWithStaticProducerMethod.class.getMethod("getString");
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups={"stub", "producerMethod",
"enterpriseBeans", "stub"},
expectedExceptions=DefinitionException.class) @SpecAssertion(section="3.4")
@@ -59,28 +59,28 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4")
public void testParameterizedReturnType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaverSpider");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithWildcard() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method =
SpiderProducer.class.getMethod("getAnotherFunnelWeaver");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testParameterizedReturnTypeWithTypeParameter() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getFunnelWeaver");
- createProducerMethodBean(FunnelWeaver.class, method, manager, bean);
+ createProducerMethodBean(FunnelWeaver.class, method, bean);
}
@Test(groups={"stub", "producerMethod", "deployment"})
@SpecAssertion(section="3.4")
@@ -92,10 +92,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"3.4",
"2.3.1"})
public void testDefaultBindingType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getBindingTypes().size() == 1;
assert
tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -103,10 +103,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForClassReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getTypes().size() == 6;
assert tarantulaModel.getTypes().contains(Tarantula.class);
assert tarantulaModel.getTypes().contains(DeadlySpider.class);
@@ -119,10 +119,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForInterfaceReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("makeASpider");
- ProducerMethodBean<Animal> animalModel =
createProducerMethodBean(Animal.class, method, manager, bean);
+ ProducerMethodBean<Animal> animalModel =
createProducerMethodBean(Animal.class, method, bean);
assert animalModel.getTypes().size() == 2;
assert animalModel.getTypes().contains(Animal.class);
assert animalModel.getTypes().contains(Object.class);
@@ -131,10 +131,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForPrimitiveReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getWolfSpiderSize");
- ProducerMethodBean<Integer> intModel = createProducerMethodBean(int.class,
method, manager, bean);
+ ProducerMethodBean<Integer> intModel = createProducerMethodBean(int.class,
method, bean);
assert intModel.getTypes().size() == 2;
assert intModel.getTypes().contains(int.class);
assert intModel.getTypes().contains(Object.class);
@@ -143,10 +143,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.1")
public void testApiTypeForArrayTypeReturn() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getSpiders");
- ProducerMethodBean<Spider[]> spidersModel =
createProducerMethodBean(Spider[].class, method, manager, bean);
+ ProducerMethodBean<Spider[]> spidersModel =
createProducerMethodBean(Spider[].class, method, bean);
assert spidersModel.getTypes().size() == 2;
assert spidersModel.getTypes().contains(Spider[].class);
assert spidersModel.getTypes().contains(Object.class);
@@ -155,10 +155,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testBindingType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, manager, bean);
+ ProducerMethodBean<Tarantula> tarantulaModel =
createProducerMethodBean(Tarantula.class, method, bean);
assert tarantulaModel.getBindingTypes().size() == 1;
assert
tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
}
@@ -166,10 +166,10 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testScopeType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodBean<DaddyLongLegs> daddyLongLegsModel =
createProducerMethodBean(DaddyLongLegs.class, method, manager, bean);
+ ProducerMethodBean<DaddyLongLegs> daddyLongLegsModel =
createProducerMethodBean(DaddyLongLegs.class, method, bean);
assert daddyLongLegsModel.getScopeType().equals(RequestScoped.class);
// TODO Inherit scope from returned web bean?
@@ -178,58 +178,58 @@
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDeploymentType() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- ProducerMethodBean<LadybirdSpider> ladybirdSpiderModel =
createProducerMethodBean(LadybirdSpider.class, method, manager, bean);
+ ProducerMethodBean<LadybirdSpider> ladybirdSpiderModel =
createProducerMethodBean(LadybirdSpider.class, method, bean);
assert
ladybirdSpiderModel.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testNamedMethod() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- ProducerMethodBean<BlackWidow> blackWidowSpiderModel =
createProducerMethodBean(BlackWidow.class, method, manager, bean);
+ ProducerMethodBean<BlackWidow> blackWidowSpiderModel =
createProducerMethodBean(BlackWidow.class, method, bean);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@Test(groups="producerMethod") @SpecAssertion(section="3.4.2")
public void testDefaultNamedMethod() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodBean<DaddyLongLegs> daddyLongLegsSpiderModel =
createProducerMethodBean(DaddyLongLegs.class, method, manager, bean);
+ ProducerMethodBean<DaddyLongLegs> daddyLongLegsSpiderModel =
createProducerMethodBean(DaddyLongLegs.class, method, bean);
assert
daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testProducerMethodAnnotatedDestructor() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("destroy");
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedDisposes() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("dispose",
String.class);
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups="producerMethod", expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.4")
public void testProducerMethodWithParameterAnnotatedObserves() throws Exception
{
- SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class, manager);
+ SimpleBean<BrokenSpiderProducer> bean =
createSimpleBean(BrokenSpiderProducer.class);
manager.addBean(bean);
Method method = BrokenSpiderProducer.class.getMethod("observe",
String.class);
- createProducerMethodBean(String.class, method, manager, bean);
+ createProducerMethodBean(String.class, method, bean);
}
@Test(groups={"stub", "disposalMethod"})
@SpecAssertion(section="3.3.4")
@@ -295,10 +295,10 @@
@Test(groups="producerMethod") @SpecAssertion(section={"2.7.2",
"3.4.2"})
public void testStereotype() throws Exception
{
- SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class,
manager);
+ SimpleBean<SpiderProducer> bean = createSimpleBean(SpiderProducer.class);
manager.addBean(bean);
Method method = SpiderProducer.class.getMethod("produceWolfSpider");
- ProducerMethodBean<WolfSpider> wolfSpiderModel =
createProducerMethodBean(WolfSpider.class, method, manager, bean);
+ ProducerMethodBean<WolfSpider> wolfSpiderModel =
createProducerMethodBean(WolfSpider.class, method, bean);
assert wolfSpiderModel.getMergedStereotypes().getRequiredTypes().size() == 1;
assert
wolfSpiderModel.getMergedStereotypes().getRequiredTypes().contains(Animal.class);
assert wolfSpiderModel.getScopeType().equals(RequestScoped.class);
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-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByNameTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -39,13 +39,13 @@
public void testNamedBasedResolution()
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(tunaBean);
manager.addBean(codBean);
@@ -70,8 +70,8 @@
@Test(groups="resolution") @SpecAssertion(section="4.10.1")
public void testNoWebBeansFound() throws Exception
{
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
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-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ResolutionByTypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -64,7 +64,7 @@
public void testSingleApiTypeWithCurrent() throws Exception
{
AnnotatedField<Tuna> tunaField = new
AnnotatedFieldImpl<Tuna>(FishFarm.class.getDeclaredField("tuna"),
fishFarmClass);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
Set<Bean<Tuna>> possibleTargets = manager.resolveByType(tunaField);
assert possibleTargets.size() == 1;
@@ -87,9 +87,9 @@
public void testOneBindingType() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
manager.addBean(soleBean);
@@ -104,9 +104,9 @@
{
AnnotatedField<Animal> whiteChunkyFishField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("realChunkyWhiteFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -120,8 +120,8 @@
public void testMultipleApiTypeWithCurrent() throws Exception
{
AnnotatedField<Animal> animalField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("animal"),
fishFarmClass);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
manager.addBean(seaBassBean);
manager.addBean(haddockBean);
Set<Bean<Animal>> possibleTargets =
manager.resolveByType(animalField);
@@ -133,10 +133,10 @@
@Test(groups="resolution") @SpecAssertion(section={"4.9.2",
"4.9.4"})
public void testResolveByType() throws Exception
{
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class, manager);
- Bean<Haddock> haddockBean = createSimpleBean(Haddock.class, manager);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<SeaBass> seaBassBean = createSimpleBean(SeaBass.class);
+ Bean<Haddock> haddockBean = createSimpleBean(Haddock.class);
manager.addBean(tunaBean);
manager.addBean(salmonBean);
@@ -158,9 +158,9 @@
@Test(groups="injection") @SpecAssertion(section="2.3.5")
public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
{
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Salmon> salmonBean = createSimpleBean(Salmon.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(codBean);
manager.addBean(salmonBean);
@@ -193,8 +193,8 @@
{
AnnotatedField<Farmer<ScottishFish>> scottishFishFarmerField = new
AnnotatedFieldImpl<Farmer<ScottishFish>>(FishFarm.class.getDeclaredField("scottishFishFarmer"),
fishFarmClass);
- Bean<ScottishFishFarmer> scottishFishFarmerBean =
createSimpleBean(ScottishFishFarmer.class, manager);
- Bean<AnimalFarmer> farmerBean = createSimpleBean(AnimalFarmer.class,
manager);
+ Bean<ScottishFishFarmer> scottishFishFarmerBean =
createSimpleBean(ScottishFishFarmer.class);
+ Bean<AnimalFarmer> farmerBean = createSimpleBean(AnimalFarmer.class);
manager.addBean(scottishFishFarmerBean);
manager.addBean(farmerBean);
@@ -206,13 +206,13 @@
@Test(groups={"resolution", "producerMethod"})
@SpecAssertion(section="4.9.2")
public void testResolveByTypeWithArray() throws Exception
{
- SimpleBean<SpiderProducer> spiderProducerBean =
createSimpleBean(SpiderProducer.class, manager);
+ SimpleBean<SpiderProducer> spiderProducerBean =
createSimpleBean(SpiderProducer.class);
manager.addBean(spiderProducerBean);
Method method = SpiderProducer.class.getMethod("getSpiders");
- Bean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class,
method, manager, spiderProducerBean);
+ Bean<Spider[]> spidersModel = createProducerMethodBean(Spider[].class,
method, spiderProducerBean);
manager.addBean(spidersModel);
method = SpiderProducer.class.getMethod("getStrings");
- Bean<String[]> stringModel = createProducerMethodBean(String[].class, method,
manager, spiderProducerBean);
+ Bean<String[]> stringModel = createProducerMethodBean(String[].class, method,
spiderProducerBean);
manager.addBean(stringModel);
assert manager.resolveByType(Spider[].class).size() == 1;
@@ -222,9 +222,9 @@
public void testOnlyHighestEnabledPreecedenceWebBeansResolved() throws Exception
{
AnnotatedField<Animal> whiteFishField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("whiteFish"),
fishFarmClass);
- Bean<Cod> codBean = createSimpleBean(Cod.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ Bean<Cod> codBean = createSimpleBean(Cod.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
+ Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class);
manager.addBean(plaiceBean);
@@ -240,9 +240,9 @@
public void testResolveByTypeWithNonBindingMembers() throws Exception
{
AnnotatedField<Animal> veryExpensiveWhitefishField = new
AnnotatedFieldImpl<Animal>(FishFarm.class.getDeclaredField("veryExpensiveWhitefish"),
fishFarmClass);
- Bean<Halibut> halibutBean = createSimpleBean(Halibut.class, manager);
- Bean<RoundWhitefish> roundWhiteFishBean =
createSimpleBean(RoundWhitefish.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
+ Bean<Halibut> halibutBean = createSimpleBean(Halibut.class);
+ Bean<RoundWhitefish> roundWhiteFishBean =
createSimpleBean(RoundWhitefish.class);
+ Bean<Sole> soleBean = createSimpleBean(Sole.class);
manager.addBean(halibutBean);
manager.addBean(roundWhiteFishBean);
manager.addBean(soleBean);
@@ -270,9 +270,9 @@
public void testNoWebBeansFound() throws Exception
{
AnnotatedField<ScottishFish> whiteScottishFishField = new
AnnotatedFieldImpl<ScottishFish>(FishFarm.class.getDeclaredField("whiteScottishFish"),
fishFarmClass);
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ 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);
@@ -283,9 +283,9 @@
@Test(groups="resolution") @SpecAssertion(section="4.9.2")
public void testResolveObject() throws Exception
{
- Bean<Salmon> salmonBean = createSimpleBean(Salmon.class, manager);
- Bean<Sole> soleBean = createSimpleBean(Sole.class, manager);
- Bean<Plaice> plaiceBean = createSimpleBean(Plaice.class, manager);
+ 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);
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -23,7 +23,7 @@
@Test @SpecAssertion(section="2.4")
public void testScopeTypesAreExtensible()
{
- Bean<Mullet> mullet = createSimpleBean(Mullet.class, manager);
+ Bean<Mullet> mullet = createSimpleBean(Mullet.class);
assert mullet.getScopeType().equals(AnotherScopeType.class);
}
@@ -48,14 +48,14 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class, manager);
+ SimpleBean<SeaBass> trout = createSimpleBean(SeaBass.class);
assert trout.getScopeType().equals(RequestScoped.class);
}
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="2.4.3")
public void testTooManyScopesSpecifiedInJava()
{
- createSimpleBean(BeanWithTooManyScopeTypes.class, manager);
+ createSimpleBean(BeanWithTooManyScopeTypes.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub",
"webbeansxml"})
@@ -105,7 +105,7 @@
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- SimpleBean<Order> order = createSimpleBean(Order.class, manager);
+ SimpleBean<Order> order = createSimpleBean(Order.class);
assert order.getScopeType().equals(Dependent.class);
}
@@ -155,7 +155,7 @@
@Test @SpecAssertion(section="2.7.2")
public void testWebBeanScopeTypeOverridesStereotype()
{
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
assert bean.getScopeType().equals(RequestScoped.class);
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanLifecycleTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,8 +21,8 @@
@Test(groups="beanConstruction") @SpecAssertion(section="3.1.3")
public void testInjectionOfParametersIntoBeanConstructor()
{
- Bean<FishPond> goldfishPondBean = createSimpleBean(FishPond.class, manager);
- Bean<Goldfish> goldfishBean = createSimpleBean(Goldfish.class, manager);
+ Bean<FishPond> goldfishPondBean = createSimpleBean(FishPond.class);
+ Bean<Goldfish> goldfishBean = createSimpleBean(Goldfish.class);
manager.addBean(goldfishBean);
manager.addBean(goldfishPondBean);
FishPond fishPond = goldfishPondBean.create();
@@ -39,7 +39,7 @@
@Test(groups="beanLifecycle") @SpecAssertion(section="5.3")
public void testCreateReturnsInstanceOfBean()
{
- Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class, manager);
+ Bean<RedSnapper> bean = createSimpleBean(RedSnapper.class);
assert bean.create() instanceof RedSnapper;
}
@@ -76,8 +76,8 @@
@Test(groups={"beanLifecycle", "lifecycleCallbacks"})
@SpecAssertion(section="5.3")
public void testPostConstructPreDestroy() throws Exception
{
- Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class,
manager);
- Bean<Farm> farmBean = createSimpleBean(Farm.class, manager);
+ Bean<FarmOffice> farmOfficeBean = createSimpleBean(FarmOffice.class);
+ Bean<Farm> farmBean = createSimpleBean(Farm.class);
manager.addBean(farmOfficeBean);
manager.addBean(farmBean);
Farm farm = farmBean.create();
@@ -91,8 +91,8 @@
@Test(groups="injection") @SpecAssertion(section="5.3")
public void testCreateInjectsFieldsDeclaredInJava()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class,
manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.tuna != null;
@@ -101,8 +101,8 @@
@Test(groups="injection")
public void testFieldMissingBindingAnnotationsAreNotInjected()
{
- SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class,
manager);
- Bean<Tuna> tunaBean = createSimpleBean(Tuna.class, manager);
+ SimpleBean<TunaFarm> tunaFarmBean = createSimpleBean(TunaFarm.class);
+ Bean<Tuna> tunaBean = createSimpleBean(Tuna.class);
manager.addBean(tunaBean);
TunaFarm tunaFarm = tunaFarmBean.create();
assert tunaFarm.notInjectedTuna != manager.getInstance(tunaBean);
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-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleBeanModelTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -46,26 +46,26 @@
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.2")
public void testAbstractClassDeclaredInJavaIsNotAllowed()
{
- createSimpleBean(Cow.class, manager);
+ createSimpleBean(Cow.class);
}
@Test(groups="innerClass") @SpecAssertion(section="3.2")
public void testStaticInnerClassDeclaredInJavaAllowed()
{
- createSimpleBean(StaticInnerBean.class, manager);
+ createSimpleBean(StaticInnerBean.class);
}
@Test(expectedExceptions=DefinitionException.class, groups="innerClass")
@SpecAssertion(section="3.2")
public void testNonStaticInnerClassDeclaredInJavaNotAllowed()
{
- createSimpleBean(InnerBean.class, manager);
+ createSimpleBean(InnerBean.class);
}
@SuppressWarnings("unchecked")
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.2")
public void testParameterizedClassDeclaredInJavaIsNotAllowed()
{
- createSimpleBean(ParameterizedBean.class, manager);
+ createSimpleBean(ParameterizedBean.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub",
"interceptors", "decorators"})
@SpecAssertion(section="3.2")
@@ -83,7 +83,7 @@
@Test @SpecAssertion(section="3.2.2")
public void testApiTypes()
{
- Bean<Tarantula> bean = createSimpleBean(Tarantula.class, manager);
+ Bean<Tarantula> bean = createSimpleBean(Tarantula.class);
assert bean.getTypes().size() == 6;
assert bean.getTypes().contains(Tarantula.class);
assert bean.getTypes().contains(Spider.class);
@@ -150,7 +150,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testInitializerAnnotatedConstructor()
{
- AnnotatedConstructor<Sheep> constructor = createSimpleBean(Sheep.class,
manager).getConstructor();
+ AnnotatedConstructor<Sheep> constructor =
createSimpleBean(Sheep.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Sheep.class);
assert constructor.getParameters().size() == 2;
@@ -170,7 +170,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testImplicitConstructorUsed()
{
- AnnotatedConstructor<Order> constructor = createSimpleBean(Order.class,
manager).getConstructor();
+ AnnotatedConstructor<Order> constructor =
createSimpleBean(Order.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Order.class);
assert constructor.getParameters().size() == 0;
}
@@ -178,7 +178,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testEmptyConstructorUsed()
{
- AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class,
manager).getConstructor();
+ AnnotatedConstructor<Donkey> constructor =
createSimpleBean(Donkey.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Donkey.class);
assert constructor.getParameters().size() == 0;
}
@@ -186,7 +186,7 @@
@Test @SpecAssertion(section="3.2.5.1")
public void testInitializerAnnotatedConstructorUsedOverEmptyConstuctor()
{
- AnnotatedConstructor<Turkey> constructor = createSimpleBean(Turkey.class,
manager).getConstructor();
+ AnnotatedConstructor<Turkey> constructor =
createSimpleBean(Turkey.class).getConstructor();
assert constructor.getParameters().size() == 2;
Map<Class<?>, Set<? extends Annotation>> map = new
HashMap<Class<?>, Set<? extends Annotation>>();
for (AnnotatedParameter<Object> parameter : constructor.getParameters())
@@ -200,7 +200,7 @@
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="3.2.5.1")
public void testTooManyInitializerAnnotatedConstructor()
{
- createSimpleBean(Goose.class, manager);
+ createSimpleBean(Goose.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub",
"disposalMethod"}) @SpecAssertion(section="3.2.5.1")
@@ -224,7 +224,7 @@
@Test(groups={"stub", "webbeansxml"})
@SpecAssertion(section="3.2.5.2")
public void testEmptyConstructorDeclaredInXmlUsed()
{
- AnnotatedConstructor<Donkey> constructor = createSimpleBean(Donkey.class,
manager).getConstructor();
+ AnnotatedConstructor<Donkey> constructor =
createSimpleBean(Donkey.class).getConstructor();
assert constructor.getParameters().size() == 0;
assert false;
}
@@ -244,7 +244,7 @@
@Test @SpecAssertion(section="3.2.5.3")
public void testBindingTypeAnnotatedConstructor()
{
- AnnotatedConstructor<Duck> constructor = createSimpleBean(Duck.class,
manager).getConstructor();
+ AnnotatedConstructor<Duck> constructor =
createSimpleBean(Duck.class).getConstructor();
assert constructor.getDeclaringClass().getType().equals(Duck.class);
assert constructor.getParameters().size() == 2;
Map<Class<?>, Set<? extends Annotation>> map = new
HashMap<Class<?>, Set<? extends Annotation>>();
@@ -263,7 +263,7 @@
@Test(groups="specializationInherit")
@SpecAssertion(section="3.2.6")
public void testSpecializedClassInheritsBindingTypes()
{
- SimpleBean<Tractor> bean = createSimpleBean(Tractor.class, manager);
+ SimpleBean<Tractor> bean = createSimpleBean(Tractor.class);
assert bean.getBindingTypes().size()==2;
assert bean.getBindingTypes().contains( new AnnotationLiteral<Motorized>() {}
);
assert bean.getBindingTypes().contains( new AnnotationLiteral<HeavyDuty>() {}
);
@@ -272,7 +272,7 @@
@Test(groups="specializationInherit")
@SpecAssertion(section="3.2.6")
public void testSpecializedClassInheritsName()
{
- SimpleBean<Tractor> bean = createSimpleBean(Tractor.class, manager);
+ SimpleBean<Tractor> bean = createSimpleBean(Tractor.class);
assert bean.getName()!=null;
assert bean.getName().equals("plough");
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/StereotypesTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -144,7 +144,7 @@
@Test @SpecAssertion(section={"2.7.2", "2.7.4"})
public void testMultipleStereotypes()
{
- SimpleBean<HighlandCow> highlandCow = createSimpleBean(HighlandCow.class,
manager);
+ SimpleBean<HighlandCow> highlandCow = createSimpleBean(HighlandCow.class);
assert highlandCow.getName() == null;
assert
highlandCow.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
assert highlandCow.getScopeType().equals(RequestScoped.class);
@@ -189,25 +189,25 @@
@Test(a)SpecAssertion(section="2.7.4")
public void testRequiredTypeIsImplemented()
{
- createSimpleBean(HighlandCow.class, manager);
+ createSimpleBean(HighlandCow.class);
}
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="2.7.4")
public void testRequiredTypeIsNotImplemented()
{
- createSimpleBean(Chair.class, manager);
+ createSimpleBean(Chair.class);
}
@Test @SpecAssertion(section="2.7.4")
public void testScopeIsSupported()
{
- createSimpleBean(Goldfish.class, manager);
+ createSimpleBean(Goldfish.class);
}
@Test(expectedExceptions=DefinitionException.class)
@SpecAssertion(section="2.7.4")
public void testScopeIsNotSupported()
{
- createSimpleBean(Carp.class, manager);
+ createSimpleBean(Carp.class);
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/TypeTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -12,7 +12,7 @@
@Test @SpecAssertion(section="2.6.3")
public void testDefaultNamed()
{
- SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class, manager);
+ SimpleBean<Haddock> haddock = createSimpleBean(Haddock.class);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanDeclarationTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -32,84 +32,84 @@
@SpecAssertion(section = "3.3")
public void testStatelessWithDependentScopeOK()
{
- EnterpriseBean<Giraffe> giraffe =
BeanFactory.createEnterpriseBean(Giraffe.class, manager);
+ EnterpriseBean<Giraffe> giraffe =
BeanFactory.createEnterpriseBean(Giraffe.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithRequestScopeFails()
{
- EnterpriseBean<Beagle> beagle =
BeanFactory.createEnterpriseBean(Beagle.class, manager);
+ EnterpriseBean<Beagle> beagle =
BeanFactory.createEnterpriseBean(Beagle.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithConversationScopeFails()
{
- EnterpriseBean<Boxer> boxer = BeanFactory.createEnterpriseBean(Boxer.class,
manager);
+ EnterpriseBean<Boxer> boxer = BeanFactory.createEnterpriseBean(Boxer.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithSessionScopeFails()
{
- EnterpriseBean<Bullmastiff> boxer =
BeanFactory.createEnterpriseBean(Bullmastiff.class, manager);
+ EnterpriseBean<Bullmastiff> boxer =
BeanFactory.createEnterpriseBean(Bullmastiff.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testStatelessWithApplicationScopeFails()
{
- EnterpriseBean<Dachshund> dachshund =
BeanFactory.createEnterpriseBean(Dachshund.class, manager);
+ EnterpriseBean<Dachshund> dachshund =
BeanFactory.createEnterpriseBean(Dachshund.class);
}
@Test
@SpecAssertion(section = "3.3")
public void testSingletonWithDependentScopeOK()
{
- EnterpriseBean<GreatDane> greatDane =
BeanFactory.createEnterpriseBean(GreatDane.class, manager);
+ EnterpriseBean<GreatDane> greatDane =
BeanFactory.createEnterpriseBean(GreatDane.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithRequestScopeFails()
{
- EnterpriseBean<Greyhound> greyhound =
BeanFactory.createEnterpriseBean(Greyhound.class, manager);
+ EnterpriseBean<Greyhound> greyhound =
BeanFactory.createEnterpriseBean(Greyhound.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithConversationScopeFails()
{
- EnterpriseBean<Husky> husky = BeanFactory.createEnterpriseBean(Husky.class,
manager);
+ EnterpriseBean<Husky> husky = BeanFactory.createEnterpriseBean(Husky.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testSingletonWithSessionScopeFails()
{
- EnterpriseBean<IrishTerrier> irishTerrier =
BeanFactory.createEnterpriseBean(IrishTerrier.class, manager);
+ EnterpriseBean<IrishTerrier> irishTerrier =
BeanFactory.createEnterpriseBean(IrishTerrier.class);
}
@Test
@SpecAssertion(section = "3.3")
public void testSingletonWithApplicationScopeOK()
{
- EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class,
manager);
+ EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testEnterpriseBeanInterceptorFails()
{
- EnterpriseBean<Pug> pug = BeanFactory.createEnterpriseBean(Pug.class,
manager);
+ EnterpriseBean<Pug> pug = BeanFactory.createEnterpriseBean(Pug.class);
}
@Test(expectedExceptions = DefinitionException.class)
@SpecAssertion(section = "3.3")
public void testEnterpriseBeanDecoratorFails()
{
- EnterpriseBean<Pekingese> pekingese =
BeanFactory.createEnterpriseBean(Pekingese.class, manager);
+ EnterpriseBean<Pekingese> pekingese =
BeanFactory.createEnterpriseBean(Pekingese.class);
}
@Test(expectedExceptions = DefinitionException.class, groups =
{"enterpriseBeans", "stub"})
@@ -172,7 +172,7 @@
@SpecAssertion(section = "3.3.2")
public void testObjectIsInAPITypes()
{
- EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class,
manager);
+ EnterpriseBean<Laika> laika = BeanFactory.createEnterpriseBean(Laika.class);
assert laika.getTypes().contains(Object.class);
}
@@ -201,7 +201,7 @@
@SpecAssertion(section = "3.3")
public void testMessageDrivenBeansNotOK()
{
- EnterpriseBean<Leopard> Leopard =
BeanFactory.createEnterpriseBean(Leopard.class, manager);
+ EnterpriseBean<Leopard> Leopard =
BeanFactory.createEnterpriseBean(Leopard.class);
}
@@ -209,7 +209,7 @@
@SpecAssertion(section = "3.3.7")
public void testDefaultName()
{
- EnterpriseBean<Pitbull> pitbull =
BeanFactory.createEnterpriseBean(Pitbull.class, manager);
+ EnterpriseBean<Pitbull> pitbull =
BeanFactory.createEnterpriseBean(Pitbull.class);
assert pitbull.getName().equals("pitbull");
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanRemoveMethodTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -35,7 +35,7 @@
@SpecAssertion(section = "3.3.5")
public void testStatelessEnterpriseBeansWithRemoveMethodsFails()
{
- EnterpriseBean<Armant> bean = BeanFactory.createEnterpriseBean(Armant.class,
manager);
+ EnterpriseBean<Armant> bean =
BeanFactory.createEnterpriseBean(Armant.class);
}
@Test(groups={"enterpriseBeans", "removeMethod",
"lifecycle", "stub"})
@@ -43,7 +43,7 @@
public void testStatefulEnterpriseBeanRemoveMethodCalledWhenDestroyedByManager()
{
EnterpriseBeanRemoveMethodTest.tickle = false;
- EnterpriseBean<Toller> bena = BeanFactory.createEnterpriseBean(Toller.class,
manager);
+ EnterpriseBean<Toller> bena =
BeanFactory.createEnterpriseBean(Toller.class);
RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
Toller instance = context.get(bena, true);
context.destroy(manager);
@@ -54,21 +54,21 @@
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped()
{
- EnterpriseBean<Pumi> bean = BeanFactory.createEnterpriseBean(Pumi.class,
manager);
+ EnterpriseBean<Pumi> bean = BeanFactory.createEnterpriseBean(Pumi.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"})
@SpecAssertion(section = "3.3.5")
public void testStatefulEnterpriseBeanWithoutRemoveMethodMustBeDependentScoped2()
{
- EnterpriseBean<WelshCorgie> bean =
BeanFactory.createEnterpriseBean(WelshCorgie.class, manager);
+ EnterpriseBean<WelshCorgie> bean =
BeanFactory.createEnterpriseBean(WelshCorgie.class);
}
@Test(groups={"enterpriseBeans", "removeMethod",
"stub"}, expectedExceptions = UnremovedException.class)
@SpecAssertion(section = "3.3.5")
public void
testStatefulEnterpriseBeanWithoutRemoveMethodMustBeRemovedByApplicationBeforeManager()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class,
manager);
+ EnterpriseBean<Toller> bean =
BeanFactory.createEnterpriseBean(Toller.class);
Toller instance = manager.getInstance(bean);
RequestContext context = (RequestContext) manager
.getContext(RequestScoped.class);
@@ -79,7 +79,7 @@
@SpecAssertion(section = "3.3.5")
public void testApplicationRemoveMethodCallRemovesInstanceFromContext()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class,
manager);
+ EnterpriseBean<Toller> bean =
BeanFactory.createEnterpriseBean(Toller.class);
RequestContext context = (RequestContext) manager.getContext(RequestScoped.class);
Toller instance = context.get(bean, true);
instance.bye();
@@ -91,7 +91,7 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void
testEnterpriseBeanWithoutDestructorUsesNoArgsRemoveAnnotatedMethodAsRemoveMethod()
{
- EnterpriseBean<Toller> bean = BeanFactory.createEnterpriseBean(Toller.class,
manager);
+ EnterpriseBean<Toller> bean =
BeanFactory.createEnterpriseBean(Toller.class);
assert "bye".equals(bean.getRemoveMethod().getName());
}
@@ -99,7 +99,7 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void
testEnterpriseBeanWithoutDestructorAndNoArgsRemoveAnnotatedMethodHasNoRemoveMethod()
{
- EnterpriseBean<Koirus> bean = BeanFactory.createEnterpriseBean(Koirus.class,
manager);
+ EnterpriseBean<Koirus> bean =
BeanFactory.createEnterpriseBean(Koirus.class);
assert bean.getRemoveMethod() == null;
}
@@ -107,49 +107,49 @@
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testMultipleDestructorAnnotatedMethodsFails()
{
- EnterpriseBean<Rottweiler> bean =
BeanFactory.createEnterpriseBean(Rottweiler.class, manager);
+ EnterpriseBean<Rottweiler> bean =
BeanFactory.createEnterpriseBean(Rottweiler.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testDestructorAnnotatedMethodNotRemoveAnnotatedFails()
{
- EnterpriseBean<RussellTerrier> bean =
BeanFactory.createEnterpriseBean(RussellTerrier.class, manager);
+ EnterpriseBean<RussellTerrier> bean =
BeanFactory.createEnterpriseBean(RussellTerrier.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodIsInitializerFails()
{
- EnterpriseBean<Saluki> bean = BeanFactory.createEnterpriseBean(Saluki.class,
manager);
+ EnterpriseBean<Saluki> bean =
BeanFactory.createEnterpriseBean(Saluki.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodIsProducerFails()
{
- EnterpriseBean<Spitz> bean = BeanFactory.createEnterpriseBean(Spitz.class,
manager);
+ EnterpriseBean<Spitz> bean = BeanFactory.createEnterpriseBean(Spitz.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodWithDisposesParameterFails()
{
- EnterpriseBean<GoldenRetriever> bean =
BeanFactory.createEnterpriseBean(GoldenRetriever.class, manager);
+ EnterpriseBean<GoldenRetriever> bean =
BeanFactory.createEnterpriseBean(GoldenRetriever.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testRemoveMethodWithObservesParameterFails()
{
- EnterpriseBean<JackRussellTerrier> bean =
BeanFactory.createEnterpriseBean(JackRussellTerrier.class, manager);
+ EnterpriseBean<JackRussellTerrier> bean =
BeanFactory.createEnterpriseBean(JackRussellTerrier.class);
}
@Test(groups={"enterpriseBeans", "removeMethod"},
expectedExceptions = DefinitionException.class)
@SpecAssertion(section = {"3.3.5.1", "3.3.5.2"})
public void testMultipleRemoveAnnotationsButNoDestructorFails()
{
- EnterpriseBean<Poodle> bean = BeanFactory.createEnterpriseBean(Poodle.class,
manager);
+ EnterpriseBean<Poodle> bean =
BeanFactory.createEnterpriseBean(Poodle.class);
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ejb/model/EnterpriseBeanSpecializationTest.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -21,8 +21,8 @@
@SpecAssertion(section = "3.3.6")
public void testSpecializingBeanInheritsBindingTypes()
{
- EnterpriseBean<Hound> hound = BeanFactory.createEnterpriseBean(Hound.class,
manager);
- EnterpriseBean<HoundOfBaskerville> houndOfBaskerville =
BeanFactory.createEnterpriseBean(HoundOfBaskerville.class, manager);
+ EnterpriseBean<Hound> hound = BeanFactory.createEnterpriseBean(Hound.class);
+ EnterpriseBean<HoundOfBaskerville> houndOfBaskerville =
BeanFactory.createEnterpriseBean(HoundOfBaskerville.class);
assert compareBindingTypesOK(hound, houndOfBaskerville);
}
@@ -45,7 +45,7 @@
@SpecAssertion(section = "3.3.6")
public void testSpecializingBeanInheritsNameIfAny()
{
- EnterpriseBean<HoundOfBaskerville> houndOfBaskerville =
BeanFactory.createEnterpriseBean(HoundOfBaskerville.class, manager);
+ EnterpriseBean<HoundOfBaskerville> houndOfBaskerville =
BeanFactory.createEnterpriseBean(HoundOfBaskerville.class);
assert houndOfBaskerville.getName().equals("Pongo");
}
@@ -82,7 +82,7 @@
@SpecAssertion(section = "3.3.6")
public void
testAnnotationDefinedSpecializingEnterpriseBeanNotDirectlyExtendingAnnotationDefinedEnterpriseBeanFails()
{
- EnterpriseBean<GreaterDane> greaterDane =
BeanFactory.createEnterpriseBean(GreaterDane.class, manager);
+ EnterpriseBean<GreaterDane> greaterDane =
BeanFactory.createEnterpriseBean(GreaterDane.class);
}
@Test(expectedExceptions=DefinitionException.class, groups={"stub",
"specialization", "enterpriseBeans"})
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockBootstrap.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -1,14 +1,13 @@
package org.jboss.webbeans.test.mock;
-import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bootstrap.Bootstrap;
public class MockBootstrap extends Bootstrap
{
- public MockBootstrap(ManagerImpl manager)
+ public MockBootstrap()
{
- super(manager);
+ super();
}
}
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java
===================================================================
---
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-12-05
11:10:40 UTC (rev 410)
+++
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockObserverImpl.java 2008-12-05
11:44:38 UTC (rev 411)
@@ -18,7 +18,7 @@
public MockObserverImpl(ManagerImpl manager, EventBean<T> beanModel,
AnnotatedMethod<Object> observer, Class<T> eventType)
{
- super(manager, beanModel, observer, eventType);
+ super(beanModel, observer, eventType);
}
@Override