[webbeans-commits] Webbeans SVN: r128 - in ri/trunk: webbeans-ri/src/main/java/org/jboss/webbeans and 6 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Thu Oct 23 13:13:25 EDT 2008
Author: pete.muir at jboss.org
Date: 2008-10-23 13:13:25 -0400 (Thu, 23 Oct 2008)
New Revision: 128
Added:
ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.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/components/FishFarm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
Removed:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farm.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Pig.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.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/ConstructorModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.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/EnterpriseComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.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/InjectableTest.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/ProducerExpressionComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.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/SimpleComponentModelTest.java
Log:
Switch to using Class<? extends Annotation> from Class<Annotation> and enable some Bean methods
Added: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java
===================================================================
--- ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java (rev 0)
+++ ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -0,0 +1,26 @@
+package javax.webbeans;
+
+public class DeploymentException extends RuntimeException
+{
+
+ public DeploymentException()
+ {
+ super();
+ }
+
+ public DeploymentException(String arg0, Throwable arg1)
+ {
+ super(arg0, arg1);
+ }
+
+ public DeploymentException(String arg0)
+ {
+ super(arg0);
+ }
+
+ public DeploymentException(Throwable arg0)
+ {
+ super(arg0);
+ }
+
+}
Property changes on: ri/trunk/webbeans-api/src/main/java/javax/webbeans/DeploymentException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/BeanImpl.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -16,20 +16,20 @@
private static Logger log = LoggerUtil.getLogger(LOGGER_NAME);
- private AbstractComponentModel<T, ?> componentMetaModel;
+ private AbstractComponentModel<T, ?> model;
private ManagerImpl manager;
- public BeanImpl(AbstractComponentModel<T, ?> componentMetaModel, ManagerImpl manager)
+ public BeanImpl(AbstractComponentModel<T, ?> model, ManagerImpl manager)
{
super(manager);
- this.componentMetaModel = componentMetaModel;
+ this.model = model;
}
@Override
public T create()
{
- return componentMetaModel.getConstructor().invoke(manager);
+ return model.getConstructor().invoke(manager);
}
@Override
@@ -42,32 +42,31 @@
@Override
public Set<Annotation> getBindingTypes()
{
- return componentMetaModel.getBindingTypes();
+ return model.getBindingTypes();
}
@Override
- public Class<Annotation> getDeploymentType()
+ public Class<? extends Annotation> getDeploymentType()
{
- return null; // componentMetaModel.getDeploymentType();
+ return model.getDeploymentType();
}
@Override
public String getName()
{
- return componentMetaModel.getName();
+ return model.getName();
}
@Override
- public Class<Annotation> getScopeType()
+ public Class<? extends Annotation> getScopeType()
{
- return null; //componentMetaModel.getScopeType();
+ return model.getScopeType();
}
@Override
public Set<Class<?>> getTypes()
{
- // TODO Auto-generated method stub
- return null;
+ return model.getApiTypes();
}
@Override
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ManagerImpl.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -8,6 +8,8 @@
import java.util.Map;
import java.util.Set;
+import javax.webbeans.DeploymentException;
+import javax.webbeans.Production;
import javax.webbeans.Standard;
import javax.webbeans.TypeLiteral;
import javax.webbeans.manager.Bean;
@@ -18,8 +20,6 @@
import javax.webbeans.manager.Manager;
import javax.webbeans.Observer;
-import org.jboss.webbeans.bindings.ProductionAnnotationLiteral;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.ejb.EjbManager;
import org.jboss.webbeans.event.EventBus;
import org.jboss.webbeans.injectable.SimpleInjectable;
@@ -27,7 +27,7 @@
public class ManagerImpl implements Manager
{
- private List<Annotation> enabledDeploymentTypes;
+ private List<Class<? extends Annotation>> enabledDeploymentTypes;
private ModelManager modelManager;
private EjbManager ejbLookupManager;
private EventBus eventBus;
@@ -37,7 +37,7 @@
private Set<Bean<?>> beans;
- public ManagerImpl(List<Annotation> enabledDeploymentTypes)
+ public ManagerImpl(List<Class<? extends Annotation>> enabledDeploymentTypes)
{
initEnabledDeploymentTypes(enabledDeploymentTypes);
this.modelManager = new ModelManager();
@@ -48,20 +48,20 @@
}
private void initEnabledDeploymentTypes(
- List<Annotation> enabledDeploymentTypes)
+ List<Class<? extends Annotation>> enabledDeploymentTypes)
{
- this.enabledDeploymentTypes = new ArrayList<Annotation>();
+ this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
if (enabledDeploymentTypes == null)
{
- this.enabledDeploymentTypes.add(0, new StandardAnnotationLiteral());
- this.enabledDeploymentTypes.add(1, new ProductionAnnotationLiteral());
+ this.enabledDeploymentTypes.add(0, Standard.class);
+ this.enabledDeploymentTypes.add(1, Production.class);
} else
{
this.enabledDeploymentTypes.addAll(enabledDeploymentTypes);
- if (!this.enabledDeploymentTypes.get(0).annotationType().equals(
+ if (!this.enabledDeploymentTypes.get(0).equals(
Standard.class))
{
- throw new RuntimeException(
+ throw new DeploymentException(
"@Standard must be the lowest precedence deployment type");
}
}
@@ -89,7 +89,7 @@
return (Set<Observer<T>>) eventBus.getObservers(event, bindings);
}
- public List<Annotation> getEnabledDeploymentTypes()
+ public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
return enabledDeploymentTypes;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ResolutionManager.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -28,7 +28,7 @@
public void registerInjectionPoint(Injectable<?, ?> injectable)
{
- resolvedInjectionPoints.put(injectable, injectable.getPossibleTargets(manager.getBeans()));
+ resolvedInjectionPoints.put(injectable, injectable.getPossibleBeans(manager.getBeans()));
}
public void registerInjectionPoints()
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/Injectable.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -56,10 +56,10 @@
return annotatedItem;
}
- public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> beans)
{
Set<Bean<?>> resolvedBeans = new HashSet<Bean<?>>();
- for (Bean<?> bean : possibleBeans)
+ for (Bean<?> bean : beans)
{
if (bean.getTypes().contains(getType()))
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableParameterWrapper.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -24,9 +24,9 @@
}
@Override
- public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> possibleBeans)
{
- return delegate.getPossibleTargets(possibleBeans);
+ return delegate.getPossibleBeans(possibleBeans);
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/injectable/InjectableWrapper.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -24,9 +24,9 @@
}
@Override
- public Set<Bean<?>> getPossibleTargets(Set<Bean<?>> possibleBeans)
+ public Set<Bean<?>> getPossibleBeans(Set<Bean<?>> possibleBeans)
{
- return delegate.getPossibleTargets(possibleBeans);
+ return delegate.getPossibleBeans(possibleBeans);
}
@Override
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractClassComponentModel.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -32,7 +32,7 @@
*
* @param annotatedItem Annotations read from java classes
* @param xmlAnnotatedItem Annotations read from XML
- * @param container
+ * @param manager
*/
@SuppressWarnings("unchecked")
public AbstractClassComponentModel(AnnotatedType<T> annotatedItem, AnnotatedType xmlAnnotatedItem)
@@ -135,12 +135,12 @@
log.finest("Checking if " + getScopeType() + " is allowed for " + type);
if (getMergedStereotypes().getSupportedScopes().size() > 0)
{
- if (!getMergedStereotypes().getSupportedScopes().contains(getScopeType().annotationType()))
+ if (!getMergedStereotypes().getSupportedScopes().contains(getScopeType()))
{
throw new RuntimeException("Scope " + getScopeType() + " is not an allowed by the stereotype for " + type);
}
}
- if (isDeclaredFinal(type) && !getScopeType().annotationType().equals(Dependent.class))
+ if (isDeclaredFinal(type) && !getScopeType().equals(Dependent.class))
{
throw new RuntimeException("Scope " + getScopeType() + " is not allowed as the class is declared final or has methods declared final for " + type + ". Only @Dependent is allowed for final components");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractComponentModel.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -8,14 +8,14 @@
import java.util.logging.Logger;
import javax.webbeans.BindingType;
+import javax.webbeans.Dependent;
import javax.webbeans.DeploymentType;
import javax.webbeans.Named;
+import javax.webbeans.Production;
import javax.webbeans.ScopeType;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bindings.CurrentAnnotationLiteral;
-import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
-import org.jboss.webbeans.bindings.ProductionAnnotationLiteral;
import org.jboss.webbeans.injectable.ComponentConstructor;
import org.jboss.webbeans.injectable.Injectable;
import org.jboss.webbeans.injectable.InjectableMethod;
@@ -32,12 +32,12 @@
private Set<Annotation> bindingTypes;
protected String name;
- protected Annotation scopeType;
+ protected Class<? extends Annotation> scopeType;
private MergedStereotypesModel<T, E> mergedStereotypes;
- protected Annotation deploymentType;
+ protected Class<? extends Annotation> deploymentType;
protected Class<T> type;
protected InjectableMethod<?> removeMethod;
- private Set<Class> apiTypes;
+ private Set<Class<?>> apiTypes;
protected Set<Injectable<?, ?>> injectionPoints;
protected void init(ManagerImpl container)
@@ -72,9 +72,9 @@
apiTypes = getTypeHierachy(getType());
}
- protected Set<Class> getTypeHierachy(Class clazz)
+ protected Set<Class<?>> getTypeHierachy(Class<?> clazz)
{
- Set<Class> classes = new HashSet<Class>();
+ Set<Class<?>> classes = new HashSet<Class<?>>();
if (!(clazz == null || clazz == Object.class))
{
classes.add(clazz);
@@ -132,7 +132,7 @@
if (xmlScopes.size() == 1)
{
- this.scopeType = xmlScopes.iterator().next();
+ this.scopeType = xmlScopes.iterator().next().annotationType();
log.finest("Scope " + scopeType + " specified in XML");
return;
}
@@ -145,14 +145,14 @@
if (scopes.size() == 1)
{
- this.scopeType = scopes.iterator().next();
+ this.scopeType = scopes.iterator().next().annotationType();
log.finest("Scope " + scopeType + " specified b annotation");
return;
}
if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
{
- this.scopeType = getMergedStereotypes().getPossibleScopeTypes().iterator().next();
+ this.scopeType = getMergedStereotypes().getPossibleScopeTypes().iterator().next().annotationType();
log.finest("Scope " + scopeType + " specified by stereotype");
return;
}
@@ -160,7 +160,7 @@
{
throw new RuntimeException("All stereotypes must specify the same scope OR a scope must be specified on the component");
}
- this.scopeType = new DependentAnnotationLiteral();
+ this.scopeType = Dependent.class;
log.finest("Using default @Dependent scope");
}
@@ -215,7 +215,7 @@
if (xmlDeploymentTypes.size() == 1)
{
- this.deploymentType = xmlDeploymentTypes.iterator().next();
+ this.deploymentType = xmlDeploymentTypes.iterator().next().annotationType();
log.finest("Deployment type " + deploymentType + " specified in XML");
return;
}
@@ -229,7 +229,7 @@
}
if (deploymentTypes.size() == 1)
{
- this.deploymentType = deploymentTypes.iterator().next();
+ this.deploymentType = deploymentTypes.iterator().next().annotationType();
log.finest("Deployment type " + deploymentType + " specified by annotation");
return;
}
@@ -243,7 +243,7 @@
if (getXmlAnnotatedItem().getDelegate() != null)
{
- this.deploymentType = new ProductionAnnotationLiteral();
+ this.deploymentType = Production.class;
log.finest("Using default @Production deployment type");
return;
}
@@ -257,11 +257,11 @@
}
}
- public static Annotation getDeploymentType(List<Annotation> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
+ public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
{
for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
{
- if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i).annotationType())))
+ if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
{
return enabledDeploymentTypes.get(i);
}
@@ -281,7 +281,7 @@
return bindingTypes;
}
- public Annotation getScopeType()
+ public Class<? extends Annotation> getScopeType()
{
return scopeType;
}
@@ -291,7 +291,7 @@
return type;
}
- public Set<Class> getApiTypes()
+ public Set<Class<?>> getApiTypes()
{
return apiTypes;
}
@@ -304,7 +304,7 @@
*/
public abstract String getLocation();
- public Annotation getDeploymentType()
+ public Class<? extends Annotation> getDeploymentType()
{
return deploymentType;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/AbstractEnterpriseComponentModel.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -39,11 +39,11 @@
*/
protected void checkEnterpriseScopeAllowed()
{
- if (getEjbMetaData().isStateless() && !getScopeType().annotationType().equals(Dependent.class))
+ if (getEjbMetaData().isStateless() && !getScopeType().equals(Dependent.class))
{
throw new RuntimeException("Scope " + getScopeType() + " is not allowed on stateless enterpise bean components for " + getType() + ". Only @Dependent is allowed on stateless enterprise bean components");
}
- if (getEjbMetaData().isSingleton() && (!getScopeType().annotationType().equals(Dependent.class) || !getScopeType().annotationType().equals(ApplicationScoped.class)))
+ if (getEjbMetaData().isSingleton() && (!getScopeType().equals(Dependent.class) || !getScopeType().equals(ApplicationScoped.class)))
{
throw new RuntimeException("Scope " + getScopeType() + " is not allowed on singleton enterpise bean components for " + getType() + ". Only @Dependent or @ApplicationScoped is allowed on singleton enterprise bean components");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/EventComponentModel.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -4,9 +4,10 @@
import java.lang.reflect.Field;
import java.util.logging.Logger;
+import javax.webbeans.Dependent;
+import javax.webbeans.Standard;
+
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.DependentAnnotationLiteral;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.injectable.ComponentConstructor;
import org.jboss.webbeans.injectable.SimpleConstructor;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -121,7 +122,7 @@
protected void initDeploymentType(ManagerImpl container)
{
// This is always @Standard per 7.4
- this.deploymentType = new StandardAnnotationLiteral();
+ this.deploymentType = Standard.class;
}
/* (non-Javadoc)
@@ -141,7 +142,7 @@
protected void initScopeType()
{
// This is always @Dependent per 7.4
- this.scopeType = new DependentAnnotationLiteral();
+ this.scopeType = Dependent.class;
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerExpressionComponent.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -27,7 +27,7 @@
protected void checkApiType()
{
- if (!getScopeType().annotationType().equals(Dependent.class))
+ if (!getScopeType().equals(Dependent.class))
{
if (Modifier.isFinal(getType().getModifiers()))
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/ProducerMethodComponentModel.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -100,7 +100,7 @@
throw new RuntimeException("Producer method cannot be static " + annotatedMethod);
}
// TODO Check if declaring class is a WB component
- if (!getScopeType().annotationType().equals(Dependent.class) && Modifier.isFinal(getAnnotatedItem().getDelegate().getModifiers()))
+ if (!getScopeType().equals(Dependent.class) && Modifier.isFinal(getAnnotatedItem().getDelegate().getModifiers()))
{
throw new RuntimeException("Final producer method must have @Dependent scope " + annotatedMethod);
}
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,56 +0,0 @@
-package org.jboss.webbeans.test;
-
-import java.lang.annotation.Annotation;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.model.StereotypeModel;
-import org.jboss.webbeans.test.annotations.AnimalStereotype;
-import org.jboss.webbeans.test.annotations.FishStereotype;
-import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
-import org.jboss.webbeans.test.annotations.MammalStereotype;
-import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
-import org.jboss.webbeans.test.annotations.RiverFishStereotype;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.HornedAnimalDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
-import org.jboss.webbeans.test.util.EmptyAnnotatedType;
-import org.testng.annotations.BeforeMethod;
-
-public class AbstractModelTest
-{
-
- protected ManagerImpl container;
-
- protected AnnotatedType<?> emptyAnnotatedItem;
-
- @BeforeMethod
- public void before()
- {
- emptyAnnotatedItem = new EmptyAnnotatedType<Object>(new HashMap<Class<? extends Annotation>, Annotation>());
-
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- enabledDeploymentTypes.add(new HornedAnimalDeploymentTypeAnnotationLiteral());
- container = new MockContainerImpl(enabledDeploymentTypes);
-
- initStereotypes(container);
- }
-
- private void initStereotypes(ManagerImpl container)
- {
- container.getModelManager().addStereotype(new StereotypeModel<AnimalStereotype>(new SimpleAnnotatedType<AnimalStereotype>(AnimalStereotype.class)));
- container.getModelManager().addStereotype(new StereotypeModel<HornedMammalStereotype>(new SimpleAnnotatedType<HornedMammalStereotype>(HornedMammalStereotype.class)));
- container.getModelManager().addStereotype(new StereotypeModel<MammalStereotype>(new SimpleAnnotatedType<MammalStereotype>(MammalStereotype.class)));
- container.getModelManager().addStereotype(new StereotypeModel<FishStereotype>(new SimpleAnnotatedType<FishStereotype>(FishStereotype.class)));
- container.getModelManager().addStereotype(new StereotypeModel<RiverFishStereotype>(new SimpleAnnotatedType<RiverFishStereotype>(RiverFishStereotype.class)));
- container.getModelManager().addStereotype(new StereotypeModel<RequestScopedAnimalStereotype>(new SimpleAnnotatedType<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class)));
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java (from rev 127, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractModelTest.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -0,0 +1,63 @@
+package org.jboss.webbeans.test;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.webbeans.Standard;
+
+import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.StereotypeModel;
+import org.jboss.webbeans.test.annotations.AnimalStereotype;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
+import org.jboss.webbeans.test.annotations.FishStereotype;
+import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
+import org.jboss.webbeans.test.annotations.HornedMammalStereotype;
+import org.jboss.webbeans.test.annotations.MammalStereotype;
+import org.jboss.webbeans.test.annotations.RequestScopedAnimalStereotype;
+import org.jboss.webbeans.test.annotations.RiverFishStereotype;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
+import org.jboss.webbeans.test.util.EmptyAnnotatedType;
+import org.testng.annotations.BeforeMethod;
+
+public class AbstractTest
+{
+
+ protected ManagerImpl manager;
+
+ @Deprecated
+ protected AnnotatedType<?> emptyAnnotatedItem;
+
+ @BeforeMethod
+ public void before()
+ {
+ emptyAnnotatedItem = new EmptyAnnotatedType<Object>(new HashMap<Class<? extends Annotation>, Annotation>());
+
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
+
+ initStereotypes(manager);
+ }
+
+ private void initStereotypes(ManagerImpl container)
+ {
+ container.getModelManager().addStereotype(new StereotypeModel<AnimalStereotype>(new SimpleAnnotatedType<AnimalStereotype>(AnimalStereotype.class)));
+ container.getModelManager().addStereotype(new StereotypeModel<HornedMammalStereotype>(new SimpleAnnotatedType<HornedMammalStereotype>(HornedMammalStereotype.class)));
+ container.getModelManager().addStereotype(new StereotypeModel<MammalStereotype>(new SimpleAnnotatedType<MammalStereotype>(MammalStereotype.class)));
+ container.getModelManager().addStereotype(new StereotypeModel<FishStereotype>(new SimpleAnnotatedType<FishStereotype>(FishStereotype.class)));
+ container.getModelManager().addStereotype(new StereotypeModel<RiverFishStereotype>(new SimpleAnnotatedType<RiverFishStereotype>(RiverFishStereotype.class)));
+ container.getModelManager().addStereotype(new StereotypeModel<RequestScopedAnimalStereotype>(new SimpleAnnotatedType<RequestScopedAnimalStereotype>(RequestScopedAnimalStereotype.class)));
+ }
+
+ protected static <T> AnnotatedType<T> getEmptyAnnotatedItem(Class<T> type)
+ {
+ return new SimpleAnnotatedType<T>(type, new HashMap<Class<? extends Annotation>, Annotation>());
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/AbstractTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/BindingTypeTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -18,14 +18,14 @@
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
-public class BindingTypeTest extends AbstractModelTest
+public class BindingTypeTest extends AbstractTest
{
@SuppressWarnings("unchecked")
@Test @SpecAssertion(section={"2.3.3", "2.3.1"})
public void testDefaultBindingTypeDeclaredInJava()
{
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), emptyAnnotatedItem, manager);
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()
{
- SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), emptyAnnotatedItem, manager);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Synchronous.class);
}
@@ -77,7 +77,7 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Antelope.class, annotations);
- SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(emptyAnnotatedItem, annotatedItem, container);
+ SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(emptyAnnotatedItem, annotatedItem, manager);
assert Reflections.annotationSetMatches(antelope.getBindingTypes(), Asynchronous.class);
}
@@ -89,7 +89,7 @@
annotations.put(Asynchronous.class, new AsynchronousAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Cat.class, annotations);
- SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), annotatedItem, container);
+ SimpleComponentModel<Cat> cat = new SimpleComponentModel<Cat>(new SimpleAnnotatedType(Cat.class), annotatedItem, manager);
assert cat.getBindingTypes().size() == 1;
assert Reflections.annotationSetMatches(cat.getBindingTypes(), Asynchronous.class);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ConstructorModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -19,7 +19,7 @@
import org.jboss.webbeans.test.components.Order;
import org.jboss.webbeans.test.components.Sheep;
import org.jboss.webbeans.test.components.Turkey;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -36,7 +36,7 @@
public void before()
{
emptyAnnotatedItem = new SimpleAnnotatedType<Object>(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockContainerImpl(null);
+ container = new MockManagerImpl(null);
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ContainerTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -4,60 +4,49 @@
import java.util.ArrayList;
import java.util.List;
+import javax.webbeans.DeploymentException;
import javax.webbeans.Production;
import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.HornedAnimalDeploymentType;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.HornedAnimalDeploymentTypeAnnotationLiteral;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.Test;
-public class ContainerTest
+public class ContainerTest extends AbstractTest
{
@Test
public void testDefaultEnabledDeploymentTypes()
{
- ManagerImpl container = new MockContainerImpl(null);
+ ManagerImpl container = new MockManagerImpl(null);
assert container.getEnabledDeploymentTypes().size() == 2;
- assert container.getEnabledDeploymentTypes().get(0).annotationType().equals(Standard.class);
- assert container.getEnabledDeploymentTypes().get(1).annotationType().equals(Production.class);
+ assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert container.getEnabledDeploymentTypes().get(1).equals(Production.class);
}
@Test
public void testCustomDeploymentTypes()
{
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- enabledDeploymentTypes.add(new HornedAnimalDeploymentTypeAnnotationLiteral());
- ManagerImpl container = new MockContainerImpl(enabledDeploymentTypes);
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
+ ManagerImpl container = new MockManagerImpl(enabledDeploymentTypes);
assert container.getEnabledDeploymentTypes().size() == 3;
- assert container.getEnabledDeploymentTypes().get(0).annotationType().equals(Standard.class);
- assert container.getEnabledDeploymentTypes().get(1).annotationType().equals(AnotherDeploymentType.class);
- assert container.getEnabledDeploymentTypes().get(2).annotationType().equals(HornedAnimalDeploymentType.class);
+ assert container.getEnabledDeploymentTypes().get(0).equals(Standard.class);
+ assert container.getEnabledDeploymentTypes().get(1).equals(AnotherDeploymentType.class);
+ assert container.getEnabledDeploymentTypes().get(2).equals(HornedAnimalDeploymentType.class);
}
- @Test
+ @Test(expectedExceptions=DeploymentException.class)
public void testStandardMustBeDeclared()
{
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- enabledDeploymentTypes.add(new HornedAnimalDeploymentTypeAnnotationLiteral());
- boolean exception = false;
- try
- {
- new MockContainerImpl(enabledDeploymentTypes);
- }
- catch (Exception e)
- {
- exception = true;
- }
- assert exception;
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ enabledDeploymentTypes.add(HornedAnimalDeploymentType.class);
+ new MockManagerImpl(enabledDeploymentTypes);
}
}
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/DeferredEventNotificationTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -8,19 +8,19 @@
import javax.webbeans.Observer;
import javax.webbeans.Observes;
+import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.DeferredEventNotification;
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
import org.jboss.webbeans.test.components.Tuna;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockObserverImpl;
import org.testng.annotations.Test;
@@ -31,7 +31,7 @@
* @author David Allen
*
*/
-public class DeferredEventNotificationTest
+public class DeferredEventNotificationTest extends AbstractTest
{
public class Event
@@ -64,10 +64,10 @@
ManagerImpl manager;
SimpleComponentModel<Tuna> tuna;
InjectableMethod<Object> om;
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- manager = new MockContainerImpl(enabledDeploymentTypes);
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
// Create an observer with known binding types
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EnterpriseComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -23,12 +23,12 @@
import org.jboss.webbeans.test.components.Panther;
import org.jboss.webbeans.test.components.Puma;
import org.jboss.webbeans.test.components.Tiger;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-public class EnterpriseComponentModelTest
+public class EnterpriseComponentModelTest extends AbstractTest
{
private ManagerImpl container;
@@ -40,7 +40,7 @@
public void before()
{
emptyAnnotatedItem = new SimpleAnnotatedType<Object>(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockContainerImpl(null);
+ container = new MockManagerImpl(null);
}
@Test @SpecAssertion(section="2.7.2")
@@ -54,7 +54,7 @@
public void testStateless()
{
EnterpriseComponentModel<Lion> lion = new EnterpriseComponentModel<Lion>(new SimpleAnnotatedType<Lion>(Lion.class), emptyAnnotatedItem, container);
- assert lion.getScopeType().annotationType().equals(Dependent.class);
+ assert lion.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(lion.getBindingTypes(), Current.class);
assert lion.getName().equals("lion");
}
@@ -67,7 +67,7 @@
AnnotatedType annotatedItem = new SimpleAnnotatedType(Giraffe.class, annotations);
EnterpriseComponentModel<Giraffe> giraffe = new EnterpriseComponentModel<Giraffe>(new SimpleAnnotatedType(Giraffe.class), annotatedItem, container);
- assert giraffe.getScopeType().annotationType().equals(Dependent.class);
+ assert giraffe.getScopeType().equals(Dependent.class);
Reflections.annotationSetMatches(giraffe.getBindingTypes(), Current.class);
}
@@ -77,7 +77,7 @@
boolean exception = false;
try
{
- new EnterpriseComponentModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), emptyAnnotatedItem, container);
+ new EnterpriseComponentModel<Bear>(new SimpleAnnotatedType<Bear>(Bear.class), getEmptyAnnotatedItem(Bear.class), container);
}
catch (Exception e)
{
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -10,14 +10,13 @@
import javax.webbeans.Event;
import javax.webbeans.Standard;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.injectable.ComponentConstructor;
import org.jboss.webbeans.introspector.SimpleAnnotatedField;
import org.jboss.webbeans.model.EventComponentModel;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.components.DangerCall;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -30,17 +29,17 @@
*/
public class EventComponentModelTest
{
- private MockContainerImpl manager = null;
+ private MockManagerImpl manager = null;
private EventComponentModel<EventImpl<DangerCall>> eventComponentModel = null;
EventImpl<DangerCall> eventModelField = null;
@BeforeMethod
public void before() throws Exception
{
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- manager = new MockContainerImpl(enabledDeploymentTypes);
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
Field eventModelField = this.getClass().getDeclaredField("eventModelField");
eventComponentModel = new EventComponentModel<EventImpl<DangerCall>>(
new SimpleAnnotatedField<EventImpl<DangerCall>>(eventModelField),
@@ -64,7 +63,7 @@
@Test(groups = "eventbus")
public void testScopeType()
{
- assert eventComponentModel.getScopeType().annotationType().equals(Dependent.class);
+ assert eventComponentModel.getScopeType().equals(Dependent.class);
}
/**
@@ -73,15 +72,15 @@
@Test(groups = "eventbus")
public void testDeploymentType()
{
- assert eventComponentModel.getDeploymentType().annotationType().equals(Standard.class);
+ assert eventComponentModel.getDeploymentType().equals(Standard.class);
}
@Test(groups = "eventbus")
public void testApiTypes()
{
- Set<Class> apis = eventComponentModel.getApiTypes();
+ Set<Class<?>> apis = eventComponentModel.getApiTypes();
assert apis.size() >= 1;
- for (Class api : apis)
+ for (Class<?> api : apis)
{
api.equals(Event.class);
}
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/EventTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -6,18 +6,19 @@
import javax.webbeans.DuplicateBindingTypeException;
import javax.webbeans.Event;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
+import javax.webbeans.Standard;
+
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.test.annotations.AnimalStereotype;
+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.annotations.Synchronous;
import org.jboss.webbeans.test.bindings.AnimalStereotypeAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.FishStereotypeAnnotationLiteral;
+import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
import org.jboss.webbeans.test.bindings.TameAnnotationLiteral;
-import org.jboss.webbeans.test.bindings.SynchronousAnnotationLiteral;
import org.jboss.webbeans.test.components.DangerCall;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -31,15 +32,15 @@
@SpecVersion("20081012")
public class EventTest
{
- private MockContainerImpl manager = null;
+ private MockManagerImpl manager = null;
@BeforeMethod
public void before() throws Exception
{
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- manager = new MockContainerImpl(enabledDeploymentTypes);
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
}
/**
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/InjectableTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,25 +1,44 @@
package org.jboss.webbeans.test;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.webbeans.Current;
+import javax.webbeans.manager.Bean;
+import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.injectable.InjectableField;
-import org.jboss.webbeans.test.components.Farm;
-import org.jboss.webbeans.test.components.Pig;
+import org.jboss.webbeans.introspector.SimpleAnnotatedType;
+import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.components.FishFarm;
+import org.jboss.webbeans.test.components.Tuna;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
-public class InjectableTest
+public class InjectableTest extends AbstractTest
{
@SuppressWarnings("unchecked")
@Test
public void testInjectableField() throws Exception
{
- InjectableField<Pig> pig = new InjectableField<Pig>(Farm.class.getDeclaredField("pig"));
- assert pig.getAnnotatedItem().getType().isAssignableFrom(Pig.class);
- assert pig.getBindingTypes().size() == 1;
- assert Reflections.annotationSetMatches(pig.getBindingTypes(), Current.class);
- assert pig.getType().isAssignableFrom(Pig.class);
+ InjectableField<Tuna> tuna = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
+ assert tuna.getAnnotatedItem().getType().isAssignableFrom(Tuna.class);
+ assert tuna.getBindingTypes().size() == 1;
+ assert Reflections.annotationSetMatches(tuna.getBindingTypes(), Current.class);
+ assert tuna.getType().isAssignableFrom(Tuna.class);
}
+ @Test
+ public void testPossibleTargets() throws Exception
+ {
+ InjectableField<Tuna> tunaField = new InjectableField<Tuna>(FishFarm.class.getDeclaredField("tuna"));
+ Bean<Tuna> tunaBean = new BeanImpl<Tuna>(new SimpleComponentModel<Tuna>(new SimpleAnnotatedType<Tuna>(Tuna.class), getEmptyAnnotatedItem(Tuna.class), super.manager), manager);
+ Set<Bean<?>> beans = new HashSet<Bean<?>>();
+ beans.add(tunaBean);
+ Set<Bean<?>> possibleTargets = tunaField.getPossibleBeans(beans);
+ assert possibleTargets.size() == 1;
+ assert possibleTargets.contains(tunaBean);
+ }
+
}
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ObserverTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -6,23 +6,22 @@
import java.util.List;
import java.util.Map;
-import javax.webbeans.Observes;
import javax.webbeans.Observer;
+import javax.webbeans.Observes;
+import javax.webbeans.Standard;
import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.bindings.StandardAnnotationLiteral;
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injectable.InjectableMethod;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
+import org.jboss.webbeans.test.annotations.AnotherDeploymentType;
import org.jboss.webbeans.test.annotations.Asynchronous;
-import org.jboss.webbeans.test.bindings.AnotherDeploymentTypeAnnotationLiteral;
import org.jboss.webbeans.test.bindings.AsynchronousAnnotationLiteral;
import org.jboss.webbeans.test.components.Tuna;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.jboss.webbeans.test.mock.MockObserverImpl;
-import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -58,10 +57,10 @@
@BeforeMethod
public void before() throws Exception
{
- List<Annotation> enabledDeploymentTypes = new ArrayList<Annotation>();
- enabledDeploymentTypes.add(new StandardAnnotationLiteral());
- enabledDeploymentTypes.add(new AnotherDeploymentTypeAnnotationLiteral());
- manager = new MockContainerImpl(enabledDeploymentTypes);
+ List<Class<? extends Annotation>> enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ enabledDeploymentTypes.add(Standard.class);
+ enabledDeploymentTypes.add(AnotherDeploymentType.class);
+ manager = new MockManagerImpl(enabledDeploymentTypes);
// Create an observer with known binding types
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerExpressionComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -6,7 +6,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -20,7 +20,7 @@
public void before()
{
emptyAnnotatedItem = new SimpleAnnotatedType(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockContainerImpl(null);
+ container = new MockManagerImpl(null);
}
@Test(groups="producerExpression") @SpecAssertion(section="3.4")
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ProducerMethodComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,14 +1,10 @@
package org.jboss.webbeans.test;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.HashMap;
import javax.webbeans.Current;
import javax.webbeans.Dependent;
-import org.jboss.webbeans.ManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedMethod;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.ProducerMethodComponentModel;
@@ -26,33 +22,21 @@
import org.jboss.webbeans.test.components.TrapdoorSpider;
import org.jboss.webbeans.test.components.broken.ComponentWithFinalProducerMethod;
import org.jboss.webbeans.test.components.broken.ComponentWithStaticProducerMethod;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-public class ProducerMethodComponentModelTest
+public class ProducerMethodComponentModelTest extends AbstractTest
{
-
- private ManagerImpl container;
- private AnnotatedType<?> emptyAnnotatedItem;
- @BeforeMethod
- public void before()
- {
- emptyAnnotatedItem = new SimpleAnnotatedType(null, new HashMap<Class<? extends Annotation>, Annotation>());
- container = new MockContainerImpl(null);
- }
-
@Test @SpecAssertion(section="3.3")
public void testStaticMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<ComponentWithStaticProducerMethod> componentModel = new SimpleComponentModel<ComponentWithStaticProducerMethod>(new SimpleAnnotatedType<ComponentWithStaticProducerMethod>(ComponentWithStaticProducerMethod.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<ComponentWithStaticProducerMethod> componentModel = new SimpleComponentModel<ComponentWithStaticProducerMethod>(new SimpleAnnotatedType<ComponentWithStaticProducerMethod>(ComponentWithStaticProducerMethod.class), getEmptyAnnotatedItem(ComponentWithStaticProducerMethod.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = ComponentWithStaticProducerMethod.class.getMethod("getString");
boolean exception = false;
try
{
- new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod(method), container);
+ new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
}
catch (Exception e)
{
@@ -64,10 +48,10 @@
@Test @SpecAssertion(section="3.3")
public void testApiTypes() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getApiTypes().contains(Tarantula.class);
assert tarantulaModel.getApiTypes().contains(DeadlySpider.class);
assert tarantulaModel.getApiTypes().contains(Spider.class);
@@ -79,10 +63,10 @@
@Test @SpecAssertion(section="3.3.1")
public void testDefaultBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Current.class);
}
@@ -90,10 +74,10 @@
@Test
public void testBindingType() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTameTarantula");
- ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<Tarantula> tarantulaModel = new ProducerMethodComponentModel<Tarantula>(new SimpleAnnotatedMethod<Tarantula>(method), manager);
assert tarantulaModel.getBindingTypes().size() == 1;
assert tarantulaModel.getBindingTypes().iterator().next().annotationType().equals(Tame.class);
}
@@ -101,13 +85,13 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<ComponentWithFinalProducerMethod> componentModel = new SimpleComponentModel<ComponentWithFinalProducerMethod>(new SimpleAnnotatedType<ComponentWithFinalProducerMethod>(ComponentWithFinalProducerMethod.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<ComponentWithFinalProducerMethod> componentModel = new SimpleComponentModel<ComponentWithFinalProducerMethod>(new SimpleAnnotatedType<ComponentWithFinalProducerMethod>(ComponentWithFinalProducerMethod.class), getEmptyAnnotatedItem(ComponentWithFinalProducerMethod.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = ComponentWithFinalProducerMethod.class.getMethod("getString");
boolean exception = false;
try
{
- new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod(method), container);
+ new ProducerMethodComponentModel<String>(new SimpleAnnotatedMethod<String>(method), manager);
}
catch (Exception e)
{
@@ -119,40 +103,40 @@
@Test @SpecAssertion(section="3.3")
public void testFinalMethodWithDependentScope() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceTrapdoorSpider");
- ProducerMethodComponentModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodComponentModel<TrapdoorSpider>(new SimpleAnnotatedMethod(method), container);
- assert trapdoorSpiderModel.getScopeType().annotationType().equals(Dependent.class);
+ ProducerMethodComponentModel<TrapdoorSpider> trapdoorSpiderModel = new ProducerMethodComponentModel<TrapdoorSpider>(new SimpleAnnotatedMethod<TrapdoorSpider>(method), manager);
+ assert trapdoorSpiderModel.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="3.3.6")
public void testNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceBlackWidow");
- ProducerMethodComponentModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodComponentModel<BlackWidow>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<BlackWidow> blackWidowSpiderModel = new ProducerMethodComponentModel<BlackWidow>(new SimpleAnnotatedMethod<BlackWidow>(method), manager);
assert blackWidowSpiderModel.getName().equals("blackWidow");
}
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("produceDaddyLongLegs");
- ProducerMethodComponentModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodComponentModel<DaddyLongLegs>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<DaddyLongLegs> daddyLongLegsSpiderModel = new ProducerMethodComponentModel<DaddyLongLegs>(new SimpleAnnotatedMethod<DaddyLongLegs>(method), manager);
assert daddyLongLegsSpiderModel.getName().equals("produceDaddyLongLegs");
}
@Test @SpecAssertion(section="3.3.6")
public void testDefaultNamedJavaBeanMethod() throws SecurityException, NoSuchMethodException
{
- SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), emptyAnnotatedItem, container);
- container.getModelManager().addComponentModel(componentModel);
+ SimpleComponentModel<SpiderProducer> componentModel = new SimpleComponentModel<SpiderProducer>(new SimpleAnnotatedType<SpiderProducer>(SpiderProducer.class), getEmptyAnnotatedItem(SpiderProducer.class), manager);
+ manager.getModelManager().addComponentModel(componentModel);
Method method = SpiderProducer.class.getMethod("getLadybirdSpider");
- ProducerMethodComponentModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodComponentModel<LadybirdSpider>(new SimpleAnnotatedMethod(method), container);
+ ProducerMethodComponentModel<LadybirdSpider> ladybirdSpiderModel = new ProducerMethodComponentModel<LadybirdSpider>(new SimpleAnnotatedMethod<LadybirdSpider>(method), manager);
assert ladybirdSpiderModel.getName().equals("ladybirdSpider");
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/RemoteComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -16,7 +16,7 @@
import org.jboss.webbeans.test.components.TameOrangutan;
import org.jboss.webbeans.test.components.broken.Chimpanzee;
import org.jboss.webbeans.test.components.broken.Gibbon;
-import org.jboss.webbeans.test.mock.MockContainerImpl;
+import org.jboss.webbeans.test.mock.MockManagerImpl;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
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-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/ScopeTypeTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -27,7 +27,7 @@
import org.jboss.webbeans.test.components.SeaBass;
import org.testng.annotations.Test;
-public class ScopeTypeTest extends AbstractModelTest
+public class ScopeTypeTest extends AbstractTest
{
@Test @SpecAssertion(section="2.4")
@@ -57,8 +57,8 @@
@Test @SpecAssertion(section="2.4.3")
public void testScopeDeclaredInJava()
{
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), emptyAnnotatedItem, container);
- assert trout.getScopeType().annotationType().equals(RequestScoped.class);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), getEmptyAnnotatedItem(SeaBass.class), manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.3")
@@ -67,7 +67,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<ComponentWithTooManyScopeTypes>(new SimpleAnnotatedType(ComponentWithTooManyScopeTypes.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<ComponentWithTooManyScopeTypes>(new SimpleAnnotatedType<ComponentWithTooManyScopeTypes>(ComponentWithTooManyScopeTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyScopeTypes.class), manager);
}
catch (Exception e)
{
@@ -85,8 +85,8 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
- AnnotatedType antelopeAnnotatedItem = new SimpleAnnotatedType(Antelope.class, annotations);
- new SimpleComponentModel<Antelope>(emptyAnnotatedItem, antelopeAnnotatedItem, container);
+ AnnotatedType<Antelope> antelopeAnnotatedItem = new SimpleAnnotatedType<Antelope>(Antelope.class, annotations);
+ new SimpleComponentModel<Antelope>(getEmptyAnnotatedItem(Antelope.class), antelopeAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -100,20 +100,20 @@
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(RequestScoped.class, new RequestScopedAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(Order.class, annotations);
+ AnnotatedType<Order> annotatedItem = new SimpleAnnotatedType<Order>(Order.class, annotations);
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), annotatedItem, container);
- assert order.getScopeType().annotationType().equals(RequestScoped.class);
+ SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), annotatedItem, manager);
+ assert order.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.4")
public void testScopeMissingInXml()
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
- AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
- assert trout.getScopeType().annotationType().equals(RequestScoped.class);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.4")
@@ -121,16 +121,16 @@
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(ConversationScoped.class, new ConversationScopedAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
- assert trout.getScopeType().annotationType().equals(ConversationScoped.class);
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(ConversationScoped.class);
}
@Test @SpecAssertion(section="2.4.5")
public void testDefaultScope()
{
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), emptyAnnotatedItem, container);
- assert order.getScopeType().annotationType().equals(Dependent.class);
+ SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType<Order>(Order.class), getEmptyAnnotatedItem(Order.class), manager);
+ assert order.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section={"2.4.5", "2.7.2"})
@@ -138,9 +138,9 @@
{
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
- assert trout.getScopeType().annotationType().equals(RequestScoped.class);
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.5")
@@ -149,12 +149,12 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
annotations.put(AnimalStereotype.class, new AnimalStereotypeAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(Haddock.class, annotations);
+ AnnotatedType<Haddock> annotatedItem = new SimpleAnnotatedType<Haddock>(Haddock.class, annotations);
boolean exception = false;
try
{
- new SimpleComponentModel<Haddock>(new SimpleAnnotatedType(Haddock.class), annotatedItem, container);
+ new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
}
catch (Exception e)
{
@@ -169,10 +169,10 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
annotations.put(AnimalStereotype.class, new AnimalStereotypeAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
+ AnnotatedType<SeaBass> annotatedItem = new SimpleAnnotatedType<SeaBass>(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
- assert trout.getScopeType().annotationType().equals(RequestScoped.class);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType<SeaBass>(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.4.5")
@@ -181,10 +181,10 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
annotations.put(RiverFishStereotype.class, new RiverFishStereotypeAnnotationLiteral());
- AnnotatedType annotatedItem = new SimpleAnnotatedType(Haddock.class, annotations);
+ AnnotatedType<Haddock> annotatedItem = new SimpleAnnotatedType<Haddock>(Haddock.class, annotations);
- SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType(Haddock.class), annotatedItem, container);
- assert haddock.getScopeType().annotationType().equals(ApplicationScoped.class);
+ SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType<Haddock>(Haddock.class), annotatedItem, manager);
+ assert haddock.getScopeType().equals(ApplicationScoped.class);
}
}
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/SimpleComponentModelTest.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -36,16 +36,16 @@
import org.jboss.webbeans.test.components.Horse;
import org.jboss.webbeans.test.components.Moose;
import org.jboss.webbeans.test.components.Order;
-import org.jboss.webbeans.test.components.Pig;
import org.jboss.webbeans.test.components.SeaBass;
import org.jboss.webbeans.test.components.Tuna;
import org.jboss.webbeans.test.components.broken.ComponentWithTooManyDeploymentTypes;
+import org.jboss.webbeans.test.components.broken.Pig;
import org.jboss.webbeans.test.components.broken.OuterComponent.InnerComponent;
import org.jboss.webbeans.util.Reflections;
import org.testng.annotations.Test;
@SpecVersion("20080925")
-public class SimpleComponentModelTest extends AbstractModelTest
+public class SimpleComponentModelTest extends AbstractTest
{
private class NamedAnnotationLiteral extends AnnotationLiteral<Named> implements Named
@@ -73,7 +73,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType(ComponentWithTooManyDeploymentTypes.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType<ComponentWithTooManyDeploymentTypes>(ComponentWithTooManyDeploymentTypes.class), getEmptyAnnotatedItem(ComponentWithTooManyDeploymentTypes.class), manager);
}
catch (Exception e)
{
@@ -89,24 +89,24 @@
xmlDefinedDeploymentTypeAnnotations.put(AnotherDeploymentType.class, new AnotherDeploymentTypeAnnotationLiteral());
AnnotatedType xmlDefinedDeploymentTypeAnnotatedItem = new SimpleAnnotatedType(ComponentWithTooManyDeploymentTypes.class, xmlDefinedDeploymentTypeAnnotations);
- SimpleComponentModel<ComponentWithTooManyDeploymentTypes> component = new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType(ComponentWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, container);
- assert component.getDeploymentType().annotationType().equals(AnotherDeploymentType.class);
+ SimpleComponentModel<ComponentWithTooManyDeploymentTypes> component = new SimpleComponentModel<ComponentWithTooManyDeploymentTypes>(new SimpleAnnotatedType(ComponentWithTooManyDeploymentTypes.class), xmlDefinedDeploymentTypeAnnotatedItem, manager);
+ assert component.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test @SpecAssertion(section="2.5.5")
public void testXmlDefaultDeploymentType()
{
AnnotatedType antelopeAnnotatedItem = new SimpleAnnotatedType(Antelope.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(emptyAnnotatedItem, antelopeAnnotatedItem, container);
- assert antelope.getDeploymentType().annotationType().equals(Production.class);
+ SimpleComponentModel<Antelope> antelope = new SimpleComponentModel<Antelope>(emptyAnnotatedItem, antelopeAnnotatedItem, manager);
+ assert antelope.getDeploymentType().equals(Production.class);
}
@Test @SpecAssertion(section="2.5.4")
public void testXmlRespectsJavaDeploymentType()
{
AnnotatedType annotatedItem = new SimpleAnnotatedType(Tuna.class, new HashMap<Class<? extends Annotation>, Annotation>());
- SimpleComponentModel<Tuna> tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType(Tuna.class), annotatedItem, container);
- assert tuna.getDeploymentType().annotationType().equals(AnotherDeploymentType.class);
+ SimpleComponentModel<Tuna> tuna = new SimpleComponentModel<Tuna>(new SimpleAnnotatedType(Tuna.class), annotatedItem, manager);
+ assert tuna.getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test @SpecAssertion(section="2.5.7")
@@ -116,8 +116,8 @@
annotations.put(HornedMammalStereotype.class, new HornedMamalStereotypeAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(Moose.class, annotations);
- SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType(Moose.class), annotatedItem, container);
- assert moose.getDeploymentType().annotationType().equals(HornedAnimalDeploymentType.class);
+ SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType(Moose.class), annotatedItem, manager);
+ assert moose.getDeploymentType().equals(HornedAnimalDeploymentType.class);
}
@@ -127,8 +127,8 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(FishStereotype.class, new FishStereotypeAnnotationLiteral());
AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
- assert trout.getScopeType().annotationType().equals(RequestScoped.class);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, manager);
+ assert trout.getScopeType().equals(RequestScoped.class);
}
// **** TESTS FOR SCOPES **** //
@@ -140,7 +140,7 @@
@Test @SpecAssertion(section="2.6.1")
public void testDefaultNamed()
{
- SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType(Haddock.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<Haddock> haddock = new SimpleComponentModel<Haddock>(new SimpleAnnotatedType(Haddock.class), emptyAnnotatedItem, manager);
assert haddock.getName() != null;
assert haddock.getName().equals("haddock");
}
@@ -151,7 +151,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(Named.class, new NamedAnnotationLiteral(""));
AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, manager);
assert trout.getName() != null;
assert trout.getName().equals("seaBass");
@@ -163,7 +163,7 @@
Map<Class<? extends Annotation>, Annotation> annotations = new HashMap<Class<? extends Annotation>, Annotation>();
annotations.put(Named.class, new NamedAnnotationLiteral("aTrout"));
AnnotatedType annotatedItem = new SimpleAnnotatedType(SeaBass.class, annotations);
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, container);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), annotatedItem, manager);
assert trout.getName().equals("aTrout");
}
@@ -171,14 +171,14 @@
@Test @SpecAssertion(section="2.6.4")
public void testNotNamed()
{
- SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<SeaBass> trout = new SimpleComponentModel<SeaBass>(new SimpleAnnotatedType(SeaBass.class), emptyAnnotatedItem, manager);
assert trout.getName() == null;
}
@Test @SpecAssertion(section="2.6.1")
public void testNonDefaultNamed()
{
- SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType(Moose.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<Moose> moose = new SimpleComponentModel<Moose>(new SimpleAnnotatedType(Moose.class), emptyAnnotatedItem, manager);
assert moose.getName().equals("aMoose");
}
@@ -195,22 +195,22 @@
orderXmlAnnotations.put(Named.class, new NamedAnnotationLiteral ("currentSynchronousOrder"));
AnnotatedType currentSynchronousOrderAnnotatedItem = new SimpleAnnotatedType(Order.class, orderXmlAnnotations);
- SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, container);
- assert Production.class.equals(order.getDeploymentType().annotationType());
+ SimpleComponentModel<Order> order = new SimpleComponentModel<Order>(new SimpleAnnotatedType(Order.class), currentSynchronousOrderAnnotatedItem, manager);
+ assert Production.class.equals(order.getDeploymentType());
assert "currentSynchronousOrder".equals(order.getName());
assert order.getBindingTypes().size() == 2;
assert Reflections.annotationSetMatches(order.getBindingTypes(), Current.class, Synchronous.class);
- assert order.getScopeType().annotationType().equals(Dependent.class);
+ assert order.getScopeType().equals(Dependent.class);
}
@Test @SpecAssertion(section="2.7.2")
public void testSingleStereotype()
{
- SimpleComponentModel<Gorilla> gorilla = new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType(Gorilla.class), emptyAnnotatedItem, container);
+ SimpleComponentModel<Gorilla> gorilla = new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType(Gorilla.class), emptyAnnotatedItem, manager);
assert gorilla.getName() == null;
- assert gorilla.getDeploymentType().annotationType().equals(Production.class);
+ assert gorilla.getDeploymentType().equals(Production.class);
assert gorilla.getBindingTypes().iterator().next().annotationType().equals(Current.class);
- assert gorilla.getScopeType().annotationType().equals(RequestScoped.class);
+ assert gorilla.getScopeType().equals(RequestScoped.class);
}
@Test @SpecAssertion(section="2.7.4")
@@ -218,7 +218,7 @@
{
try
{
- new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType(Gorilla.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Gorilla>(new SimpleAnnotatedType(Gorilla.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -230,7 +230,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testRequiredTypeIsNotImplemented()
{
- new SimpleComponentModel<Chair>(new SimpleAnnotatedType(Chair.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Chair>(new SimpleAnnotatedType(Chair.class), emptyAnnotatedItem, manager);
}
@Test @SpecAssertion(section="2.7.4")
@@ -238,7 +238,7 @@
{
try
{
- new SimpleComponentModel<Goldfish>(new SimpleAnnotatedType(Goldfish.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Goldfish>(new SimpleAnnotatedType(Goldfish.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -250,7 +250,7 @@
@Test(expectedExceptions=Exception.class) @SpecAssertion(section="2.7.4")
public void testScopeIsNotSupported()
{
- new SimpleComponentModel<Carp>(new SimpleAnnotatedType(Carp.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Carp>(new SimpleAnnotatedType(Carp.class), emptyAnnotatedItem, manager);
}
@Test @SpecAssertion(section="2.7.2")
@@ -267,7 +267,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Cow>(new SimpleAnnotatedType(Cow.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Cow>(new SimpleAnnotatedType(Cow.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -282,7 +282,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<InnerComponent>(new SimpleAnnotatedType(InnerComponent.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<InnerComponent>(new SimpleAnnotatedType(InnerComponent.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -297,7 +297,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Horse>(new SimpleAnnotatedType(Horse.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Horse>(new SimpleAnnotatedType(Horse.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -310,7 +310,7 @@
AnnotatedType annotatedItem = new SimpleAnnotatedType(Horse.class, annotations);
try
{
- new SimpleComponentModel<Horse>(new SimpleAnnotatedType(Horse.class), annotatedItem, container);
+ new SimpleComponentModel<Horse>(new SimpleAnnotatedType(Horse.class), annotatedItem, manager);
}
catch (Exception e)
{
@@ -324,7 +324,7 @@
boolean exception = false;
try
{
- new SimpleComponentModel<Pig>(new SimpleAnnotatedType(Pig.class), emptyAnnotatedItem, container);
+ new SimpleComponentModel<Pig>(new SimpleAnnotatedType(Pig.class), emptyAnnotatedItem, manager);
}
catch (Exception e)
{
@@ -337,7 +337,7 @@
AnnotatedType annotatedItem = new SimpleAnnotatedType(Pig.class, annotations);
try
{
- new SimpleComponentModel<Pig>(new SimpleAnnotatedType(Pig.class), annotatedItem, container);
+ new SimpleComponentModel<Pig>(new SimpleAnnotatedType(Pig.class), annotatedItem, manager);
}
catch (Exception e)
{
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farm.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farm.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farm.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,13 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Current;
-import javax.webbeans.Production;
-
- at Production
-public class Farm
-{
-
- @Current
- private Pig pig;
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java (from rev 127, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Farm.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -0,0 +1,13 @@
+package org.jboss.webbeans.test.components;
+
+import javax.webbeans.Current;
+import javax.webbeans.Production;
+
+ at Production
+public class FishFarm
+{
+
+ @Current
+ private Tuna tuna;
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/FishFarm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Pig.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Pig.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Pig.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,16 +0,0 @@
-package org.jboss.webbeans.test.components;
-
-import javax.webbeans.Production;
-import javax.webbeans.RequestScoped;
-
- at Production
- at RequestScoped
-public class Pig
-{
-
- public final void washPig()
- {
-
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java (from rev 125, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/Pig.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.components.broken;
+
+import javax.webbeans.Production;
+import javax.webbeans.RequestScoped;
+
+ at Production
+ at RequestScoped
+public class Pig
+{
+
+ public final void washPig()
+ {
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/components/broken/Pig.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java 2008-10-23 13:45:33 UTC (rev 127)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -1,52 +0,0 @@
-package org.jboss.webbeans.test.mock;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.webbeans.ManagerImpl;
-
-public class MockContainerImpl extends ManagerImpl
-{
- private Object event = null;
- private Annotation[] eventBindings = null;
-
- public MockContainerImpl(List<Annotation> enabledDeploymentTypes)
- {
- super(enabledDeploymentTypes);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.ManagerImpl#fireEvent(java.lang.Object, java.lang.annotation.Annotation[])
- */
- @Override
- public void fireEvent(Object event, Annotation... bindings)
- {
- // Record the event
- this.event = event;
- this.eventBindings = bindings;
- }
-
- /**
- * Retrieves the event which was last fired with this manager.
- * @return the event
- */
- public final Object getEvent()
- {
- return event;
- }
-
- /**
- * @return the eventBindings
- */
- public final Set<Annotation> getEventBindings()
- {
- if (eventBindings != null)
- return new HashSet<Annotation>(Arrays.asList(eventBindings));
- else
- return null;
- }
-
-}
Copied: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java (from rev 125, ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockContainerImpl.java)
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java 2008-10-23 17:13:25 UTC (rev 128)
@@ -0,0 +1,52 @@
+package org.jboss.webbeans.test.mock;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.webbeans.ManagerImpl;
+
+public class MockManagerImpl extends ManagerImpl
+{
+ private Object event = null;
+ private Annotation[] eventBindings = null;
+
+ public MockManagerImpl(List<Class<? extends Annotation>> enabledDeploymentTypes)
+ {
+ super(enabledDeploymentTypes);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.webbeans.ManagerImpl#fireEvent(java.lang.Object, java.lang.annotation.Annotation[])
+ */
+ @Override
+ public void fireEvent(Object event, Annotation... bindings)
+ {
+ // Record the event
+ this.event = event;
+ this.eventBindings = bindings;
+ }
+
+ /**
+ * Retrieves the event which was last fired with this manager.
+ * @return the event
+ */
+ public final Object getEvent()
+ {
+ return event;
+ }
+
+ /**
+ * @return the eventBindings
+ */
+ public final Set<Annotation> getEventBindings()
+ {
+ if (eventBindings != null)
+ return new HashSet<Annotation>(Arrays.asList(eventBindings));
+ else
+ return null;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockManagerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the weld-commits
mailing list