Author: pete.muir(a)jboss.org
Date: 2009-10-04 11:45:57 -0400 (Sun, 04 Oct 2009)
New Revision: 3841
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Any.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/BeanDisambiguator.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Plain.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Spare.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotated.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedCallable.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedConstructor.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedField.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMember.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMethod.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedParameter.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedType.java
ri/trunk/inject-tck-runner/src/test/resources/META-INF/
ri/trunk/inject-tck-runner/src/test/resources/META-INF/services/
ri/trunk/inject-tck-runner/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Modified:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
ri/trunk/version-matrix/pom.xml
Log:
Pass 330 TCK unmodified
Added: ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Any.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Any.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Any.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,47 @@
+/*
+ * 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.webbeans.atinject.tck;
+
+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;
+
+/**
+ * A built-in binding type that is implicitly applied to all beans which do not
+ * have the {@link New} built-in binding type.
+ *
+ * @author Gavin King
+ * @author David Allen
+ */
+
+@Qualifier
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+public @interface Any
+{
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Any.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java 2009-10-04
15:43:27 UTC (rev 3840)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/AtInjectTCK.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -15,6 +15,7 @@
import org.atinject.tck.auto.Tire;
import org.atinject.tck.auto.V8Engine;
import org.atinject.tck.auto.accessories.Cupholder;
+import org.atinject.tck.auto.accessories.SpareTire;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.TestContainer;
@@ -36,6 +37,7 @@
Cupholder.class,
FuelTank.class,
Tire.class,
+ SpareTire.class,
// Two producer method which allow us to expose SpareTire and Drivers seat with
qualifiers
DriversSeatProducer.class,
SpareTireProducer.class
@@ -58,6 +60,7 @@
// Obtain a reference to the Car and pass it to the TCK to generate the testsuite
Bean<?> bean = beanManager.resolve(beanManager.getBeans(Car.class));
Car instance = (Car) beanManager.getReference(bean, Car.class,
beanManager.createCreationalContext(bean));
+
return Tck.testsFor(instance, false /* supportsStatic */, true /* supportsPrivate
*/);
}
}
\ No newline at end of file
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/BeanDisambiguator.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/BeanDisambiguator.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/BeanDisambiguator.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,413 @@
+package org.jboss.webbeans.atinject.tck;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.AnnotationLiteral;
+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 javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.inject.Inject;
+
+import org.atinject.tck.auto.Convertible;
+import org.atinject.tck.auto.Tire;
+import org.jboss.webbeans.atinject.tck.util.ForwardingAnnotatedConstructor;
+import org.jboss.webbeans.atinject.tck.util.ForwardingAnnotatedField;
+import org.jboss.webbeans.atinject.tck.util.ForwardingAnnotatedMethod;
+import org.jboss.webbeans.atinject.tck.util.ForwardingAnnotatedParameter;
+import org.jboss.webbeans.atinject.tck.util.ForwardingAnnotatedType;
+
+public class BeanDisambiguator implements Extension
+{
+
+ private static final Annotation PLAIN_LITERAL = new AnnotationLiteral<Plain>()
+ {
+ };
+
+ /**
+ * Modufy the class metadata that 299 will use when building beans
+ */
+ public void observe(@Observes ProcessAnnotatedType<?> pat)
+ {
+ addPlainQualifierToTireBean(pat);
+ addPlainQualifierToConvertibleConstructor(pat);
+ addPlainQualifierToConvertiblePlainTireField(pat);
+ addPlainQualifierToConvertibleInjectInstanceMethodWithManyArgs(pat);
+ }
+
+ /**
+ * Adjust the injectInstanceMethodWithManyArgs injectable method on {@link
Convertible} so that parameters
+ * 2 and 6 ({@code plainTire} and {@code plainTireProvider}) additionally have the
@Plain annotation
+ */
+ private <X> void
addPlainQualifierToConvertibleInjectInstanceMethodWithManyArgs(ProcessAnnotatedType<X>
pat)
+ {
+ if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
+ {
+ final AnnotatedType<X> original = pat.getAnnotatedType();
+
+ final Set<AnnotatedMethod<? super X>> methods = new
HashSet<AnnotatedMethod<? super X>>();
+ for (final AnnotatedMethod<? super X> method : original.getMethods())
+ {
+ if
(method.getJavaMember().getName().equals("injectInstanceMethodWithManyArgs"))
+ {
+ methods.add(qualifyParameterWithPlain(method, 2, 6));
+ }
+ else
+ {
+ methods.add(method);
+ }
+ }
+
+ pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
+ {
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return original;
+ }
+
+ @Override
+ public Set<AnnotatedMethod<? super X>> getMethods()
+ {
+ return methods;
+ }
+
+ });
+ }
+ }
+
+
+ /**
+ * Add the @Plain qualifier to the field {@code fieldPlainTire} and @{code
fieldPlainTireProvider} of {@link Convertible}
+ *
+ */
+ private <X> void
addPlainQualifierToConvertiblePlainTireField(ProcessAnnotatedType<X> pat)
+ {
+ if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
+ {
+ final AnnotatedType<X> original = pat.getAnnotatedType();
+
+ final Set<AnnotatedField<? super X>> fields = new
HashSet<AnnotatedField<? super X>>();
+
+ for (final AnnotatedField<? super X> field : original.getFields())
+ {
+ if (field.getJavaMember().getName().equals("fieldPlainTire") ||
field.getJavaMember().getName().equals("fieldPlainTireProvider"))
+ {
+ fields.add(addPlainQualifierToField(field));
+ }
+ else
+ {
+ fields.add(field);
+ }
+ }
+
+ pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
+ {
+
+ @Override
+ public Set<AnnotatedField<? super X>> getFields()
+ {
+ return fields;
+ }
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return original;
+ }
+
+ });
+ }
+ }
+
+ /**
+ * Add the @Plain qualifier to the parameters 2 and 6 ({@code plainTire} and {@code
plainTireProvider}) of the constructor of {@link Convertible}
+ *
+ */
+ private <X> void
addPlainQualifierToConvertibleConstructor(ProcessAnnotatedType<X> pat)
+ {
+ if (pat.getAnnotatedType().getJavaClass().equals(Convertible.class))
+ {
+ final AnnotatedType<X> original = pat.getAnnotatedType();
+
+ final Set<AnnotatedConstructor<X>> constructors = new
HashSet<AnnotatedConstructor<X>>();
+ for (final AnnotatedConstructor<X> constructor :
original.getConstructors())
+ {
+ if (constructor.isAnnotationPresent(Inject.class))
+ {
+ constructors.add(qualifyParameterWithPlain(constructor, 2, 6));
+ }
+ else
+ {
+ constructors.add(constructor);
+ }
+ }
+
+ pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
+ {
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return original;
+ }
+
+ @Override
+ public Set<AnnotatedConstructor<X>> getConstructors()
+ {
+ return constructors;
+ }
+
+ });
+ }
+ }
+
+ /**
+ * Add the @Plain annotation to the {@link Tire} class
+ *
+ */
+ private <X> void addPlainQualifierToTireBean(ProcessAnnotatedType<X> pat)
+ {
+ if (pat.getAnnotatedType().getJavaClass().equals(Tire.class))
+ {
+ final Set<Annotation> annotations = new HashSet<Annotation>();
+ annotations.addAll(pat.getAnnotatedType().getAnnotations());
+ annotations.add(PLAIN_LITERAL);
+ final AnnotatedType<X> original = pat.getAnnotatedType();
+ pat.setAnnotatedType(new ForwardingAnnotatedType<X>()
+ {
+
+ @Override
+ protected AnnotatedType<X> delegate()
+ {
+ return original;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends Annotation> A getAnnotation(Class<A>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return (A) PLAIN_LITERAL;
+ }
+ else
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ return annotations;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return true;
+ }
+ else
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+ }
+
+ });
+ }
+ }
+
+ /**
+ * Utility method to add the @Plain qualifier to a list of parameters
+ */
+ private <X> List<AnnotatedParameter<X>>
qualifyParameterWithPlain(final List<AnnotatedParameter<X>> parameters,
Integer... position)
+ {
+ Collection<Integer> positions = Arrays.asList(position);
+ final List<AnnotatedParameter<X>> newParameters = new
ArrayList<AnnotatedParameter<X>>();
+
+ for (final AnnotatedParameter<X> parameter : parameters)
+ {
+ if (positions.contains(parameter.getPosition()))
+ {
+ newParameters.add(addPlainQualifierToParameter(parameter));
+ }
+ else
+ {
+ newParameters.add(parameter);
+ }
+ }
+
+ return newParameters;
+
+ }
+
+ /**
+ * Utility method to add the @Plain qualifier to a method
+ */
+ private <X> AnnotatedMethod<X> qualifyParameterWithPlain(final
AnnotatedMethod<X> method, Integer... position)
+ {
+ final List<AnnotatedParameter<X>> parameters =
qualifyParameterWithPlain(method.getParameters(), position);
+ return new ForwardingAnnotatedMethod<X>()
+ {
+
+ @Override
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return parameters;
+ }
+
+ @Override
+ protected AnnotatedMethod<X> delegate()
+ {
+ return method;
+ }
+
+ };
+ }
+
+ /**
+ * Utility method to add the @Plain qualifier to a constructor
+ */
+ private <X> AnnotatedConstructor<X> qualifyParameterWithPlain(final
AnnotatedConstructor<X> constructor, Integer... position)
+ {
+ final List<AnnotatedParameter<X>> parameters =
qualifyParameterWithPlain(constructor.getParameters(), position);
+ return new ForwardingAnnotatedConstructor<X>()
+ {
+
+ @Override
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return parameters;
+ }
+
+ @Override
+ protected AnnotatedConstructor<X> delegate()
+ {
+ return constructor;
+ }
+
+ };
+ }
+
+ /**
+ * Utility method to add the @Plain qualifier to a parameter
+ */
+ private <X> AnnotatedParameter<X> addPlainQualifierToParameter(final
AnnotatedParameter<X> parameter)
+ {
+ final Set<Annotation> annotations = new HashSet<Annotation>();
+ annotations.addAll(parameter.getAnnotations());
+ annotations.add(PLAIN_LITERAL);
+ return new ForwardingAnnotatedParameter<X>()
+ {
+
+ @Override
+ protected AnnotatedParameter<X> delegate()
+ {
+ return parameter;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends Annotation> A getAnnotation(Class<A>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return (A) PLAIN_LITERAL;
+ }
+ else
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ return annotations;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return true;
+ }
+ else
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+ }
+
+ };
+ }
+
+ /**
+ * Utility method to add the @Plain qualifier to a field
+ */
+ private <X> AnnotatedField<X> addPlainQualifierToField(final
AnnotatedField<X> field)
+ {
+ final Set<Annotation> annotations = new HashSet<Annotation>();
+ annotations.addAll(field.getAnnotations());
+ annotations.add(PLAIN_LITERAL);
+ return new ForwardingAnnotatedField<X>()
+ {
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends Annotation> A getAnnotation(Class<A>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return (A) PLAIN_LITERAL;
+ }
+ else
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ return annotations;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ if (annotationType.equals(Plain.class))
+ {
+ return true;
+ }
+ else
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+ }
+
+ @Override
+ protected AnnotatedField<X> delegate()
+ {
+ return field;
+ }
+
+ };
+ }
+
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/BeanDisambiguator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Plain.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Plain.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Plain.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,39 @@
+/*
+ * 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.webbeans.atinject.tck;
+
+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;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+public @interface Plain
+{
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Plain.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Spare.java
===================================================================
--- ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Spare.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Spare.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,39 @@
+/*
+ * 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.webbeans.atinject.tck;
+
+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;
+
+@Qualifier
+@Retention(RUNTIME)
+@Target( { TYPE, METHOD, FIELD, PARAMETER })
+@Documented
+public @interface Spare
+{
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/Spare.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java 2009-10-04
15:43:27 UTC (rev 3840)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/SpareTireProducer.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -17,7 +17,7 @@
}
@Override
- @Produces @Named("spare")
+ @Produces @Named("spare") @Spare
public SpareTire produce()
{
return super.produce();
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotated.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotated.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotated.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,81 @@
+/*
+ * 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.webbeans.atinject.tck.util;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+
+/**
+ * Base class to allow implementation of the decorator pattern
+ *
+ * @author Pete Muir
+ *
+ * @param <T> the base type
+ * @param <S> the annotated element type
+ */
+public abstract class ForwardingAnnotated implements Annotated
+{
+
+ protected abstract Annotated delegate();
+
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return delegate().getAnnotations();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+
+ public Type getBaseType()
+ {
+ return delegate().getBaseType();
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return delegate().getTypeClosure();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
\ No newline at end of file
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedCallable.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedCallable.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedCallable.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+public abstract class ForwardingAnnotatedCallable<X> extends
ForwardingAnnotatedMember<X> implements AnnotatedCallable<X>
+{
+
+ @Override
+ protected abstract AnnotatedCallable<X> delegate();
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return delegate().getParameters();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedCallable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedConstructor.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedConstructor.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedConstructor.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import java.lang.reflect.Constructor;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+
+public abstract class ForwardingAnnotatedConstructor<X> extends
ForwardingAnnotatedCallable<X> implements AnnotatedConstructor<X>
+{
+
+ @Override
+ protected abstract AnnotatedConstructor<X> delegate();
+
+ @Override
+ public Constructor<X> getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedField.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedField.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedField.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+
+public abstract class ForwardingAnnotatedField<X> extends
ForwardingAnnotatedMember<X> implements AnnotatedField<X>
+{
+
+ @Override
+ protected abstract AnnotatedField<X> delegate();
+
+ @Override
+ public Field getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMember.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMember.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMember.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,29 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import java.lang.reflect.Member;
+
+import javax.enterprise.inject.spi.AnnotatedMember;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+public abstract class ForwardingAnnotatedMember<X> extends ForwardingAnnotated
implements AnnotatedMember<X>
+{
+
+ @Override
+ protected abstract AnnotatedMember<X> delegate();
+
+ public AnnotatedType<X> getDeclaringType()
+ {
+ return delegate().getDeclaringType();
+ }
+
+ public Member getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate().isStatic();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMember.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMethod.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMethod.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMethod.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import java.lang.reflect.Method;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+
+public abstract class ForwardingAnnotatedMethod<X> extends
ForwardingAnnotatedCallable<X> implements AnnotatedMethod<X>
+{
+
+ @Override
+ protected abstract AnnotatedMethod<X> delegate();
+
+ @Override
+ public Method getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedParameter.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedParameter.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedParameter.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+public abstract class ForwardingAnnotatedParameter<X> extends ForwardingAnnotated
implements AnnotatedParameter<X>
+{
+
+ @Override
+ protected abstract AnnotatedParameter<X> delegate();
+
+ public AnnotatedCallable<X> getDeclaringCallable()
+ {
+ return delegate().getDeclaringCallable();
+ }
+
+ public int getPosition()
+ {
+ return delegate().getPosition();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedType.java
===================================================================
---
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedType.java
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedType.java 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1,36 @@
+package org.jboss.webbeans.atinject.tck.util;
+
+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;
+
+public abstract class ForwardingAnnotatedType<X> extends ForwardingAnnotated
implements AnnotatedType<X>
+{
+
+ @Override
+ protected abstract AnnotatedType<X> 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();
+ }
+
+}
Property changes on:
ri/trunk/inject-tck-runner/src/test/java/org/jboss/webbeans/atinject/tck/util/ForwardingAnnotatedType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
ri/trunk/inject-tck-runner/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
===================================================================
---
ri/trunk/inject-tck-runner/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
(rev 0)
+++
ri/trunk/inject-tck-runner/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension 2009-10-04
15:45:57 UTC (rev 3841)
@@ -0,0 +1 @@
+org.jboss.webbeans.atinject.tck.BeanDisambiguator
\ No newline at end of file
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-10-04 15:43:27 UTC (rev 3840)
+++ ri/trunk/version-matrix/pom.xml 2009-10-04 15:45:57 UTC (rev 3841)
@@ -87,7 +87,7 @@
<dependency>
<groupId>org.atinject</groupId>
<artifactId>inject-tck</artifactId>
- <version>1.0.0-PFD-3-jboss-1</version>
+ <version>1.0.0-PFD-3</version>
</dependency>