Weld SVN: r6776 - extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 14:29:41 -0400 (Fri, 23 Jul 2010)
New Revision: 6776
Modified:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericAnnotation.java
Log:
minor
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericAnnotation.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericAnnotation.java 2010-07-23 18:29:24 UTC (rev 6775)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericAnnotation.java 2010-07-23 18:29:41 UTC (rev 6776)
@@ -25,6 +25,8 @@
* Must be applied to any annotation that is used as a value in @Generic, this
* may not be needed in the future
*
+ * TODO Remove
+ *
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
*
*/
13 years, 10 months
Weld SVN: r6775 - extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 14:29:24 -0400 (Fri, 23 Jul 2010)
New Revision: 6775
Modified:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java
Log:
minor
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java 2010-07-23 18:28:38 UTC (rev 6774)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java 2010-07-23 18:29:24 UTC (rev 6775)
@@ -29,18 +29,18 @@
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
*
*/
-public class FieldSetter
+class FieldSetter
{
private final Field field;
private final SyntheticQualifier qualifier;
private final BeanManager beanManager;
- public FieldSetter(BeanManager beanManager, Field field, SyntheticQualifier qualifier)
+ FieldSetter(BeanManager beanManager, Field field, SyntheticQualifier qualifier)
{
this.field = field;
+ this.field.setAccessible(true);
this.qualifier = qualifier;
this.beanManager = beanManager;
- field.setAccessible(true);
}
public void set(Object instance, CreationalContext<?> ctx)
13 years, 10 months
Weld SVN: r6774 - extensions/trunk/impl/src/main/resources/META-INF/services.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 14:28:38 -0400 (Fri, 23 Jul 2010)
New Revision: 6774
Modified:
extensions/trunk/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Log:
fix extension name
Modified: extensions/trunk/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
--- extensions/trunk/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-07-23 18:27:47 UTC (rev 6773)
+++ extensions/trunk/impl/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2010-07-23 18:28:38 UTC (rev 6774)
@@ -1,4 +1,4 @@
-org.jboss.weld.extensions.bean.generic.GenericExtension
+org.jboss.weld.extensions.bean.generic.GenericBeanExtension
org.jboss.weld.extensions.resourceLoader.servlet.ServletResourceExtension
org.jboss.weld.extensions.bean.lookup.IdentifiableBeanExtension
org.jboss.weld.extensions.core.CoreExtension
13 years, 10 months
Weld SVN: r6773 - extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 14:27:47 -0400 (Fri, 23 Jul 2010)
New Revision: 6773
Modified:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
Log:
oops
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 17:55:55 UTC (rev 6772)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 18:27:47 UTC (rev 6773)
@@ -49,7 +49,6 @@
// Test that the generic injection wiring is working!
assert baz1.getBar() != null;
assert baz1.getBar().getInjectedGarply() != null;
- assert baz1.getBar().getInjectedGarply().value().equals("hello2");
assert baz1.getBar().getInjectedGarply().value().equals("hello1");
assert baz2.getBar() != null;
assert baz2.getBar().getInjectedGarply() != null;
13 years, 10 months
Weld SVN: r6772 - in extensions/trunk/impl/src: test/java/org/jboss/weld/extensions/test/bean/generic and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:55:55 -0400 (Fri, 23 Jul 2010)
New Revision: 6772
Added:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java
Removed:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java
Modified:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectGeneric.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
Log:
revert back to Generic, javadoc
Copied: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java (from rev 6769, extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java)
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java (rev 0)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.bean.generic;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Defines a set of generic beans which can inject the specified configuration annotation
+ *
+ * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
+ * @author Pete Muir
+ *
+ */
+@Retention( RUNTIME )
+@Target( TYPE )
+public @interface Generic
+{
+ Class<?> value();
+}
Deleted: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java 2010-07-23 17:51:57 UTC (rev 6771)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.bean.generic;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Marks a generic bean
- *
- * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
- *
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-@Target( { ElementType.TYPE })
-public @interface GenericBean
-{
- Class<?> value();
-}
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java 2010-07-23 17:51:57 UTC (rev 6771)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -77,9 +77,9 @@
public void processAnnotatedType(@Observes ProcessAnnotatedType<?> event)
{
AnnotatedType<?> type = event.getAnnotatedType();
- if (type.isAnnotationPresent(GenericBean.class))
+ if (type.isAnnotationPresent(Generic.class))
{
- GenericBean an = type.getAnnotation(GenericBean.class);
+ Generic an = type.getAnnotation(Generic.class);
if (!genericBeans.containsKey(an.value()))
{
genericBeans.put(an.value(), new HashSet<AnnotatedType<?>>());
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectGeneric.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectGeneric.java 2010-07-23 17:51:57 UTC (rev 6771)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectGeneric.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -22,7 +22,7 @@
import java.lang.annotation.Target;
/**
- * used to mark where a generic bean should be inejcted in place of the normal
+ * used to mark where a generic bean should be injected in place of the normal
* @Inject, this may not be required in the future
*
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:51:57 UTC (rev 6771)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -18,7 +18,7 @@
import javax.inject.Inject;
-import org.jboss.weld.extensions.bean.generic.GenericBean;
+import org.jboss.weld.extensions.bean.generic.Generic;
/**
* A generic bean
@@ -27,7 +27,7 @@
*
*/
-(a)GenericBean(Garply.class)
+(a)Generic(Garply.class)
public class Bar
{
@Inject
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:51:57 UTC (rev 6771)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:55:55 UTC (rev 6772)
@@ -18,7 +18,7 @@
import javax.inject.Inject;
-import org.jboss.weld.extensions.bean.generic.GenericBean;
+import org.jboss.weld.extensions.bean.generic.Generic;
/**
*
@@ -27,7 +27,7 @@
*
*/
-(a)GenericBean(Garply.class)
+(a)Generic(Garply.class)
public class Baz
{
13 years, 10 months
Weld SVN: r6771 - extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:51:57 -0400 (Fri, 23 Jul 2010)
New Revision: 6771
Removed:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectLiteral.java
Log:
remove dupe class
Deleted: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectLiteral.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectLiteral.java 2010-07-23 17:51:07 UTC (rev 6770)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectLiteral.java 2010-07-23 17:51:57 UTC (rev 6771)
@@ -1,25 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.bean.generic;
-
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
-
-public class InjectLiteral extends AnnotationLiteral<Inject> implements Inject
-{
-
-}
13 years, 10 months
Weld SVN: r6770 - extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:51:07 -0400 (Fri, 23 Jul 2010)
New Revision: 6770
Modified:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java
Log:
use resolve
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java 2010-07-23 17:47:07 UTC (rev 6769)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/FieldSetter.java 2010-07-23 17:51:07 UTC (rev 6770)
@@ -17,9 +17,9 @@
package org.jboss.weld.extensions.bean.generic;
import java.lang.reflect.Field;
-import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
@@ -45,20 +45,15 @@
public void set(Object instance, CreationalContext<?> ctx)
{
- Set<Bean<?>> beans = beanManager.getBeans(field.getType(), qualifier);
- if (beans.size() == 0)
+ Bean<?> bean = beanManager.resolve(beanManager.getBeans(field.getType(), qualifier));
+ if (bean == null)
{
- throw new RuntimeException("Could not resolve bean for Generic Producer field " + field.getDeclaringClass() + "." + field.getName() + " Type: " + field.getType() + " Qualifiers:" + qualifier);
+ throw new UnsatisfiedResolutionException("Could not resolve bean for Generic Producer field " + field.getDeclaringClass() + "." + field.getName() + " Type: " + field.getType() + " Qualifiers:" + qualifier);
}
- if (beans.size() > 1)
- {
- throw new RuntimeException("More than 1 bean resolved for Generic Producer field " + field.getDeclaringClass() + "." + field.getName());
- }
- Bean<?> bean = beans.iterator().next();
- Object dep = beanManager.getReference(bean, field.getType(), ctx);
+ Object value = beanManager.getReference(bean, field.getType(), ctx);
try
{
- field.set(instance, dep);
+ field.set(instance, value);
}
catch (IllegalArgumentException e)
{
13 years, 10 months
Weld SVN: r6769 - in extensions/trunk/impl/src: test/java/org/jboss/weld/extensions/test/bean/generic and 1 other directory.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:47:07 -0400 (Fri, 23 Jul 2010)
New Revision: 6769
Added:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java
Removed:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java
Modified:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
Log:
Rename @Generic @GenericBean
Deleted: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java 2010-07-23 17:44:58 UTC (rev 6768)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java 2010-07-23 17:47:07 UTC (rev 6769)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.bean.generic;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Marks a generic bean
- *
- * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
- *
- */
-(a)Retention(RetentionPolicy.RUNTIME)
-@Target( { ElementType.TYPE })
-public @interface Generic
-{
- Class<?> value();
-}
Copied: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java (from rev 6756, extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/Generic.java)
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java (rev 0)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBean.java 2010-07-23 17:47:07 UTC (rev 6769)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.bean.generic;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a generic bean
+ *
+ * @author Stuart Douglas <stuart(a)baileyroberts.com.au>
+ *
+ */
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.TYPE })
+public @interface GenericBean
+{
+ Class<?> value();
+}
Modified: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java 2010-07-23 17:44:58 UTC (rev 6768)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericExtension.java 2010-07-23 17:47:07 UTC (rev 6769)
@@ -77,9 +77,9 @@
public void processAnnotatedType(@Observes ProcessAnnotatedType<?> event)
{
AnnotatedType<?> type = event.getAnnotatedType();
- if (type.isAnnotationPresent(Generic.class))
+ if (type.isAnnotationPresent(GenericBean.class))
{
- Generic an = type.getAnnotation(Generic.class);
+ GenericBean an = type.getAnnotation(GenericBean.class);
if (!genericBeans.containsKey(an.value()))
{
genericBeans.put(an.value(), new HashSet<AnnotatedType<?>>());
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:44:58 UTC (rev 6768)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:47:07 UTC (rev 6769)
@@ -18,7 +18,7 @@
import javax.inject.Inject;
-import org.jboss.weld.extensions.bean.generic.Generic;
+import org.jboss.weld.extensions.bean.generic.GenericBean;
/**
* A generic bean
@@ -27,7 +27,7 @@
*
*/
-(a)Generic(Garply.class)
+(a)GenericBean(Garply.class)
public class Bar
{
@Inject
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:44:58 UTC (rev 6768)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:47:07 UTC (rev 6769)
@@ -18,7 +18,7 @@
import javax.inject.Inject;
-import org.jboss.weld.extensions.bean.generic.Generic;
+import org.jboss.weld.extensions.bean.generic.GenericBean;
/**
*
@@ -27,7 +27,7 @@
*
*/
-(a)Generic(Garply.class)
+(a)GenericBean(Garply.class)
public class Baz
{
13 years, 10 months
Weld SVN: r6768 - extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:44:58 -0400 (Fri, 23 Jul 2010)
New Revision: 6768
Removed:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java
Modified:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java
Log:
Tidy up tests
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -33,11 +33,12 @@
@Inject
private Garply injectedGarply;
+ // A Garply with no @Inject
private Garply garply;
- public String getValue()
+ public Garply getInjectedGarply()
{
- return injectedGarply.value();
+ return injectedGarply;
}
public Garply getGarply()
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -30,32 +30,20 @@
@Generic(Garply.class)
public class Baz
{
- @Inject
- public Baz(Foo args)
- {
- constArgs = args;
- }
@Inject
- private Bar dep;
+ private Bar bar;
@Inject
- private Corge normalBean;
+ private Corge corge;
- private Foo constArgs;
-
- public String getValue()
+ public Bar getBar()
{
- return dep.getValue();
+ return bar;
}
-
- public Garply getNoData()
- {
- return dep.getGarply();
- }
- public Corge getNormalBean()
+ public Corge getCorge()
{
- return normalBean;
+ return corge;
}
}
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -24,5 +24,10 @@
*/
public class Corge
{
+
+ public String getName()
+ {
+ return "fred";
+ }
}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.inject.Inject;
-
-import org.jboss.weld.extensions.bean.generic.Generic;
-
-/**
- * A generic bean
- *
- * @author pmuir
- *
- */
-
-(a)Generic(Garply.class)
-public class Foo
-{
- @Inject
- private Garply data;
-
- public String getValue()
- {
- return data.value();
- }
-
-}
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -28,7 +28,7 @@
import org.jboss.weld.extensions.bean.generic.GenericAnnotation;
/**
- * A "generic annotation"
+ * The annotation used to configure a generic bean
*
* @author pmuir
*
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -46,10 +46,19 @@
@Test
public void testGeneric()
{
- assert baz1.getValue().equals("hello1");
- assert baz2.getValue().equals("hello2");
- assert baz1.getNoData() == null;
- assert baz2.getNoData() == null;
- assert baz2.getNormalBean() != null;
+ // Test that the generic injection wiring is working!
+ assert baz1.getBar() != null;
+ assert baz1.getBar().getInjectedGarply() != null;
+ assert baz1.getBar().getInjectedGarply().value().equals("hello2");
+ assert baz1.getBar().getInjectedGarply().value().equals("hello1");
+ assert baz2.getBar() != null;
+ assert baz2.getBar().getInjectedGarply() != null;
+ assert baz2.getBar().getInjectedGarply().value().equals("hello2");
+ // Check that this isn't affecting annotations on the generic bean without @Inject
+ assert baz1.getBar().getGarply() == null;
+ assert baz2.getBar().getGarply() == null;
+ // Check that normal bean injection is working correctly!
+ assert baz2.getCorge() != null;
+ assert baz2.getCorge().getName() == "fred";
}
}
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java 2010-07-23 17:15:26 UTC (rev 6767)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java 2010-07-23 17:44:58 UTC (rev 6768)
@@ -28,7 +28,7 @@
import javax.inject.Qualifier;
/**
- * A "normal" qualifier
+ * A qualifier
*
* @author pmuir
*
13 years, 10 months
Weld SVN: r6767 - extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-23 13:15:26 -0400 (Fri, 23 Jul 2010)
New Revision: 6767
Added:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/BazProducer.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java
Removed:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericConstructorArgument.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericDep.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericMain.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericProducer.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/InjectedBean.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/NormalBean.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/SomeQualifier.java
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/TestAnnotation.java
Modified:
extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
Log:
start to unweave test details
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericDep.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Bar.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+import javax.inject.Inject;
+
+import org.jboss.weld.extensions.bean.generic.Generic;
+
+/**
+ * A generic bean
+ *
+ * @author pmuir
+ *
+ */
+
+(a)Generic(Garply.class)
+public class Bar
+{
+ @Inject
+ private Garply injectedGarply;
+
+ private Garply garply;
+
+ public String getValue()
+ {
+ return injectedGarply.value();
+ }
+
+ public Garply getGarply()
+ {
+ return garply;
+ }
+}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericMain.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Baz.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+import javax.inject.Inject;
+
+import org.jboss.weld.extensions.bean.generic.Generic;
+
+/**
+ *
+ *
+ * @author pmuir
+ *
+ */
+
+(a)Generic(Garply.class)
+public class Baz
+{
+ @Inject
+ public Baz(Foo args)
+ {
+ constArgs = args;
+ }
+
+ @Inject
+ private Bar dep;
+
+ @Inject
+ private Corge normalBean;
+
+ private Foo constArgs;
+
+ public String getValue()
+ {
+ return dep.getValue();
+ }
+
+ public Garply getNoData()
+ {
+ return dep.getGarply();
+ }
+
+ public Corge getNormalBean()
+ {
+ return normalBean;
+ }
+}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/BazProducer.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericProducer.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/BazProducer.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/BazProducer.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+import javax.enterprise.inject.Produces;
+
+/**
+ * A producer of Baz's
+ * @author pmuir
+ *
+ */
+public class BazProducer
+{
+ @SuppressWarnings("unused")
+ @Grault(1)
+ @Produces
+ @Garply("hello1")
+ private Baz baz1;
+
+ @SuppressWarnings("unused")
+ @Grault(2)
+ @Produces
+ @Garply("hello2")
+ private Baz baz2;
+
+}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/NormalBean.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Corge.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+/**
+ * A normal bean
+ *
+ * @author pmuir
+ *
+ */
+public class Corge
+{
+
+}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericConstructorArgument.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Foo.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+import javax.inject.Inject;
+
+import org.jboss.weld.extensions.bean.generic.Generic;
+
+/**
+ * A generic bean
+ *
+ * @author pmuir
+ *
+ */
+
+(a)Generic(Garply.class)
+public class Foo
+{
+ @Inject
+ private Garply data;
+
+ public String getValue()
+ {
+ return data.value();
+ }
+
+}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/TestAnnotation.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Garply.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+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.Retention;
+import java.lang.annotation.Target;
+
+import org.jboss.weld.extensions.bean.generic.GenericAnnotation;
+
+/**
+ * A "generic annotation"
+ *
+ * @author pmuir
+ *
+ */
+
+@Retention(RUNTIME)
+@Target({METHOD, FIELD, PARAMETER, TYPE})
+@GenericAnnotation
+public @interface Garply
+{
+ String value();
+}
Modified: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericBeanTest.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -36,15 +36,20 @@
}
@Inject
- InjectedBean bean;
+ @Grault(1)
+ private Baz baz1;
+ @Inject
+ @Grault(2)
+ private Baz baz2;
+
@Test
public void testGeneric()
{
- assert bean.main1.getValue().equals("hello1");
- assert bean.main2.getValue().equals("hello2");
- assert bean.main1.getNoData() == null;
- assert bean.main2.getNoData() == null;
- assert bean.main2.normalBean != null;
+ assert baz1.getValue().equals("hello1");
+ assert baz2.getValue().equals("hello2");
+ assert baz1.getNoData() == null;
+ assert baz2.getNoData() == null;
+ assert baz2.getNormalBean() != null;
}
}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericConstructorArgument.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericConstructorArgument.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericConstructorArgument.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.inject.Inject;
-
-import org.jboss.weld.extensions.bean.generic.Generic;
-
-(a)Generic(TestAnnotation.class)
-public class GenericConstructorArgument
-{
- @Inject
- TestAnnotation data;
-
- public String getValue()
- {
- return data.value();
- }
-
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericDep.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericDep.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericDep.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.inject.Inject;
-
-import org.jboss.weld.extensions.bean.generic.Generic;
-
-(a)Generic(TestAnnotation.class)
-public class GenericDep
-{
- @Inject
- TestAnnotation data;
-
- TestAnnotation noData;
-
- public String getValue()
- {
- return data.value();
- }
-
- public TestAnnotation getNoData()
- {
- return noData;
- }
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericMain.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericMain.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericMain.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.inject.Inject;
-
-import org.jboss.weld.extensions.bean.generic.Generic;
-
-(a)Generic(TestAnnotation.class)
-public class GenericMain
-{
- @Inject
- public GenericMain(GenericConstructorArgument args)
- {
- constArgs = args;
- }
-
- @Inject
- GenericDep dep;
-
- @Inject
- NormalBean normalBean;
-
- GenericConstructorArgument constArgs;
-
- public String getValue()
- {
- return dep.getValue();
- }
-
- public TestAnnotation getNoData()
- {
- return dep.getNoData();
- }
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericProducer.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericProducer.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/GenericProducer.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.enterprise.inject.Produces;
-
-public class GenericProducer
-{
- @SomeQualifier(1)
- @Produces
- @TestAnnotation("hello1")
- GenericMain main1;
-
- @SomeQualifier(2)
- @Produces
- @TestAnnotation("hello2")
- GenericMain main2;
-
-}
Copied: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java (from rev 6756, extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/SomeQualifier.java)
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java (rev 0)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/Grault.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.extensions.test.bean.generic;
+
+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.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+/**
+ * A "normal" qualifier
+ *
+ * @author pmuir
+ *
+ */
+
+@Retention(RUNTIME)
+@Target({METHOD, FIELD, PARAMETER, TYPE})
+@Qualifier
+public @interface Grault
+{
+ int value();
+}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/InjectedBean.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/InjectedBean.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/InjectedBean.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,31 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import javax.inject.Inject;
-
-public class InjectedBean
-{
- @Inject
- @SomeQualifier(1)
- public GenericMain main1;
-
- @Inject
- @SomeQualifier(2)
- public GenericMain main2;
-
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/NormalBean.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/NormalBean.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/NormalBean.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,22 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-public class NormalBean
-{
-
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/SomeQualifier.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/SomeQualifier.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/SomeQualifier.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import javax.inject.Qualifier;
-
-(a)Retention(RetentionPolicy.RUNTIME)
-@Qualifier
-public @interface SomeQualifier
-{
- int value();
-}
Deleted: extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/TestAnnotation.java
===================================================================
--- extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/TestAnnotation.java 2010-07-23 05:53:44 UTC (rev 6766)
+++ extensions/trunk/impl/src/test/java/org/jboss/weld/extensions/test/bean/generic/TestAnnotation.java 2010-07-23 17:15:26 UTC (rev 6767)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld.extensions.test.bean.generic;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import org.jboss.weld.extensions.bean.generic.GenericAnnotation;
-
-(a)Retention(RetentionPolicy.RUNTIME)
-@GenericAnnotation
-public @interface TestAnnotation
-{
- String value();
-}
13 years, 10 months