Weld SVN: r4211 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions: alternative and 2 other directories.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-21 10:59:56 -0400 (Wed, 21 Oct 2009)
New Revision: 4211
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AlternativeMetadataTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedConstructorWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedFieldWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedMethodWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedParameterWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedTypeWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Bread.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Cheap.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/CheapLiteral.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Expensive.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ExpensiveLiteral.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Fruit.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Grocery.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptor.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptorBinding.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryWrapper.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Milk.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/NamedStereotype.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ProcessAnnotatedTypeObserver.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Shop.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/TropicalFruit.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Vegetables.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Water.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Yogurt.java
Removed:
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/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
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:
Tests for section 11.4
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AlternativeMetadataTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AlternativeMetadataTest.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AlternativeMetadataTest.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.jsr299.tck.tests.extensions.alternative.metadata;
+
+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;
+import org.jboss.testharness.impl.packaging.Artifact;
+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;
+
+/**
+ * This test class contains tests for adding meta data using extensions.
+ * @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")
+})
+@IntegrationTest
+@SpecVersion(spec="cdi", version="PFD2")
+public class AlternativeMetadataTest extends AbstractJSR299Test
+{
+ @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 GroceryWrapper.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 GroceryWrapper.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().equals(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
+ Grocery grocery = getInstanceByType(Grocery.class, new AnyLiteral());
+ assert grocery.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")
+ //WELD-219
+ public void testPreviouslyNonInjectAnnotatedFieldIsInjected() {
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).isVegetablesInjected();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ @SpecAssertion(section = "11.4", id = "u")
+ //WELD-219
+ public void testExtraQualifierIsAppliedToInjectedField() {
+ assert getInstanceByType(Grocery.class, new AnyLiteral()).getFruit() != null;
+ 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();
+ }
+
+ @SuppressWarnings("unchecked")
+ @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;
+ }
+
+ @SuppressWarnings("unchecked")
+ @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);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="11.4", id="ae"),
+ @SpecAssertion(section="11.4", id="ag")
+ })
+ public void testObserverMethod() {
+ getCurrentManager().fireEvent(new Milk(true));
+ Milk event = getInstanceByType(Grocery.class, new AnyLiteral()).getObserverEvent();
+ TropicalFruit parameter = getInstanceByType(Grocery.class, new AnyLiteral()).getObserverParameter();
+ assert event != null;
+ assert parameter != null;
+ assert parameter.getMetadata().getQualifiers().size() == 1;
+ assert annotationSetMatches(parameter.getMetadata().getQualifiers(), Cheap.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "11.4", id = "af")
+ public void testExtraQualifierAppliedToObservesMethodParameter() {
+ getCurrentManager().fireEvent(new Bread(true));
+ // normally, the event would be observer, however the extension adds the @Expensive qualifier to the method parameter
+ assert !getInstanceByType(Grocery.class, new AnyLiteral()).isObserver2Used();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedConstructorWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedConstructorWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedConstructorWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,41 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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 AnnotatedConstructorWrapper<X> extends AnnotatedWrapper implements AnnotatedConstructor<X>
+{
+
+ private AnnotatedConstructor<X> delegate;
+
+ public AnnotatedConstructorWrapper(AnnotatedConstructor<X> delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ super(delegate, keepOriginalAnnotations, 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/alternative/metadata/AnnotatedFieldWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedFieldWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedFieldWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+class AnnotatedFieldWrapper<X> extends AnnotatedWrapper implements AnnotatedField<X>
+{
+
+ private AnnotatedField<X> delegate;
+
+ public AnnotatedFieldWrapper(AnnotatedField<X> delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ super(delegate, keepOriginalAnnotations, 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/alternative/metadata/AnnotatedMethodWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedMethodWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedMethodWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,52 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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 AnnotatedMethodWrapper<X> extends AnnotatedWrapper implements AnnotatedMethod<X>
+{
+
+ private AnnotatedMethod<X> delegate;
+
+ public AnnotatedMethodWrapper(AnnotatedMethod<X> delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ super(delegate, keepOriginalAnnotations, 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/alternative/metadata/AnnotatedParameterWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedParameterWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedParameterWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+class AnnotatedParameterWrapper<X> extends AnnotatedWrapper implements AnnotatedParameter<X>
+{
+ private AnnotatedParameter<X> delegate;
+
+ public AnnotatedParameterWrapper(AnnotatedParameter<X> delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ super(delegate, keepOriginalAnnotations, annotations);
+ this.delegate = delegate;
+ }
+
+ public AnnotatedCallable<X> getDeclaringCallable()
+ {
+ return delegate.getDeclaringCallable();
+ }
+
+ public int getPosition()
+ {
+ return delegate.getPosition();
+ }
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedTypeWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedTypeWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedTypeWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,42 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.jsr299.tck.tests.extensions.alternative.metadata.AnnotatedWrapper;
+
+public class AnnotatedTypeWrapper<X> extends AnnotatedWrapper implements AnnotatedType<X>
+{
+ private AnnotatedType<X> delegate;
+
+ public AnnotatedTypeWrapper(AnnotatedType<X> delegate, boolean keepOriginalAnnotations, Annotation...annotations)
+ {
+ super(delegate, keepOriginalAnnotations, annotations);
+ this.delegate = delegate;
+ }
+
+ public Set<AnnotatedConstructor<X>> getConstructors()
+ {
+ return delegate.getConstructors();
+ }
+
+ public Set<AnnotatedField<? super X>> getFields()
+ {
+ return delegate.getFields();
+ }
+
+ public Class<X> getJavaClass()
+ {
+ return delegate.getJavaClass();
+ }
+
+ public Set<AnnotatedMethod<? super X>> getMethods()
+ {
+ return delegate.getMethods();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/AnnotatedWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,63 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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 AnnotatedWrapper implements Annotated
+{
+
+ private Annotated delegate;
+ private Set<Annotation> annotations;
+
+ public AnnotatedWrapper(Annotated delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ this.delegate = delegate;
+ this.annotations = new HashSet<Annotation>(Arrays.asList(annotations));
+ if (keepOriginalAnnotations)
+ {
+ this.annotations.addAll(delegate.getAnnotations());
+ }
+ }
+
+ @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/alternative/metadata/Bread.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Bread.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Bread.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/Cheap.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Cheap.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Cheap.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/CheapLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/CheapLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/CheapLiteral.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/Expensive.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Expensive.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Expensive.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/ExpensiveLiteral.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ExpensiveLiteral.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ExpensiveLiteral.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/Fruit.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Fruit.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Fruit.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+interface Fruit
+{
+ InjectionPoint getMetadata();
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Grocery.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Grocery.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Grocery.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,109 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Observes;
+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;
+ @Inject
+ private Fruit fruit;
+ private boolean constructorWithParameterUsed = false;
+ private TropicalFruit initializerFruit = null;
+ private Bread bread = new Bread(true);
+ private Water water = null;
+
+ private Milk observerEvent = null;
+ private TropicalFruit observerParameter = null;
+ private boolean observer2Used = false;
+
+ 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 void observer1(Milk event, TropicalFruit fruit) {
+ observerEvent = event;
+ observerParameter = fruit;
+ }
+
+ public void observer2(@Observes Bread event) {
+ observer2Used = true;
+ }
+
+ public boolean isWaterInjected() {
+ return water != null;
+ }
+
+ public Milk getObserverEvent()
+ {
+ return observerEvent;
+ }
+
+ public TropicalFruit getObserverParameter()
+ {
+ return observerParameter;
+ }
+
+ public boolean isObserver2Used()
+ {
+ return observer2Used;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptor.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptor.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptor.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.io.Serializable;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@SuppressWarnings("serial")
+@Interceptor
+@GroceryInterceptorBinding
+class GroceryInterceptor implements Serializable
+{
+ @AroundInvoke
+ public Object interceptFoo(InvocationContext ctx) throws Exception
+ {
+ if (ctx.getMethod().getName().equals("foo"))
+ {
+ return "foo";
+ }
+ return ctx.proceed();
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptorBinding.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptorBinding.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryInterceptorBinding.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/GroceryWrapper.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryWrapper.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/GroceryWrapper.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,232 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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.event.Notify;
+import javax.enterprise.event.Observes;
+import javax.enterprise.event.TransactionPhase;
+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 GroceryWrapper extends AnnotatedTypeWrapper<Grocery>
+{
+ private final Set<Type> typeClosure = new HashSet<Type>();
+ private static boolean getBaseTypeOfFruitFieldUsed = false;
+ private static boolean getTypeClosureUsed = false;
+
+ public GroceryWrapper(AnnotatedType<Grocery> delegate)
+ {
+ super(delegate, false, 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<Grocery>> getConstructors()
+ {
+ Set<AnnotatedConstructor<Grocery>> constructors = new HashSet<AnnotatedConstructor<Grocery>>();
+ for (AnnotatedConstructor<Grocery> 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 Grocery>> getFields()
+ {
+ Set<AnnotatedField<? super Grocery>> fields = new HashSet<AnnotatedField<? super Grocery>>();
+ for (AnnotatedField<? super Grocery> 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()));
+ }
+ 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 Grocery>> getMethods()
+ {
+ Set<AnnotatedMethod<? super Grocery>> methods = new HashSet<AnnotatedMethod<? super Grocery>>();
+ for (AnnotatedMethod<? super Grocery> method : super.getMethods())
+ {
+ if (method.getJavaMember().getName().equals("getMilk"))
+ {
+ methods.add(wrapMethod(method, false, new AnnotationLiteral<Produces>()
+ {
+ }));
+ }
+ else if (method.getJavaMember().getName().equals("getYogurt"))
+ {
+ // wrap the method and its parameters
+ AnnotatedMethod<? super Grocery> wrappedMethod = wrapMethod(method, false, new ExpensiveLiteral(), new AnnotationLiteral<Produces>()
+ {
+ });
+ methods.add(wrapMethodParameters(wrappedMethod, false, new Annotation[] {new CheapLiteral()}));
+ }
+ else if (method.getJavaMember().getName().equals("nonInjectAnnotatedInitializer"))
+ {
+ methods.add(wrapMethod(method, false, new InjectLiteral()));
+ }
+ else if (method.getJavaMember().getName().equals("initializer"))
+ {
+ methods.add(wrapMethodParameters(method, false, new Annotation[] { new CheapLiteral() }));
+ }
+ else if (method.getJavaMember().getName().equals("observer1"))
+ {
+ Annotation[] firstParameterAnnotations = new Annotation[] { new Observes()
+ {
+
+ public TransactionPhase during()
+ {
+ return TransactionPhase.IN_PROGRESS;
+ }
+
+ public Notify notifyObserver()
+ {
+ return Notify.ALWAYS;
+ }
+
+ public Class<? extends Annotation> annotationType()
+ {
+ return Observes.class;
+ }
+
+ } };
+ Annotation[] secondParameterAnnotations = new Annotation[] { new CheapLiteral() };
+ methods.add(wrapMethodParameters(method, false, firstParameterAnnotations, secondParameterAnnotations));
+ }
+ else if (method.getJavaMember().getName().equals("observer2"))
+ {
+ methods.add(wrapMethodParameters(method, true, new Annotation[] { new ExpensiveLiteral() }));
+ }
+ else
+ {
+ methods.add(method);
+ }
+ }
+ return methods;
+ }
+
+ private <Y> AnnotatedConstructor<Y> wrapConstructor(AnnotatedConstructor<Y> delegate, Annotation... annotations)
+ {
+ return new AnnotatedConstructorWrapper<Y>(delegate, false, annotations);
+ }
+
+ private <Y> AnnotatedField<Y> wrapField(AnnotatedField<Y> delegate, Annotation... annotations)
+ {
+ return new AnnotatedFieldWrapper<Y>(delegate, false, annotations);
+ }
+
+ private <Y> AnnotatedField<Y> wrapFruitField(AnnotatedField<Y> delegate, Annotation... annotations)
+ {
+ return new AnnotatedFieldWrapper<Y>(delegate, true, annotations)
+ {
+ @Override
+ public Type getBaseType()
+ {
+ getBaseTypeOfFruitFieldUsed = true;
+ return TropicalFruit.class;
+ }
+
+ @SuppressWarnings("serial")
+ @Override
+ public Set<Type> getTypeClosure()
+ {
+ return new HashSet<Type>() {
+ {
+ add(Object.class);
+ add(Fruit.class);
+ add(TropicalFruit.class);
+ }
+ };
+ }
+
+
+ };
+ }
+
+ private <Y> AnnotatedMethodWrapper<Y> wrapMethod(AnnotatedMethod<Y> delegate, boolean keepOriginalAnnotations, Annotation... annotations)
+ {
+ return new AnnotatedMethodWrapper<Y>(delegate, keepOriginalAnnotations, annotations);
+ }
+
+ /**
+ * This method allows you to add a set of Annotations to every method
+ * parameter. Note that the method will remove all method-level annotations.
+ */
+ private <Y> AnnotatedMethodWrapper<Y> wrapMethodParameters(AnnotatedMethod<Y> delegate, final boolean keepOriginalAnnotations, final Annotation[]... annotations)
+ {
+ return new AnnotatedMethodWrapper<Y>(delegate, true)
+ {
+ @Override
+ public List<AnnotatedParameter<Y>> getParameters()
+ {
+ List<AnnotatedParameter<Y>> parameters = new ArrayList<AnnotatedParameter<Y>>();
+ for (AnnotatedParameter<Y> parameter : super.getParameters())
+ {
+ parameters.add(new AnnotatedParameterWrapper<Y>(parameter, keepOriginalAnnotations, annotations[parameter.getPosition()]));
+ }
+ 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/alternative/metadata/Milk.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Milk.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Milk.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/NamedStereotype.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/NamedStereotype.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/NamedStereotype.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ProcessAnnotatedTypeObserver.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ProcessAnnotatedTypeObserver.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/ProcessAnnotatedTypeObserver.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+
+public class ProcessAnnotatedTypeObserver implements Extension
+{
+
+ public void observeGroceryAnnotatedType(@Observes ProcessAnnotatedType<Grocery> event) {
+ event.setAnnotatedType(new GroceryWrapper(event.getAnnotatedType()));
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Shop.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Shop.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Shop.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+interface Shop
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/TropicalFruit.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/TropicalFruit.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/TropicalFruit.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+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/alternative/metadata/Vegetables.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Vegetables.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Vegetables.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+import java.io.Serializable;
+
+class Vegetables implements Serializable
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Water.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Water.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Water.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+@Cheap
+class Water
+{
+
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Yogurt.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Yogurt.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/alternative/metadata/Yogurt.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.extensions.alternative.metadata;
+
+class Yogurt
+{
+ private TropicalFruit fruit;
+
+ public Yogurt(TropicalFruit fruit) {
+ this.fruit = fruit;
+ }
+
+ public TropicalFruit getFruit()
+ {
+ return fruit;
+ }
+}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Bread.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-class Bread
-{
- @SuppressWarnings("unused")
- private boolean fresh;
-
- public Bread(boolean fresh) {
- this.fresh = fresh;
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Cheap.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,22 +0,0 @@
-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
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/CheapLiteral.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class CheapLiteral extends AnnotationLiteral<Cheap> implements Cheap
-{
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Expensive.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,22 +0,0 @@
-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
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ExpensiveLiteral.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class ExpensiveLiteral extends AnnotationLiteral<Expensive> implements Expensive
-{
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Fruit.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-import javax.enterprise.inject.spi.InjectionPoint;
-
-interface Fruit
-{
- InjectionPoint getMetadata();
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Grocery.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,79 +0,0 @@
-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;
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryAnnotatedType.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,181 +0,0 @@
-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;
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptor.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,23 +0,0 @@
-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();
- }
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/GroceryInterceptorBinding.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,17 +0,0 @@
-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
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Milk.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-class Milk
-{
- @SuppressWarnings("unused")
- private boolean fresh;
-
- public Milk(boolean fresh)
- {
- this.fresh = fresh;
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/NamedStereotype.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,19 +0,0 @@
-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-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeObserver.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -38,10 +38,6 @@
{
wrapAnnotatedType(event);
}
- else if (event.getAnnotatedType().getJavaClass().equals(Grocery.class))
- {
- wrapGroceryAnnotatedType(event);
- }
}
private <X> void wrapAnnotatedType(ProcessAnnotatedType<X> event)
@@ -49,11 +45,6 @@
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;
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-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ProcessAnnotatedTypeTest.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -17,13 +17,7 @@
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;
@@ -31,7 +25,6 @@
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;
@@ -43,7 +36,6 @@
*
*/
@Artifact
-@BeansXml("beans.xml")
@Resources({
@Resource(source="javax.enterprise.inject.spi.Extension", destination="WEB-INF/classes/META-INF/services/javax.enterprise.inject.spi.Extension")
})
@@ -93,118 +85,4 @@
{
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(groups="ri-broken")
- @SpecAssertion(section = "11.4", id = "t")
- public void testPreviouslyNonInjectAnnotatedFieldIsInjected() {
- assert getInstanceByType(Grocery.class, new AnyLiteral()).isVegetablesInjected();
- }
-
- @Test(groups="ri-broken")
- @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);
- }
}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Shop.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-interface Shop
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedConstructor.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,41 +0,0 @@
-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();
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedField.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,34 +0,0 @@
-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();
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedMethod.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,52 +0,0 @@
-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();
- }
-
-
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedParameter.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,28 +0,0 @@
-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-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TestAnnotatedType.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -58,5 +58,4 @@
{
return getMethodsUsed;
}
-
}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/TropicalFruit.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,16 +0,0 @@
-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;
- }
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Vegetables.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-class Vegetables
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Water.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,7 +0,0 @@
-package org.jboss.jsr299.tck.tests.extensions.annotated;
-
-@Cheap
-class Water
-{
-
-}
Deleted: 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 2009-10-21 14:36:55 UTC (rev 4210)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Yogurt.java 2009-10-21 14:59:56 UTC (rev 4211)
@@ -1,15 +0,0 @@
-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;
- }
-}
15 years, 1 month
Weld SVN: r4210 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-10-21 10:36:55 -0400 (Wed, 21 Oct 2009)
New Revision: 4210
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Warhead.java
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Missile.java
Log:
Extended interceptor definition test to test WELD-219
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-10-21 04:43:21 UTC (rev 4209)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-10-21 14:36:55 UTC (rev 4210)
@@ -202,20 +202,22 @@
getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE, nonBinding);
}
- @Test
+ @Test(groups = "ri-broken")
@SpecAssertions({
@SpecAssertion(section = "7.2", id = "a"),
@SpecAssertion(section = "9.2", id = "a"),
@SpecAssertion(section = "12.3", id = "kb")
})
+ //WELD-219
public void testManagedBeanIsIntercepted()
{
MissileInterceptor.intercepted = false;
Missile missile = getInstanceByType(Missile.class);
missile.fire();
-
assert MissileInterceptor.intercepted;
+
+ assert missile.getWarhead() != null; // test that injection works
}
@Test
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Missile.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Missile.java 2009-10-21 04:43:21 UTC (rev 4209)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Missile.java 2009-10-21 14:36:55 UTC (rev 4210)
@@ -5,6 +5,9 @@
@MissileBinding
class Missile
{
+ @Inject
+ private Warhead warhead;
+
boolean initCalled = false;
@Inject
@@ -17,4 +20,9 @@
}
public void fire() { }
+
+ public Warhead getWarhead()
+ {
+ return warhead;
+ }
}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Warhead.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Warhead.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Warhead.java 2009-10-21 14:36:55 UTC (rev 4210)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+class Warhead
+{
+
+}
15 years, 1 month
Weld SVN: r4209 - in core/trunk: inject-tck-runner and 1 other directory.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-10-21 00:43:21 -0400 (Wed, 21 Oct 2009)
New Revision: 4209
Modified:
core/trunk/bom/pom.xml
core/trunk/inject-tck-runner/pom.xml
Log:
setting jboss-interceptors to 1.0.0-CR3. Adding slf4j-api + simple-bindings for AtInjectTCK runner.
Modified: core/trunk/bom/pom.xml
===================================================================
--- core/trunk/bom/pom.xml 2009-10-20 22:15:34 UTC (rev 4208)
+++ core/trunk/bom/pom.xml 2009-10-21 04:43:21 UTC (rev 4209)
@@ -76,7 +76,8 @@
<javassist.version>3.11.0.GA</javassist.version>
<cdi.tck.version>1.0.0-SNAPSHOT</cdi.tck.version>
<atinject.tck.version>1.0.0-PFD-3</atinject.tck.version>
- <jboss.interceptor.version>1.0.0-SNAPSHOT</jboss.interceptor.version>
+ <jboss.interceptor.version>1.0.0-CR3</jboss.interceptor.version>
+ <slf4j.version>1.5.8</slf4j.version>
</properties>
<dependencyManagement>
@@ -150,6 +151,20 @@
<version>${google.collections.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
</dependencyManagement>
Modified: core/trunk/inject-tck-runner/pom.xml
===================================================================
--- core/trunk/inject-tck-runner/pom.xml 2009-10-20 22:15:34 UTC (rev 4208)
+++ core/trunk/inject-tck-runner/pom.xml 2009-10-21 04:43:21 UTC (rev 4209)
@@ -38,6 +38,18 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
15 years, 1 month
Weld SVN: r4208 - core/trunk/impl/src/main/java/org/jboss/weld/bean.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-10-20 18:15:34 -0400 (Tue, 20 Oct 2009)
New Revision: 4208
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
Log:
Do not register the InternalEjbDescriptor and do not register interceptors twice.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2009-10-20 21:02:02 UTC (rev 4207)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2009-10-20 22:15:34 UTC (rev 4208)
@@ -124,4 +124,9 @@
// No-op
}
+ @Override
+ protected void registerInterceptors()
+ {
+ // No - op
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-20 21:02:02 UTC (rev 4207)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-20 22:15:34 UTC (rev 4208)
@@ -436,11 +436,11 @@
return true;
}
- private void registerInterceptors()
+ protected void registerInterceptors()
{
InterceptionModel<Class<?>, SerializableContextual<javax.enterprise.inject.spi.Interceptor<?>, ?>> model = manager.getCdiInterceptorsRegistry().getInterceptionModel(ejbDescriptor.getBeanClass());
if (model != null)
- getManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor(), new InterceptorBindingsAdapter(model));
+ getManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor().delegate(), new InterceptorBindingsAdapter(model));
}
}
15 years, 1 month
Weld SVN: r4207 - core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-10-20 17:02:02 -0400 (Tue, 20 Oct 2009)
New Revision: 4207
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
Log:
Disable the deployment of the Choice class, allowing the build to succeed.
Modified: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-20 17:48:54 UTC (rev 4206)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-20 21:02:02 UTC (rev 4207)
@@ -9,6 +9,7 @@
import javax.inject.Qualifier;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.metadata.TypeStore;
@@ -16,7 +17,8 @@
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
-@Artifact
+@Artifact(addCurrentPackage = false)
+(a)Classes({Animal.class, Antelope.class, Kangaroo.class, Order.class, Random.class})
public class ClassAnnotatedItemTest extends AbstractWeldTest
{
@@ -58,5 +60,5 @@
AnnotatedType at = WeldClassImpl.of(new Kangaroo().procreate().getClass(), transformer);
WeldClassImpl.of(at, transformer);
}
-
+
}
15 years, 1 month
Weld SVN: r4206 - core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem.
by weld-commits@lists.jboss.org
Author: cpopetz
Date: 2009-10-20 13:48:54 -0400 (Tue, 20 Oct 2009)
New Revision: 4206
Added:
core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/Choice.java
Log:
Add test class which triggers infinite recursion while resolving types.
Added: core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/Choice.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/Choice.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/Choice.java 2009-10-20 17:48:54 UTC (rev 4206)
@@ -0,0 +1,14 @@
+package org.jboss.weld.test.unit.implementation.annotatedItem;
+
+abstract class ChoiceParent<T>
+{
+}
+
+
+class Choice<T, E> extends ChoiceParent<T>
+{
+ public Choice<T, E> aMethod()
+ {
+ return null;
+ }
+}
15 years, 1 month
Weld SVN: r4205 - cdi-tck/trunk/doc/reference/en-US.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-10-20 08:08:58 -0400 (Tue, 20 Oct 2009)
New Revision: 4205
Modified:
cdi-tck/trunk/doc/reference/en-US/configuration.xml
Log:
Document requiring -ea
Modified: cdi-tck/trunk/doc/reference/en-US/configuration.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/configuration.xml 2009-10-19 22:49:38 UTC (rev 4204)
+++ cdi-tck/trunk/doc/reference/en-US/configuration.xml 2009-10-20 12:08:58 UTC (rev 4205)
@@ -219,6 +219,17 @@
</para>
</section>
+
+ <section>
+ <title>Configuring your application server to execute the TCK</title>
+ <para>
+ The TCK makes use of the Java 1.4 keyword <literal>assert</literal>; you
+ must ensure that the JVM used to run the application server is started
+ with assertions enabled. See
+ <ulink url="http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html#enable-disable">Programming With Assertions</ulink>
+ for more information on how to enable assertions.
+ </para>
+ </section>
<!--
vim: ts=3:sw=3:tw=80:set expandtab
-->
15 years, 1 month
Weld SVN: r4203 - extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket.
by weld-commits@lists.jboss.org
Author: cpopetz
Date: 2009-10-19 18:48:56 -0400 (Mon, 19 Oct 2009)
New Revision: 4203
Modified:
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java
extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java
Log:
Update for new api, make jetty-compatible, make wicket.detach() compatible
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-19 22:44:36 UTC (rev 4202)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldApplication.java 2009-10-19 22:48:56 UTC (rev 4203)
@@ -29,15 +29,13 @@
public abstract class WeldApplication extends WebApplication
{
- private final NonContextual<WeldComponentInstantiationListener> weldComponentInstantiationListener;
- private final NonContextual<WeldWebRequestCycleProcessor> weldWebRequestCycleProcessor;
+ private NonContextual<WeldComponentInstantiationListener> weldComponentInstantiationListener;
+ private NonContextual<WeldWebRequestCycleProcessor> weldWebRequestCycleProcessor;
/**
*/
public WeldApplication()
{
- this.weldComponentInstantiationListener = new NonContextual<WeldComponentInstantiationListener>(BeanManagerLookup.getBeanManager(), WeldComponentInstantiationListener.class);
- this.weldWebRequestCycleProcessor = new NonContextual<WeldWebRequestCycleProcessor>(BeanManagerLookup.getBeanManager(), WeldWebRequestCycleProcessor.class);
}
/**
@@ -49,6 +47,8 @@
protected void internalInit()
{
super.internalInit();
+ this.weldComponentInstantiationListener = new NonContextual<WeldComponentInstantiationListener>(BeanManagerLookup.getBeanManager(), WeldComponentInstantiationListener.class);
+ this.weldWebRequestCycleProcessor = new NonContextual<WeldWebRequestCycleProcessor>(BeanManagerLookup.getBeanManager(), WeldWebRequestCycleProcessor.class);
addComponentInstantiationListener(weldComponentInstantiationListener.newInstance().produce().inject().get());
}
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java 2009-10-19 22:44:36 UTC (rev 4202)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldRequestCycle.java 2009-10-19 22:48:56 UTC (rev 4203)
@@ -21,12 +21,12 @@
import org.jboss.weld.Container;
import org.jboss.weld.context.ContextLifecycle;
import org.jboss.weld.context.ConversationContext;
+import org.jboss.weld.conversation.ConversationImpl;
import org.jboss.weld.conversation.ConversationManager;
import org.jboss.weld.servlet.ConversationBeanStore;
/**
- * WeldRequestCycle is a subclass of the standard wicket WebRequestCycle
- * which:
+ * WeldRequestCycle is a subclass of the standard wicket WebRequestCycle which:
* <ul>
* <li>restores long-running conversations specified in wicket page metadata
* when a page target is first used.
@@ -34,12 +34,13 @@
* the above metadata
* <li>propagates long running conversations across redirects through the use of
* a request parameter if the redirect is handled with a BookmarkablePageRequest
- * <li>Sets up the conversational context
+ * <li>Sets up the conversational context when the request target is set
+ * <li>Tears down the conversation context on detach() of the RequestCycle
* </ul>
*
- * @see WeldWebRequestCycleProcessor Which handles propogation of
- * conversation data for newly-started long running conversations, by
- * storing their ids in the page metadata
+ * @see WeldWebRequestCycleProcessor Which handles propogation of conversation
+ * data for newly-started long running conversations, by storing their ids
+ * in the page metadata
* @author cpopetz
*
*/
@@ -82,18 +83,19 @@
BeanManager manager = BeanManagerLookup.getBeanManager();
- Conversation conversation = getInstanceByType(manager, Conversation.class);
+ ConversationImpl conversation = (ConversationImpl) getInstanceByType(manager,
+ Conversation.class);
- // restore a conversation if it exists
- if (specifiedCid != null)
+ // restore a conversation if it exists and we aren't already in it
+ if (specifiedCid != null
+ && (conversation == null || !specifiedCid.equals(conversation.getUnderlyingId())))
{
- // Restore this conversation
getInstanceByType(manager, ConversationManager.class).beginOrRestoreConversation(specifiedCid);
}
// handle propagation of existing long running converstaions to new
// targets
- if (conversation.isLongRunning())
+ if (!conversation.isTransient())
{
// Note that we can't propagate conversations with other redirect
// targets like RequestRedirectTarget through this mechanism, because
@@ -105,14 +107,14 @@
BookmarkablePageRequestTarget bookmark = (BookmarkablePageRequestTarget) target;
// if a cid has already been specified, don't override it
if (!bookmark.getPageParameters().containsKey("cid"))
- bookmark.getPageParameters().add("cid", conversation.getId());
+ bookmark.getPageParameters().add("cid", conversation.getUnderlyingId());
}
// If we have a target page, propagate the conversation to the page's
// metadata
if (page != null)
{
- page.setMetaData(WeldMetaData.CID, conversation.getId());
+ page.setMetaData(WeldMetaData.CID, conversation.getUnderlyingId());
}
}
@@ -122,7 +124,7 @@
if (!conversationContext.isActive())
{
conversationContext.setBeanStore(new ConversationBeanStore(((WebRequest) request)
- .getHttpServletRequest().getSession(), conversation.getId()));
+ .getHttpServletRequest().getSession(), conversation.getUnderlyingId()));
conversationContext.setActive(true);
}
}
@@ -146,5 +148,21 @@
}
return beans.iterator().next();
}
+
+ @Override
+ public void detach()
+ {
+ super.detach();
+ ConversationContext conversationContext = Container.instance().deploymentServices().get(
+ ContextLifecycle.class).getConversationContext();
+ // cleanup and deactivate the conversation context
+ if (conversationContext.isActive())
+ {
+ ConversationManager conversationManager = getInstanceByType(BeanManagerLookup
+ .getBeanManager(), ConversationManager.class);
+ conversationManager.cleanupConversation();
+ conversationContext.setActive(false);
+ }
+ }
}
\ No newline at end of file
Modified: extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java
===================================================================
--- extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java 2009-10-19 22:44:36 UTC (rev 4202)
+++ extensions/trunk/wicket/src/main/java/org/jboss/weld/wicket/WeldWebRequestCycleProcessor.java 2009-10-19 22:48:56 UTC (rev 4203)
@@ -6,16 +6,11 @@
import org.apache.wicket.Page;
import org.apache.wicket.RequestCycle;
import org.apache.wicket.protocol.http.WebRequestCycleProcessor;
-import org.jboss.weld.Container;
-import org.jboss.weld.context.ContextLifecycle;
-import org.jboss.weld.context.ConversationContext;
-import org.jboss.weld.conversation.ConversationManager;
/**
* WeldWebRequestCycleProcessor is a subclass of the standard wicket
* WebRequestCycleProcessor which saves the conversation id of any long-running
- * cornversation in wicket page metadata. It also cleans up the conversation
- * context.
+ * cornversation in wicket page metadata.
*
* @author cpopetz
*
@@ -24,8 +19,6 @@
{
@Inject
Conversation conversation;
- @Inject
- ConversationManager conversationManager;
/**
* If a long running conversation has been started, store its id into page
@@ -35,7 +28,7 @@
public void respond(RequestCycle requestCycle)
{
super.respond(requestCycle);
- if (conversation.isLongRunning())
+ if (!conversation.isTransient())
{
Page page = RequestCycle.get().getResponsePage();
if (page != null)
@@ -44,11 +37,5 @@
}
}
- //cleanup and deactivate the conversation context
- conversationManager.cleanupConversation();
-
- ConversationContext conversationContext = Container.instance().deploymentServices().get(
- ContextLifecycle.class).getConversationContext();
- conversationContext.setActive(false);
}
}
\ No newline at end of file
15 years, 1 month
Weld SVN: r4202 - cdi-tck/trunk/doc/reference/en-US.
by weld-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-10-19 18:44:36 -0400 (Mon, 19 Oct 2009)
New Revision: 4202
Modified:
cdi-tck/trunk/doc/reference/en-US/sigtest.xml
Log:
updated sigtest section of docs
Modified: cdi-tck/trunk/doc/reference/en-US/sigtest.xml
===================================================================
--- cdi-tck/trunk/doc/reference/en-US/sigtest.xml 2009-10-19 22:09:42 UTC (rev 4201)
+++ cdi-tck/trunk/doc/reference/en-US/sigtest.xml 2009-10-19 22:44:36 UTC (rev 4202)
@@ -10,8 +10,9 @@
<section>
<title>Obtaining the sigtest tool</title>
<para>
- You can obtain the Sigtest tool from the Sigtest home page at <ulink url="https://sigtest.dev.java.net/"/>.
- The user guide can be found at <ulink url="http://java.sun.com/javame/sigtest/docs/sigtest2.1_usersguide.pdf"/>.
+ You can obtain the Sigtest tool (at the time of writing the TCK uses version 2.1) from the Sigtest home
+ page at <ulink url="https://sigtest.dev.java.net/"/>. The user guide can be found at
+ <ulink url="http://java.sun.com/javame/sigtest/docs/sigtest2.1_usersguide.pdf"/>.
</para>
</section>
@@ -21,28 +22,26 @@
The general command for generating a signature file looks like this:
</para>
- <programlisting><![CDATA[
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static]]></programlisting>
+ <programlisting><![CDATA[java -jar sigtestdev.jar Setup -classpath "%JAVA_HOME%\jre\lib\rt.jar:cdi-api.jar:javax.inject.jar:el-api.jar:jboss-interceptor-api.jar" -Package javax.decorator -Package javax.enterprise -FileName cdi-api.sig -static]]></programlisting>
<para>
- Here's a working example with the classpaths filled out:
+ Usually all the required libraries will be located in a local Maven repository, so here's a working example with the
+ classpaths filled out:
</para>
- <programlisting><![CDATA[
-java -cp %JAVA_HOME%\jre\lib\rt.jar;/home/shane/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%/jre/lib/rt.jar;/home/shane/.m2/repository/org/jboss/weld/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT.jar;/home/shane/.m2/repository/javax/el/el-api/1.2/el-api-1.2.jar -static]]></programlisting>
+ <programlisting><![CDATA[java -jar "/home/shane/java/sigtest-2.1/lib/sigtestdev.jar" Setup -classpath "/usr/local/java/jre/lib/rt.jar:/home/shane/.m2/repository/javax/enterprise/cdi-api/1.0.0-SNAPSHOT/cdi-api-1.0.0-SNAPSHOT.jar:/home/shane/.m2/repository/javax/inject/javax.inject/1.0-PFD-1/javax.inject-1.0-PFD-1.jar:/home/shane/.m2/repository/javax/el/el-api/2.1.2-b04/el-api-2.1.2-b04.jar:/home/shane/.m2/repository/org/jboss/interceptor/jboss-interceptor-api/3.1.0-CR1/jboss-interceptor-api-3.1.0-CR1.jar" -Package javax.decorator -Package javax.enterprise -FileName cdi-api.sig -static]]></programlisting>
</section>
<section>
<title>Running the signature test</title>
- <para>To run the signature test simply change the execution class from <literal>Setup</literal> to <literal>SignatureTest</literal>:</para>
+ <para>To run the signature test simply change the execution command from <literal>Setup</literal> to <literal>SignatureTest</literal>:</para>
- <programlisting><![CDATA[
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static]]></programlisting>
+ <programlisting><![CDATA[java -jar sigtestdev.jar SignatureTest -classpath "%JAVA_HOME%\jre\lib\rt.jar:cdi-api.jar:javax.inject.jar:el-api.jar:jboss-interceptor-api.jar" -Package javax.decorator -Package javax.enterprise -FileName cdi-api.sig -static]]></programlisting>
- <para>Here's a working example:</para>
+ <para>Once again, here's a working example:</para>
- <programlisting><![CDATA[java -cp %JAVA_HOME%\jre\lib\rt.jar;/home/shane/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName weld.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;/home/shane/.m2/repository/org/jboss/weld/jsr299-api/1.0.0-SNAPSHOT/jsr299-api-1.0.0-SNAPSHOT.jar;/home/shane/.m2/repository/javax/el/el-api/1.2/el-api-1.2.jar -static]]></programlisting>
+ <programlisting><![CDATA[java -jar "/home/shane/java/sigtest-2.1/lib/sigtestdev.jar" SignatureTest -classpath "/usr/local/java/jre/lib/rt.jar:/home/shane/.m2/repository/javax/enterprise/cdi-api/1.0.0-SNAPSHOT/cdi-api-1.0.0-SNAPSHOT.jar:/home/shane/.m2/repository/javax/inject/javax.inject/1.0-PFD-1/javax.inject-1.0-PFD-1.jar:/home/shane/.m2/repository/javax/el/el-api/2.1.2-b04/el-api-2.1.2-b04.jar:/home/shane/.m2/repository/org/jboss/interceptor/jboss-interceptor-api/3.1.0-CR1/jboss-interceptor-api-3.1.0-CR1.jar" -Package javax.decorator -Package javax.enterprise -FileName cdi-api.sig -static]]></programlisting>
<para>When running the signature test, you may get the following message:</para>
@@ -56,36 +55,43 @@
<para>Just for fun (and to confirm that the signature test is working correctly), you can try the following:</para>
- <para>1) Edit weld.sig</para>
+ <para>1) Edit cdi-api.sig</para>
- <para>2) Modify one of the class signatures - in the following example we change one of the constructors for <literal>NullableDependencyException</literal> - here's the original:</para>
+ <para>2) Modify one of the class signatures - in the following example we change one of the constructors for <literal>BusyConversationException</literal> - here's the original:</para>
- <programlisting><![CDATA[
-CLSS public javax.inject.NullableDependencyException
-cons public NullableDependencyException()
-cons public NullableDependencyException(java.lang.String)]]></programlisting>
+ <programlisting><![CDATA[CLSS public javax.enterprise.context.BusyConversationException
+cons public BusyConversationException()
+cons public BusyConversationException(java.lang.String)
+cons public BusyConversationException(java.lang.String,java.lang.Throwable)
+cons public BusyConversationException(java.lang.Throwable)
+supr javax.enterprise.context.ContextException
+hfds serialVersionUID
+]]></programlisting>
- <para>Let's change the constructor parameter to a <literal>java.lang.Integer</literal> instead:</para>
+ <para>Let's change the default (empty) constructor parameter to one with a <literal>java.lang.Integer</literal>parameter instead:</para>
- <programlisting><![CDATA[
-CLSS public javax.inject.NullableDependencyException
-cons public NullableDependencyException()
-cons public NullableDependencyException(java.lang.Integer)]]></programlisting>
+ <programlisting><![CDATA[CLSS public javax.enterprise.context.BusyConversationException
+cons public BusyConversationException(java.lang.Integer)
+cons public BusyConversationException(java.lang.String)
+cons public BusyConversationException(java.lang.String,java.lang.Throwable)
+cons public BusyConversationException(java.lang.Throwable)
+supr javax.enterprise.context.ContextException
+hfds serialVersionUID
+]]></programlisting>
- <para>3) Now we run the signature test using the above command, which should result in the following errors:</para>
+ <para>3) Now when we run the signature test using the above command, we should get the following errors:</para>
- <programlisting><![CDATA[
-Missing Constructors
---------------------
-
-javax.inject.NullableDependencyException: constructor public javax.inject.NullableDependencyException.NullableDependencyException(java.lang.Integer)
-
-Added Constructors
-------------------
-
-javax.inject.NullableDependencyException: constructor public javax.inject.NullableDependencyException.NullableDependencyException(java.lang.String)
-
-
+ <programlisting><![CDATA[Missing Constructors
+--------------------
+
+javax.enterprise.context.BusyConversationException: constructor public javax.enterprise.context.BusyConversationException.BusyConversationException(java.lang.Integer)
+
+Added Constructors
+------------------
+
+javax.enterprise.context.BusyConversationException: constructor public javax.enterprise.context.BusyConversationException.BusyConversationException()
+
+
STATUS:Failed.2 errors]]></programlisting>
</section>
15 years, 1 month