Weld SVN: r4040 - examples/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:26:01 -0400 (Wed, 14 Oct 2009)
New Revision: 4040
Modified:
examples/trunk/pom.xml
Log:
versions
Modified: examples/trunk/pom.xml
===================================================================
--- examples/trunk/pom.xml 2009-10-14 14:23:08 UTC (rev 4039)
+++ examples/trunk/pom.xml 2009-10-14 14:26:01 UTC (rev 4040)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>2</version>
</parent>
<groupId>org.jboss.weld.examples</groupId>
<artifactId>weld-examples-parent</artifactId>
@@ -87,8 +87,8 @@
<properties>
<jsf.version>2.0.0-RC</jsf.version>
- <weld.api.version>1.0-SNAPSHOT</weld.api.version>
- <weld.core.version>1.0.0-SNAPSHOT</weld.core.version>
+ <weld.api.version>1.0-CR1</weld.api.version>
+ <weld.core.version>1.0.0-CR1</weld.core.version>
<weld.extensions.version>1.0.0-SNAPSHOT</weld.extensions.version>
<jetty.version>6.1.21</jetty.version>
<uel.glassfish.version>2.1.2-b04</uel.glassfish.version>
15 years, 1 month
Weld SVN: r4039 - in extensions/trunk/servlet/int/src/main: java/org/jboss/weld/environment/servlet/jsf and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:23:08 -0400 (Wed, 14 Oct 2009)
New Revision: 4039
Removed:
extensions/trunk/servlet/int/src/main/java/org/jboss/webbeans/environment/servlet/
Modified:
extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java
extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml
Log:
cleanup, refactor
Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java 2009-10-14 14:21:38 UTC (rev 4038)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/jsf/WeldApplication.java 2009-10-14 14:23:08 UTC (rev 4039)
@@ -23,7 +23,6 @@
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
-import org.jboss.weld.manager.api.WeldManager;
import org.jboss.weld.environment.servlet.util.Reflections;
/**
@@ -37,61 +36,62 @@
private final Application application;
private ExpressionFactory expressionFactory;
+ private BeanManager beanManager;
public WeldApplication(Application application)
{
this.application = application;
- BeanManager beanManager = getBeanManager();
- if (beanManager != null)
+ }
+
+ private void init()
+ {
+ if (expressionFactory == null && application.getExpressionFactory() != null && beanManager() != null)
{
application.addELContextListener(Reflections.<ELContextListener>newInstance("org.jboss.weld.el.WeldELContextListener"));
- application.addELResolver(beanManager.getELResolver());
+ application.addELResolver(beanManager().getELResolver());
+ this.expressionFactory = beanManager().wrapExpressionFactory(application.getExpressionFactory());
}
}
@Override
protected Application delegate()
{
+ init();
return application;
}
@Override
public ExpressionFactory getExpressionFactory()
{
- // Application is multi-threaded, but no need to guard against races (re-
- // creating the cached expression factory doesn't matter) or liveness
- // (the value read by all threads will be the same)
- // We have to do this lazily as Mojarra hasn't set the ExpressionFactory
- // when the object is created
- if (this.expressionFactory == null)
+ init();
+ if (expressionFactory == null)
{
- BeanManager beanManager = getBeanManager();
- if (beanManager != null)
- {
- this.expressionFactory = beanManager.wrapExpressionFactory(delegate().getExpressionFactory());
- }
- else
- {
- // WB failed to initialize properly
- this.expressionFactory = delegate().getExpressionFactory();
- }
+ return application.getExpressionFactory();
}
- return expressionFactory;
+ else
+ {
+ return expressionFactory;
+ }
}
- private static WeldManager getBeanManager()
+ private BeanManager beanManager()
{
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (!(facesContext.getExternalContext().getContext() instanceof ServletContext))
+ if (beanManager == null)
{
- throw new IllegalStateException("Not in a servlet environment!");
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ if (!(facesContext.getExternalContext().getContext() instanceof ServletContext))
+ {
+ throw new IllegalStateException("Not in a servlet environment!");
+ }
+ ServletContext ctx = (ServletContext) facesContext.getExternalContext().getContext();
+ if (ctx.getAttribute(BeanManager.class.getName()) == null)
+ {
+ return null;
+ }
+ this.beanManager = (BeanManager) ctx.getAttribute(BeanManager.class.getName());
}
- ServletContext ctx = (ServletContext) facesContext.getExternalContext().getContext();
- if (ctx.getAttribute(BeanManager.class.getName()) == null)
- {
- throw new IllegalStateException("BeanManager has not been pushed into the ServletContext");
- }
- return (WeldManager) ctx.getAttribute(BeanManager.class.getName());
+ return beanManager;
+
}
}
Modified: extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml
===================================================================
--- extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml 2009-10-14 14:21:38 UTC (rev 4038)
+++ extensions/trunk/servlet/int/src/main/resources/META-INF/faces-config.xml 2009-10-14 14:23:08 UTC (rev 4039)
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<faces-config id="webbeans" version="1.2"
+<faces-config id="weld" version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
15 years, 1 month
Weld SVN: r4038 - extensions/trunk/servlet/tests/src/test/resources/org/jboss/testharness/impl/packaging/war.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:21:38 -0400 (Wed, 14 Oct 2009)
New Revision: 4038
Modified:
extensions/trunk/servlet/tests/src/test/resources/org/jboss/testharness/impl/packaging/war/custom-web.xml
Log:
rename
Modified: extensions/trunk/servlet/tests/src/test/resources/org/jboss/testharness/impl/packaging/war/custom-web.xml
===================================================================
--- extensions/trunk/servlet/tests/src/test/resources/org/jboss/testharness/impl/packaging/war/custom-web.xml 2009-10-14 14:20:50 UTC (rev 4037)
+++ extensions/trunk/servlet/tests/src/test/resources/org/jboss/testharness/impl/packaging/war/custom-web.xml 2009-10-14 14:21:38 UTC (rev 4038)
@@ -12,7 +12,7 @@
</listener>
<listener>
- <listener-class>org.jboss.webbeans.environment.servlet.Listener</listener-class>
+ <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
<servlet>
15 years, 1 month
Weld SVN: r4037 - in extensions/trunk/wicket/src/main: java/org/jboss/weld/wicket/util and 1 other directories.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:20:50 -0400 (Wed, 14 Oct 2009)
New Revision: 4037
Added:
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/NonContextual.java
Removed:
extensions/trunk/wicket/src/main/resources/META-INF/beans.xml
Modified:
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java
Log:
Don't make classes beans, but use NonContextual injection
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java 2009-10-14 14:19:37 UTC (rev 4036)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/BeanManagerLookup.java 2009-10-14 14:20:50 UTC (rev 4037)
@@ -21,7 +21,8 @@
* This is the spec-defined name for the bean manager as registered in JNDI
* See JSR-299 11.3
*/
- private static String beanManagerJndiName = "java:comp/BeanManager";
+ // TODO Change to java:comp/BeanManager when JBoss AS supports it
+ private static String beanManagerJndiName = "java:app/BeanManager";
public static void setBeanManagerJndiName(String beanManagerJndiName)
{
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-14 14:19:37 UTC (rev 4036)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-14 14:20:50 UTC (rev 4037)
@@ -1,13 +1,5 @@
package org.jboss.weld.wicket;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
import org.apache.wicket.Request;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.Response;
@@ -15,6 +7,7 @@
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.protocol.http.WebResponse;
import org.apache.wicket.request.IRequestCycleProcessor;
+import org.jboss.weld.wicket.util.NonContextual;
/**
* A convenience subclass of wicket's WebApplication which adds the hooks
@@ -27,6 +20,7 @@
* Weld, or your subclasses of those classes.
*
* @author cpopetz
+ * @author pmuir
*
* @see WebApplication
* @see WeldWebRequestCycleProcessor
@@ -35,30 +29,15 @@
public abstract class WeldApplication extends WebApplication
{
- private <T> T getInstanceByType(Class<T> beanType)
- {
- BeanManager manager = BeanManagerLookup.getBeanManager();
- Bean<T> bean = (Bean<T>) ensureUniqueBean(beanType, manager.getBeans(beanType));
- return (T) manager.getReference(bean, beanType, manager.createCreationalContext(bean));
- }
-
- private static Bean<?> ensureUniqueBean(Type type, Set<Bean<?>> beans)
- {
- if (beans.size() == 0)
- {
- throw new UnsatisfiedResolutionException("Unable to resolve any Web Beans of " + type);
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException("More than one bean available for type " + type);
- }
- return beans.iterator().next();
- }
+ private final NonContextual<WeldComponentInstantiationListener> weldComponentInstantiationListener;
+ private final NonContextual<WeldWebRequestCycleProcessor> weldWebRequestCycleProcessor;
/**
*/
public WeldApplication()
{
+ this.weldComponentInstantiationListener = new NonContextual<WeldComponentInstantiationListener>(BeanManagerLookup.getBeanManager(), WeldComponentInstantiationListener.class);
+ this.weldWebRequestCycleProcessor = new NonContextual<WeldWebRequestCycleProcessor>(BeanManagerLookup.getBeanManager(), WeldWebRequestCycleProcessor.class);
}
/**
@@ -66,10 +45,11 @@
*
* @see WeldComponentInstantiationListener
*/
+ @Override
protected void internalInit()
{
super.internalInit();
- addComponentInstantiationListener(getInstanceByType(WeldComponentInstantiationListener.class));
+ addComponentInstantiationListener(weldComponentInstantiationListener.newInstance().produce().inject().get());
}
@@ -81,7 +61,7 @@
@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{
- return getInstanceByType(WeldWebRequestCycleProcessor.class);
+ return weldWebRequestCycleProcessor.newInstance().produce().inject().get();
}
/**
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java 2009-10-14 14:19:37 UTC (rev 4036)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldComponentInstantiationListener.java 2009-10-14 14:20:50 UTC (rev 4037)
@@ -5,6 +5,7 @@
import org.apache.wicket.Component;
import org.apache.wicket.application.IComponentInstantiationListener;
+import org.jboss.weld.wicket.util.NonContextual;
/**
* This listener uses the BeanManager to handle injections for all wicket components.
@@ -14,8 +15,9 @@
*/
public class WeldComponentInstantiationListener implements IComponentInstantiationListener
{
+
@Inject
- BeanManager manager;
+ private BeanManager manager;
public void onInstantiation(Component component)
{
@@ -24,8 +26,8 @@
*/
if (manager != null)
{
- manager.createInjectionTarget(manager.createAnnotatedType((Class) component.getClass()))
- .inject(component, manager.createCreationalContext(null));
+ // TODO Cache the NonContextual!
+ new NonContextual<Component>(manager, component.getClass()).existingInstance(component).inject();
}
}
}
\ No newline at end of file
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java 2009-10-14 14:19:37 UTC (rev 4036)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldMetaData.java 2009-10-14 14:20:50 UTC (rev 4037)
@@ -16,7 +16,7 @@
* This is the key we will use to to store the conversation metadata in the
* wicket page.
*/
- public static final MetaDataKey CID = new MetaDataKey<String>()
+ public static final MetaDataKey<String> CID = new MetaDataKey<String>()
{
private static final long serialVersionUID = -8788010688731927318L;
};
Added: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/NonContextual.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/NonContextual.java (rev 0)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/NonContextual.java 2009-10-14 14:20:50 UTC (rev 4037)
@@ -0,0 +1,184 @@
+package org.jboss.weld.wicket.util;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+/**
+ * Perform production, injection, lifecycle callbacks and cleanup on a non-contextual object
+ *
+ * @author pmuir
+ *
+ * @param <T>
+ */
+public class NonContextual<T>
+{
+
+ // Store the injection target. The CDI spec doesn't require an implementation
+ // to cache it, so we do
+ private final InjectionTarget<? extends T> injectionTarget;
+
+ // Store a reference to the CDI BeanManager
+ private final BeanManager beanManager;
+
+ /**
+ * Create an injector for the given class
+ */
+ public NonContextual(BeanManager manager, Class<? extends T> clazz)
+ {
+ this.beanManager = manager;
+
+ // Generate an "Annotated Type"
+ AnnotatedType<? extends T> type = manager.createAnnotatedType(clazz);
+
+ // Generate the InjectionTarget
+ this.injectionTarget = manager.createInjectionTarget(type);
+ }
+
+ public Instance<T> newInstance()
+ {
+ return new Instance<T>(beanManager, (InjectionTarget<T>) injectionTarget);
+ }
+
+ public Instance<T> existingInstance(T instance)
+ {
+ return new Instance<T>(beanManager, (InjectionTarget<T>) injectionTarget, instance);
+ }
+
+ /**
+ * Represents a non-contextual instance
+ *
+ * @author pmuir
+ *
+ * @param <T>
+ */
+ public static class Instance<T>
+ {
+
+ private final CreationalContext<T> ctx;
+ private final InjectionTarget<T> injectionTarget;
+ private T instance;
+ private boolean disposed = false;
+
+ private Instance(BeanManager beanManager, InjectionTarget<T> injectionTarget)
+ {
+ this.injectionTarget = injectionTarget;
+ this.ctx = beanManager.createCreationalContext(null);
+ }
+
+ private Instance(BeanManager beanManager, InjectionTarget<T> injectionTarget, T instance)
+ {
+ this.injectionTarget = injectionTarget;
+ this.ctx = beanManager.createCreationalContext(null);
+ this.instance = instance;
+ }
+
+ /**
+ * Get the instance
+ *
+ * @return
+ */
+ public T get()
+ {
+ return instance;
+ }
+
+ /**
+ * Create the instance
+ *
+ * @return
+ */
+ public Instance<T> produce()
+ {
+ if (this.instance != null)
+ {
+ throw new IllegalStateException("Trying to call produce() on already constructed instance");
+ }
+ if (disposed)
+ {
+ throw new IllegalStateException("Trying to call produce() on an already disposed instance");
+ }
+ this.instance = injectionTarget.produce(ctx);
+ return this;
+ }
+
+ /**
+ * Inject the instance
+ *
+ * @return
+ */
+ public Instance<T> inject()
+ {
+ if (this.instance == null)
+ {
+ throw new IllegalStateException("Trying to call inject() before produce() was called");
+ }
+ if (disposed)
+ {
+ throw new IllegalStateException("Trying to call inject() on already disposed instance");
+ }
+ injectionTarget.inject(instance, ctx);
+ return this;
+ }
+
+ /**
+ * Call the @PostConstruct callback
+ *
+ * @return
+ */
+ public Instance<T> postConstruct()
+ {
+ if (this.instance == null)
+ {
+ throw new IllegalStateException("Trying to call postConstruct() before produce() was called");
+ }
+ if (disposed)
+ {
+ throw new IllegalStateException("Trying to call preDestroy() on already disposed instance");
+ }
+ injectionTarget.postConstruct(instance);
+ return this;
+ }
+
+ /**
+ * Call the @PreDestroy callback
+ *
+ * @return
+ */
+ public Instance<T> preDestroy()
+ {
+ if (this.instance == null)
+ {
+ throw new IllegalStateException("Trying to call preDestroy() before produce() was called");
+ }
+ if (disposed)
+ {
+ throw new IllegalStateException("Trying to call preDestroy() on already disposed instance");
+ }
+ injectionTarget.preDestroy(instance);
+ return this;
+ }
+
+ /**
+ * Dispose of the instance, doing any necessary cleanup
+ *
+ */
+ public Instance<T> dispose()
+ {
+ if (this.instance == null)
+ {
+ throw new IllegalStateException("Trying to call dispose() before produce() was called");
+ }
+ if (disposed)
+ {
+ throw new IllegalStateException("Trying to call dispose() on already disposed instance");
+ }
+ injectionTarget.dispose(instance);
+ ctx.release();
+ return this;
+ }
+
+ }
+
+}
\ No newline at end of file
Property changes on: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/util/NonContextual.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Deleted: extensions/trunk/wicket/src/main/resources/META-INF/beans.xml
===================================================================
15 years, 1 month
Weld SVN: r4036 - extensions/trunk/wicket.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:19:37 -0400 (Wed, 14 Oct 2009)
New Revision: 4036
Modified:
extensions/trunk/wicket/pom.xml
Log:
ws
Modified: extensions/trunk/wicket/pom.xml
===================================================================
--- extensions/trunk/wicket/pom.xml 2009-10-14 14:18:30 UTC (rev 4035)
+++ extensions/trunk/wicket/pom.xml 2009-10-14 14:19:37 UTC (rev 4036)
@@ -9,9 +9,9 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-wicket</artifactId>
<name>Weld Wicket support</name>
-
+
<description>Weld support for Apache Wicket</description>
-
+
<developers>
<developer>
<name>Clint Popetz</name>
@@ -20,12 +20,12 @@
</roles>
</developer>
</developers>
-
+
<issueManagement>
<system>JIRA</system>
<url>https://jira.jboss.org/jira/browse/WELDX/component/12312752</url>
</issueManagement>
-
+
<dependencies>
<dependency>
@@ -40,19 +40,30 @@
</exclusion>
</exclusions>
</dependency>
+
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
+
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- WELDX-36 -->
<dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket</artifactId>
</dependency>
+
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
15 years, 1 month
Weld SVN: r4035 - extensions/trunk/servlet.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:18:30 -0400 (Wed, 14 Oct 2009)
New Revision: 4035
Modified:
extensions/trunk/servlet/build.properties
Log:
new tomcat version
Modified: extensions/trunk/servlet/build.properties
===================================================================
--- extensions/trunk/servlet/build.properties 2009-10-14 14:17:46 UTC (rev 4034)
+++ extensions/trunk/servlet/build.properties 2009-10-14 14:18:30 UTC (rev 4035)
@@ -1 +1 @@
-tomcat.home=/Applications/apache-tomcat-6.0.18
+tomcat.home=/Applications/apache-tomcat-6.0.20
15 years, 1 month
Weld SVN: r4034 - extensions/trunk/bom.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:17:46 -0400 (Wed, 14 Oct 2009)
New Revision: 4034
Modified:
extensions/trunk/bom/pom.xml
Log:
fix versions and cleanup
Modified: extensions/trunk/bom/pom.xml
===================================================================
--- extensions/trunk/bom/pom.xml 2009-10-14 14:16:51 UTC (rev 4033)
+++ extensions/trunk/bom/pom.xml 2009-10-14 14:17:46 UTC (rev 4034)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
- <version>1-SNAPSHOT</version>
+ <version>2</version>
</parent>
<name>Weld Extensions BOM</name>
@@ -33,17 +33,15 @@
</developers>
<properties>
- <weld.api.version>1.0-SNAPSHOT</weld.api.version>
- <weld.core.version>1.0.0-SNAPSHOT</weld.core.version>
+ <weld.api.version>1.0-CR1</weld.api.version>
+ <weld.core.version>1.0.0-CR1</weld.core.version>
<!-- Use JSF 2 for all extensions support, despite core using JSF 1.2 -->
<jsf.version>2.0.0-RC</jsf.version>
- <weld.wicket.version>${project.version}</weld.wicket.version>
- <weld.se.version>${project.version}</weld.se.version>
- <weld.servlet.version>${project.version}</weld.servlet.version>
<wicket.version>1.4.1</wicket.version>
<jboss.test.harness.version>1.1.0-SNAPSHOT</jboss.test.harness.version>
<tomcat.version>6.0.20</tomcat.version>
<uel.glassfish.version>2.1.2-b04</uel.glassfish.version>
+ <log4j.version>1.2.14</log4j.version>
</properties>
<!-- Dependency management, including extra repositories if needed -->
@@ -126,17 +124,17 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-wicket</artifactId>
- <version>${weld.wicket.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-se</artifactId>
- <version>${weld.se.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
- <version>${weld.servlet.version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
@@ -155,14 +153,14 @@
<artifactId>el-impl</artifactId>
<version>${uel.glassfish.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
- <!-- SCM and distribution management -->
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/extensions/trunk/bom</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/extensions/trunk/bom</developerConnection>
- <url>http://fisheye.jboss.org/browse/Weld/extensions</url>
- </scm>
-
</project>
15 years, 1 month
Weld SVN: r4033 - extensions/trunk.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 10:16:51 -0400 (Wed, 14 Oct 2009)
New Revision: 4033
Modified:
extensions/trunk/pom.xml
Log:
use parent 2, cleanup
Modified: extensions/trunk/pom.xml
===================================================================
--- extensions/trunk/pom.xml 2009-10-14 11:20:38 UTC (rev 4032)
+++ extensions/trunk/pom.xml 2009-10-14 14:16:51 UTC (rev 4033)
@@ -5,6 +5,12 @@
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
+ <parent>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-parent</artifactId>
+ <version>2</version>
+ </parent>
+
<name>Weld Extensions Build Aggregator</name>
<modules>
@@ -26,20 +32,6 @@
<url>http://fisheye.jboss.org/browse/Weld</url>
</scm>
- <!-- Needed despite skipping the deployment of this -->
- <distributionManagement>
- <repository>
- <id>oss.sonatype.org/jboss-staging</id>
- <name>Sonatype Nexus Maven Repository</name>
- <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
- </repository>
- <snapshotRepository>
- <id>oss.sonatype.org/jboss-snapshots</id>
- <name>Sonatype Nexus Snapshot Repository</name>
- <url>http://oss.sonatype.org/content/repositories/jboss-snapshots</url>
- </snapshotRepository>
- </distributionManagement>
-
<!-- Minimal build configuration -->
<build>
<plugins>
@@ -48,9 +40,6 @@
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-9</version>
<configuration>
- <goals>deploy</goals>
- <arguments>-Prelease</arguments>
- <autoVersionSubmodules>true</autoVersionSubmodules>
<tagBase>https://svn.jboss.org/repos/weld/extensions/tags</tagBase>
</configuration>
</plugin>
15 years, 1 month
Weld SVN: r4032 - extensions/trunk/se/src/main/java/org/jboss/weld/environment/se.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-14 07:20:38 -0400 (Wed, 14 Oct 2009)
New Revision: 4032
Modified:
extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
Log:
Fix tests
Modified: extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2009-10-14 09:44:19 UTC (rev 4031)
+++ extensions/trunk/se/src/main/java/org/jboss/weld/environment/se/ShutdownManager.java 2009-10-14 11:20:38 UTC (rev 4032)
@@ -19,13 +19,12 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.BeanManager;
-
import javax.inject.Inject;
+
import org.jboss.weld.bootstrap.api.Bootstrap;
+import org.jboss.weld.environment.se.events.Shutdown;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
-import org.jboss.weld.manager.api.WeldManager;
-import org.jboss.weld.environment.se.events.Shutdown;
@ApplicationScoped
public class ShutdownManager
@@ -34,7 +33,7 @@
private static LogProvider log = Logging.getLogProvider(ShutdownManager.class);
@Inject
- private WeldManager manager;
+ private BeanManager manager;
private boolean hasShutdownBeenCalled = false;
15 years, 1 month
Weld SVN: r4031 - in cdi-tck/trunk/impl/src/main: resources/org/jboss/jsr299/tck/tests/extensions/annotated and 1 other directory.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-14 05:44:19 -0400 (Wed, 14 Oct 2009)
New Revision: 4031
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Bread.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Cheap.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/CheapLiteral.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Expensive.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ExpensiveLiteral.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Fruit.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Grocery.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryAnnotatedType.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptorBinding.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Milk.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/NamedStereotype.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Shop.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotated.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedConstructor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedField.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedMethod.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedParameter.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TropicalFruit.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Vegetables.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Water.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Yogurt.java
cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/beans.xml
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeObserver.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java
Log:
CDITCK-4 Tests for section 11.4
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Bread.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Bread.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Bread.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class Bread
+{
+ @SuppressWarnings("unused")
+ private boolean fresh;
+
+ public Bread(boolean fresh) {
+ this.fresh = fresh;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Cheap.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Cheap.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Cheap.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+@interface Cheap
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/CheapLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/CheapLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/CheapLiteral.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class CheapLiteral extends AnnotationLiteral<Cheap> implements Cheap
+{
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Expensive.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Expensive.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Expensive.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@Qualifier
+@interface Expensive
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ExpensiveLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ExpensiveLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ExpensiveLiteral.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.inject.AnnotationLiteral;
+
+class ExpensiveLiteral extends AnnotationLiteral<Expensive> implements Expensive
+{
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Fruit.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Fruit.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Fruit.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+interface Fruit
+{
+ InjectionPoint getMetadata();
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Grocery.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Grocery.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Grocery.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,79 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+@SuppressWarnings( "unused" )
+@ApplicationScoped
+@Expensive
+class Grocery implements Shop
+{
+ private Vegetables vegetables = null;
+ private Fruit fruit;
+ private boolean constructorWithParameterUsed = false;
+ private TropicalFruit initializerFruit = null;
+ private Bread bread = new Bread(true);
+ private Water water = null;
+
+ public Grocery()
+ {
+ }
+
+ public Grocery(@Any TropicalFruit fruit) {
+ constructorWithParameterUsed = true;
+ }
+
+ public void nonInjectAnnotatedInitializer(@Any Water water) {
+ this.water = water;
+ }
+
+ @Inject
+ public void initializer(@Any TropicalFruit fruit) {
+ this.initializerFruit = fruit;
+ }
+
+ public String foo()
+ {
+ return "bar";
+ }
+
+ public boolean isVegetablesInjected()
+ {
+ return vegetables != null;
+ }
+
+ public Fruit getFruit()
+ {
+ return fruit;
+ }
+
+ public boolean isConstructorWithParameterUsed()
+ {
+ return constructorWithParameterUsed;
+ }
+
+ public TropicalFruit getInitializerFruit()
+ {
+ return initializerFruit;
+ }
+
+ public Milk getMilk()
+ {
+ return new Milk(true);
+ }
+
+ @Produces @Cheap
+ public Yogurt getYogurt(@Any TropicalFruit fruit)
+ {
+ return new Yogurt(fruit);
+ }
+
+ public boolean isWaterInjected() {
+ return water != null;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryAnnotatedType.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryAnnotatedType.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryAnnotatedType.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,181 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.jsr299.tck.literals.InjectLiteral;
+
+public class GroceryAnnotatedType<X> extends TestAnnotatedType<X>
+{
+ private final Set<Type> typeClosure = new HashSet<Type>();
+ private static boolean getBaseTypeOfFruitFieldUsed = false;
+ private static boolean getTypeClosureUsed = false;
+
+ public GroceryAnnotatedType(AnnotatedType<X> delegate)
+ {
+ super(delegate, new AnnotationLiteral<RequestScoped>()
+ {
+ }, new CheapLiteral(), new AnnotationLiteral<NamedStereotype>()
+ {
+ }, new AnnotationLiteral<GroceryInterceptorBinding>()
+ {
+ });
+ typeClosure.add(Grocery.class);
+ typeClosure.add(Object.class);
+ }
+
+ @Override
+ public Set<Type> getTypeClosure()
+ {
+ getTypeClosureUsed = true;
+ return typeClosure;
+ }
+
+ @Override
+ public Set<AnnotatedConstructor<X>> getConstructors()
+ {
+ Set<AnnotatedConstructor<X>> constructors = new HashSet<AnnotatedConstructor<X>>();
+ for (AnnotatedConstructor<X> constructor : super.getConstructors())
+ {
+ if (constructor.getParameters().size() == 1)
+ {
+ constructors.add(wrapConstructor(constructor, new InjectLiteral()));
+ }
+ else
+ {
+ constructors.add(constructor);
+ }
+ }
+ return constructors;
+ }
+
+ @Override
+ public Set<AnnotatedField<? super X>> getFields()
+ {
+ Set<AnnotatedField<? super X>> fields = new HashSet<AnnotatedField<? super X>>();
+ for (AnnotatedField<? super X> field : super.getFields())
+ {
+ if (field.getBaseType().equals(Vegetables.class))
+ {
+ fields.add(wrapField(field, new InjectLiteral()));
+ }
+ else if (field.getJavaMember().getName().equals("fruit"))
+ {
+ fields.add(wrapFruitField(field, new CheapLiteral(), new InjectLiteral()));
+ }
+ else if (field.getBaseType().equals(Bread.class))
+ {
+ fields.add(wrapField(field, new AnnotationLiteral<Produces>()
+ {
+ }));
+ }
+ else
+ {
+ fields.add(field);
+ }
+ }
+ return fields;
+ }
+
+ @Override
+ public Set<AnnotatedMethod<? super X>> getMethods()
+ {
+ Set<AnnotatedMethod<? super X>> methods = new HashSet<AnnotatedMethod<? super X>>();
+ for (AnnotatedMethod<? super X> method : super.getMethods())
+ {
+ if (method.getJavaMember().getName().equals("getMilk"))
+ {
+ methods.add(wrapMethod(method, new AnnotationLiteral<Produces>()
+ {
+ }));
+ }
+ else if (method.getJavaMember().getName().equals("getYogurt"))
+ {
+ methods.add(wrapMethodAndAnnotateEveryParameterWithCheap(method, new ExpensiveLiteral(), new AnnotationLiteral<Produces>()
+ {
+ }));
+ }
+ else if (method.getJavaMember().getName().equals("nonInjectAnnotatedInitializer"))
+ {
+ methods.add(wrapMethod(method, new InjectLiteral()));
+ }
+ else if (method.getJavaMember().getName().equals("initializer"))
+ {
+ methods.add(wrapMethodAndAnnotateEveryParameterWithCheap(method, new InjectLiteral()));
+ }
+ else
+ {
+ methods.add(method);
+ }
+ }
+ return methods;
+ }
+
+ private <Y> AnnotatedConstructor<Y> wrapConstructor(AnnotatedConstructor<Y> delegate, Annotation... annotations)
+ {
+ return new TestAnnotatedConstructor<Y>(delegate, annotations);
+ }
+
+ private <Y> AnnotatedField<Y> wrapField(AnnotatedField<Y> delegate, Annotation... annotations)
+ {
+ return new TestAnnotatedField<Y>(delegate, annotations);
+ }
+
+ private <Y> AnnotatedField<Y> wrapFruitField(AnnotatedField<Y> delegate, Annotation... annotations)
+ {
+ return new TestAnnotatedField<Y>(delegate, annotations){
+ @Override
+ public Type getBaseType()
+ {
+ getBaseTypeOfFruitFieldUsed = true;
+ return TropicalFruit.class;
+ }
+ };
+ }
+
+ private <Y> TestAnnotatedMethod<Y> wrapMethod(AnnotatedMethod<Y> delegate, Annotation... annotations)
+ {
+ return new TestAnnotatedMethod<Y>(delegate, annotations);
+ }
+
+ private <Y> TestAnnotatedMethod<Y> wrapMethodAndAnnotateEveryParameterWithCheap(AnnotatedMethod<Y> delegate, Annotation... annotations)
+ {
+ return new TestAnnotatedMethod<Y>(delegate, annotations)
+ {
+ @Override
+ public List<AnnotatedParameter<Y>> getParameters()
+ {
+ List<AnnotatedParameter<Y>> parameters = new ArrayList<AnnotatedParameter<Y>>();
+ for (AnnotatedParameter<Y> parameter : super.getParameters())
+ {
+ parameters.add(new TestAnnotatedParameter<Y>(parameter, new CheapLiteral()));
+ }
+ return parameters;
+ }
+
+ };
+ }
+
+ public static boolean isGetBaseTypeOfFruitFieldUsed()
+ {
+ return getBaseTypeOfFruitFieldUsed;
+ }
+
+ public static boolean isGetTypeClosureUsed()
+ {
+ return getTypeClosureUsed;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptor.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptor.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@GroceryInterceptorBinding
+class GroceryInterceptor
+{
+ @AroundInvoke
+ public Object interceptFoo(InvocationContext ctx) throws Exception
+ {
+ if (ctx.getMethod().getName().equals("foo"))
+ {
+ return "foo";
+ }
+ else
+ {
+ return ctx.proceed();
+ }
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptorBinding.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptorBinding.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptorBinding.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import javax.interceptor.InterceptorBinding;
+
+@InterceptorBinding
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+@interface GroceryInterceptorBinding
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Milk.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Milk.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Milk.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class Milk
+{
+ @SuppressWarnings("unused")
+ private boolean fresh;
+
+ public Milk(boolean fresh)
+ {
+ this.fresh = fresh;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/NamedStereotype.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/NamedStereotype.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/NamedStereotype.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.stereotype.Stereotype;
+import javax.inject.Named;
+
+@Target(TYPE)
+@Retention(RUNTIME)
+@Stereotype
+@Named
+@interface NamedStereotype
+{
+
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeObserver.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeObserver.java 2009-10-14 08:20:21 UTC (rev 4030)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeObserver.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -38,13 +38,22 @@
{
wrapAnnotatedType(event);
}
+ else if (event.getAnnotatedType().getJavaClass().equals(Grocery.class))
+ {
+ wrapGroceryAnnotatedType(event);
+ }
}
private <X> void wrapAnnotatedType(ProcessAnnotatedType<X> event)
{
event.setAnnotatedType(new TestAnnotatedType<X>(event.getAnnotatedType()));
}
-
+
+ private <X> void wrapGroceryAnnotatedType(ProcessAnnotatedType<X> event)
+ {
+ event.setAnnotatedType(new GroceryAnnotatedType<X>(event.getAnnotatedType()));
+ }
+
public static HashSet<Class<?>> getAnnotatedclasses()
{
return annotatedClasses;
@@ -54,5 +63,4 @@
{
return dogAnnotatedType;
}
-
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeTest.java 2009-10-14 08:20:21 UTC (rev 4030)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeTest.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -17,7 +17,13 @@
package org.jboss.jsr299.tck.tests.extensions.annotated;
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.enterprise.context.RequestScoped;
+
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.literals.AnyLiteral;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
@@ -25,15 +31,19 @@
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
+
/**
* Tests for the extensions provided by the ProcessAnnotatedType events.
*
* @author David Allen
+ * @author Jozef Hartinger
*
*/
@Artifact
+@BeansXml("beans.xml")
@Resources({
@Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
})
@@ -41,6 +51,7 @@
@SpecVersion(spec="cdi", version="PFD2")
public class ProcessAnnotatedTypeTest extends AbstractJSR299Test
{
+
@Test
@SpecAssertions({
@SpecAssertion(section = "11.5.5", id = "a"),
@@ -82,4 +93,118 @@
{
assert getCurrentManager().getBeans(VetoedBean.class).isEmpty();
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "h")
+ // WELD-200
+ public void testGetBaseTypeUsedToDetermineTypeOfInjectionPoing() {
+ // The base type of the fruit injection point is overridden to TropicalFruit
+ assert GroceryAnnotatedType.isGetBaseTypeOfFruitFieldUsed();
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).getFruit().getMetadata().getType().equals(TropicalFruit.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "k")
+ // WELD-201
+ public void testGetTypeClosureUsed() {
+ assert GroceryAnnotatedType.isGetTypeClosureUsed();
+ // should be [Object, Grocery] instead of [Object, Shop, Grocery]
+ assert getBeans(Grocery.class, new AnyLiteral()).iterator().next().getTypes().size() == 2;
+ assert getBeans(Shop.class, new AnyLiteral()).size() == 0;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "l")
+ public void testGetAnnotationUsedForGettingScopeInformation() {
+ // @ApplicationScoped is overridden by @RequestScoped
+ assert getBeans(Grocery.class, new AnyLiteral()).iterator().next().getScope().isAssignableFrom(RequestScoped.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "m")
+ public void testGetAnnotationUsedForGettingQualifierInformation() {
+ // @Expensive is overridden by @Cheap
+ assert getBeans(Grocery.class, new CheapLiteral()).size() == 1;
+ assert getBeans(Grocery.class, new ExpensiveLiteral()).size() == 0;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "n")
+ public void testGetAnnotationUsedForGettingStereotypeInformation() {
+ // The extension adds a stereotype with @Named qualifier
+ assert getInstanceByName("grocery") != null;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "p")
+ public void testGetAnnotationUsedForGettingInterceptorInformation() {
+ // The extension adds the GroceryInterceptorBinding
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).foo().equals("foo");
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "r")
+ public void testPreviouslyNonInjectAnnotatedConstructorIsUsed() {
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).isConstructorWithParameterUsed();
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "t")
+ public void testPreviouslyNonInjectAnnotatedFieldIsInjected() {
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).isVegetablesInjected();
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "u")
+ public void testExtraQualifierIsAppliedToInjectedField() {
+ Set<Annotation> qualifiers = getInstanceByType(Grocery.class, new AnyLiteral()).getFruit().getMetadata().getQualifiers();
+ assert qualifiers.size() == 1;
+ assert annotationSetMatches(qualifiers, Cheap.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "v")
+ public void testProducesCreatesProducerField() {
+ // The extension adds @Producer to the bread field
+ assert getBeans(Bread.class, new AnyLiteral()).size() == 1;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "w")
+ public void testInjectCreatesInitializerMethod() {
+ // The extension adds @Inject to the nonInjectAnnotatedInitializer() method
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).isWaterInjected();
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "x")
+ public void testQualifierAddedToInitializerParameter() {
+ // The @Cheap qualifier is added to the method parameter
+ Set<Annotation> qualifiers = getInstanceByType(Grocery.class, new AnyLiteral()).getInitializerFruit().getMetadata().getQualifiers();
+ assert annotationSetMatches(qualifiers, Cheap.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "y")
+ public void testProducesCreatesProducerMethod() {
+ // The extension adds @Producer to the getMilk() method
+ assert getBeans(Milk.class, new AnyLiteral()).size() == 1;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "z")
+ public void testQualifierIsAppliedToProducerMethod() {
+ // The extension adds @Expensive to the getMilk() method
+ assert getBeans(Yogurt.class, new ExpensiveLiteral()).size() == 1;
+ assert getBeans(Yogurt.class, new CheapLiteral()).size() == 0;
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "aa")
+ public void testQualifierIsAppliedToProducerMethodParameter() {
+ // The @Cheap qualifier is added to the method parameter
+ Set<Annotation> qualifiers = getInstanceByType(Yogurt.class, new AnyLiteral()).getFruit().getMetadata().getQualifiers();
+ assert qualifiers.size() == 1;
+ assert annotationSetMatches(qualifiers, Cheap.class);
+ }
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Shop.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Shop.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Shop.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+interface Shop
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotated.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotated.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotated.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,59 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+
+class TestAnnotated implements Annotated
+{
+
+ private Annotated delegate;
+ private Set<Annotation> annotations;
+
+ public TestAnnotated(Annotated delegate, Annotation... annotations)
+ {
+ this.delegate = delegate;
+ this.annotations = new HashSet<Annotation>(Arrays.asList(annotations));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T extends Annotation> T getAnnotation(Class<T> arg0)
+ {
+ for (Annotation annotation : annotations) {
+ if (arg0.isAssignableFrom(annotation.annotationType())) {
+ return (T) annotation;
+ }
+ }
+ return null;
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.unmodifiableSet(annotations);
+ }
+
+ public Type getBaseType()
+ {
+ return delegate.getBaseType();
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return delegate.getTypeClosure();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> arg0)
+ {
+ for (Annotation annotation : annotations) {
+ if (arg0.isAssignableFrom(annotation.annotationType())) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedConstructor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedConstructor.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedConstructor.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,41 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+class TestAnnotatedConstructor<X> extends TestAnnotated implements AnnotatedConstructor<X>
+{
+
+ private AnnotatedConstructor<X> delegate;
+
+ public TestAnnotatedConstructor(AnnotatedConstructor<X> delegate, Annotation... annotations)
+ {
+ super(delegate, annotations);
+ this.delegate = delegate;
+ }
+
+ public Constructor<X> getJavaMember()
+ {
+ return delegate.getJavaMember();
+ }
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return delegate.getParameters();
+ }
+
+ public AnnotatedType<X> getDeclaringType()
+ {
+ return delegate.getDeclaringType();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate.isStatic();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedField.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedField.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedField.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+class TestAnnotatedField<X> extends TestAnnotated implements AnnotatedField<X>
+{
+
+ private AnnotatedField<X> delegate;
+
+ public TestAnnotatedField(AnnotatedField<X> delegate, Annotation... annotations)
+ {
+ super(delegate, annotations);
+ this.delegate = delegate;
+ }
+
+ public Field getJavaMember()
+ {
+ return delegate.getJavaMember();
+ }
+
+ public AnnotatedType<X> getDeclaringType()
+ {
+ return delegate.getDeclaringType();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate.isStatic();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedMethod.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedMethod.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedMethod.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,52 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+class TestAnnotatedMethod<X> extends TestAnnotated implements AnnotatedMethod<X>
+{
+
+ private AnnotatedMethod<X> delegate;
+
+ public TestAnnotatedMethod(AnnotatedMethod<X> delegate, Annotation... annotations)
+ {
+ super(delegate, annotations);
+ this.delegate = delegate;
+ }
+
+ public Method getJavaMember()
+ {
+ return delegate.getJavaMember();
+ }
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return delegate.getParameters();
+ }
+
+ public AnnotatedType<X> getDeclaringType()
+ {
+ return delegate.getDeclaringType();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate.isStatic();
+ }
+
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ // TODO Auto-generated method stub
+ return super.getAnnotations();
+ }
+
+
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedParameter.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedParameter.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedParameter.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+class TestAnnotatedParameter<X> extends TestAnnotated implements AnnotatedParameter<X>
+{
+ private AnnotatedParameter<X> delegate;
+
+ public TestAnnotatedParameter(AnnotatedParameter<X> delegate, Annotation... annotations)
+ {
+ super(delegate, annotations);
+ this.delegate = delegate;
+ }
+
+ public AnnotatedCallable<X> getDeclaringCallable()
+ {
+ return delegate.getDeclaringCallable();
+ }
+
+ public int getPosition()
+ {
+ return delegate.getPosition();
+ }
+
+}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java 2009-10-14 08:20:21 UTC (rev 4030)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -1,7 +1,6 @@
package org.jboss.jsr299.tck.tests.extensions.annotated;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
import java.util.Set;
import javax.enterprise.inject.spi.AnnotatedConstructor;
@@ -9,15 +8,16 @@
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedType;
-public class TestAnnotatedType<X> implements AnnotatedType<X>
+public class TestAnnotatedType<X> extends TestAnnotated implements AnnotatedType<X>
{
private AnnotatedType<X> delegate;
private static boolean getConstructorsUsed = false;
private static boolean getFieldsUsed = false;
private static boolean getMethodsUsed = false;
- public TestAnnotatedType(AnnotatedType<X> delegate)
+ public TestAnnotatedType(AnnotatedType<X> delegate, Annotation...annotations)
{
+ super(delegate, annotations);
this.delegate = delegate;
}
@@ -44,31 +44,6 @@
return delegate.getMethods();
}
- public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- {
- return delegate.getAnnotation(annotationType);
- }
-
- public Set<Annotation> getAnnotations()
- {
- return delegate.getAnnotations();
- }
-
- public Type getBaseType()
- {
- return delegate.getBaseType();
- }
-
- public Set<Type> getTypeClosure()
- {
- return delegate.getTypeClosure();
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return delegate.isAnnotationPresent(annotationType);
- }
-
public static boolean isGetConstructorsUsed()
{
return getConstructorsUsed;
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TropicalFruit.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TropicalFruit.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TropicalFruit.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.Inject;
+
+@Cheap
+class TropicalFruit implements Fruit
+{
+ @Inject
+ private InjectionPoint metadata;
+
+ public InjectionPoint getMetadata()
+ {
+ return metadata;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Vegetables.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Vegetables.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Vegetables.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class Vegetables
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Water.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Water.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Water.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+@Cheap
+class Water
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Yogurt.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Yogurt.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Yogurt.java 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class Yogurt
+{
+ private TropicalFruit fruit;
+
+ public Yogurt(TropicalFruit fruit) {
+ this.fruit = fruit;
+ }
+
+ public TropicalFruit getFruit()
+ {
+ return fruit;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/beans.xml
===================================================================
--- cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/beans.xml (rev 0)
+++ cdi-tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/annotated/beans.xml 2009-10-14 09:44:19 UTC (rev 4031)
@@ -0,0 +1,5 @@
+<beans>
+ <interceptors>
+ <class>org.jboss.jsr299.tck.tests.extensions.annotated.GroceryInterceptor</class>
+ </interceptors>
+</beans>
15 years, 1 month