[webbeans-commits] Webbeans SVN: r3118 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 12:27:31 -0400 (Tue, 21 Jul 2009)
New Revision: 3118
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Marked 2 assertions untestable and expanded "Typesafe resolution" assertions with a separate assertion for omitting interceptors and decorators during the resolution.
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 16:24:01 UTC (rev 3117)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 16:27:31 UTC (rev 3118)
@@ -1687,6 +1687,10 @@
</section>
<section id="5.3" title="Typesafe resolution">
+ <assertion id="h">
+ <text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type.</text>
+ </assertion>
+
<assertion id="i">
<text>When resolving beans that are eligible for injection to an injection point, the container identifies the set of matching beans which are not interceptors or decorators and which have a bean type that matches the required type. For this purpose, primitive types are considered to match their corresponding wrapper types in |java.lang| ~and array types are considered to match only if their element types are identical. Parameterized and raw types are considered to match if they are identical or if the bean type is assignable to the required type, as defined in Section 5.3.3, "Assignability of raw and parameterized types".~</text>
</assertion>
@@ -1839,7 +1843,7 @@
</section>
<section id="5.5" title="Client proxies">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>Client proxies are never required for a bean whose scope is a pseudo-scope such as |@Dependent|</text>
</assertion>
@@ -1910,7 +1914,7 @@
<text>The container is required to perform dependency injection whenever it instantiates instances of any other Java EE component class supporting injection.</text>
</assertion>
- <assertion id="f">
+ <assertion id="f" testable="false">
<text>In a Java EE 5 environment, the container is not required to support injection for non-contextual objects.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3117 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: decorators/definition and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-21 12:24:01 -0400 (Tue, 21 Jul 2009)
New Revision: 3117
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Acorn.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DefangedTarantula.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
Log:
Added interceptor tests and fixed older tests related to deployment types
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -140,7 +140,16 @@
assert decorators.size() == 0;
}
+ @Test
+ @SpecAssertion(section="11.1.1", id="d")
+ public void testInstanceOfDecoratorForEachEnabled()
+ {
+ assert !getCurrentManager().resolveDecorators(MockLogger.TYPES).isEmpty();
+ assert !getCurrentManager().resolveDecorators(FooBar.TYPES).isEmpty();
+ assert !getCurrentManager().resolveDecorators(Logger.TYPES).isEmpty();
+ assert getCurrentManager().resolveDecorators(Bazt.TYPES).size() == 2;
+ assert !getCurrentManager().resolveDecorators(Field.TYPES).isEmpty();
+ }
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/bean/BeanDefinitionTest.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -156,4 +156,10 @@
assert !getBeans(Tarantula.class).isEmpty();
}
+ @Test
+ @SpecAssertion(section = "11.1", id = "bb")
+ public void testBeanClassOnSimpleBean()
+ {
+ assert getBeans(Spider.class).iterator().next().getBeanClass().equals(Spider.class);
+ }
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Acorn.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Acorn.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/Acorn.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -2,5 +2,8 @@
class Acorn
{
-
+ public Acorn(int size)
+ {
+
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DefangedTarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DefangedTarantula.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/DefangedTarantula.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -2,5 +2,12 @@
class DefangedTarantula extends Tarantula
{
- @Override public int getDeathsCaused() { return 0; }
+ private int deaths;
+
+ public DefangedTarantula(int deaths)
+ {
+ this.deaths = deaths;
+ }
+
+ @Override public int getDeathsCaused() { return deaths; }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -163,8 +163,8 @@
})
public void testScopeType() throws Exception
{
- assert getBeans(DaddyLongLegs.class).size() == 1;
- Bean<DaddyLongLegs> daddyLongLegs = getBeans(DaddyLongLegs.class).iterator().next();
+ assert getBeans(DaddyLongLegs.class, TAME_LITERAL).size() == 1;
+ Bean<DaddyLongLegs> daddyLongLegs = getBeans(DaddyLongLegs.class, TAME_LITERAL).iterator().next();
assert daddyLongLegs.getScopeType().equals(RequestScoped.class);
}
@@ -175,7 +175,7 @@
})
public void testDeploymentType() throws Exception
{
- assert getBeans(LadybirdSpider.class).size() == 1;
+ assert getBeans(LadybirdSpider.class, TAME_LITERAL).size() == 1;
Bean<LadybirdSpider> ladybirdSpider = getBeans(LadybirdSpider.class).iterator().next();
}
@@ -186,8 +186,8 @@
})
public void testNamedMethod() throws Exception
{
- assert getBeans(BlackWidow.class).size() == 1;
- Bean<BlackWidow> blackWidowSpider = getBeans(BlackWidow.class).iterator().next();
+ assert getBeans(BlackWidow.class, TAME_LITERAL).size() == 1;
+ Bean<BlackWidow> blackWidowSpider = getBeans(BlackWidow.class, TAME_LITERAL).iterator().next();
assert blackWidowSpider.getName().equals("blackWidow");
}
@@ -199,8 +199,8 @@
})
public void testDefaultNamedMethod() throws Exception
{
- assert getBeans(DaddyLongLegs.class).size() == 1;
- Bean<DaddyLongLegs> daddyLongLegsSpider = getBeans(DaddyLongLegs.class).iterator().next();
+ assert getBeans(DaddyLongLegs.class, TAME_LITERAL).size() == 1;
+ Bean<DaddyLongLegs> daddyLongLegsSpider = getBeans(DaddyLongLegs.class, TAME_LITERAL).iterator().next();
assert daddyLongLegsSpider.getName().equals("produceDaddyLongLegs");
}
@@ -217,8 +217,8 @@
})
public void testStereotypeSpecifiesScope() throws Exception
{
- assert getBeans(WolfSpider.class).size() == 1;
- Bean<WolfSpider> wolfSpider = getBeans(WolfSpider.class).iterator().next();
+ assert getBeans(WolfSpider.class, TAME_LITERAL).size() == 1;
+ Bean<WolfSpider> wolfSpider = getBeans(WolfSpider.class, TAME_LITERAL).iterator().next();
assert wolfSpider.getScopeType().equals(RequestScoped.class);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderProducer.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/SpiderProducer.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -12,7 +12,7 @@
@Produces @Tame public Tarantula produceTameTarantula()
{
- return new DefangedTarantula();
+ return new DefangedTarantula(0);
}
@Produces @Deadliest public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula,
@@ -22,11 +22,6 @@
tameTarantula : tarantula;
}
- @Produces public Tarantula produceTarantula()
- {
- return new Tarantula();
- }
-
@Produces public Spider getNullSpider()
{
return null;
@@ -52,22 +47,22 @@
return ALL_SPIDERS;
}
- @Produces @Named @RequestScoped public DaddyLongLegs produceDaddyLongLegs()
+ @Produces @Named @RequestScoped @Tame public DaddyLongLegs produceDaddyLongLegs()
{
return new DaddyLongLegs();
}
- @Produces @Named public LadybirdSpider getLadybirdSpider()
+ @Produces @Named @Tame public LadybirdSpider getLadybirdSpider()
{
return new LadybirdSpider();
}
- @Produces @Named("blackWidow") public BlackWidow produceBlackWidow()
+ @Produces @Named("blackWidow") @Tame public BlackWidow produceBlackWidow()
{
return new BlackWidow();
}
- @Produces @AnimalStereotype public WolfSpider produceWolfSpider()
+ @Produces @AnimalStereotype @Tame public WolfSpider produceWolfSpider()
{
return new WolfSpider();
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java (from rev 3094, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/Interceptor1.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/Interceptor1.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+@InterceptorType1
+class Interceptor1
+{
+ @AroundInvoke public Object alwaysReturnThis(InvocationContext ctx) throws Exception
+ {
+ return ctx.proceed();
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -0,0 +1,104 @@
+/*
+ * 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.interceptors.definition;
+
+import java.lang.reflect.Type;
+
+import javax.enterprise.inject.spi.Interceptor;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Tests related to the definition of interceptors, but not necessarily
+ * their execution.
+ *
+ * Spec version: 20090625
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+public class InterceptorDefinitionTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "a")
+ })
+ public void testInterceptorsImplementInterceptorInterface()
+ {
+ boolean interfaceFound = false;
+ for (Type type : getBeans(Interceptor1.class).iterator().next().getTypes())
+ {
+ if (type.equals(Interceptor.class))
+ {
+ interfaceFound = true;
+ break;
+ }
+ }
+ assert interfaceFound;
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "b")
+ })
+ public void testGetInterceptorBindingTypes()
+ {
+ assert false;
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "c")
+ })
+ public void testInterceptsOnInterceptorBean()
+ {
+ assert false;
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "d")
+ })
+ public void testInterceptInvokesInstance()
+ {
+ assert false;
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "e")
+ })
+ public void testInterceptionTypeIdentifiesCallbackOrMethod()
+ {
+ assert false;
+ }
+
+ @Test(groups = "stub")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "f")
+ })
+ public void testInstanceOfInterceptorForEveryEnabledInterceptor()
+ {
+ assert false;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java (from rev 3094, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/InterceptorType1.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorType1.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.interceptors.definition;
+
+import static java.lang.annotation.ElementType.METHOD;
+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.interceptor.Interceptor;
+
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+@Interceptor
+@interface InterceptorType1
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-21 16:17:35 UTC (rev 3116)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-07-21 16:24:01 UTC (rev 3117)
@@ -32,7 +32,7 @@
assert false;
}
- @Test
+ @Test(groups = "ri-broken")
@SpecAssertion(section="5.8", id="c")
public void testQualifiedNameLookup()
{
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3116 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-21 12:17:35 -0400 (Tue, 21 Jul 2009)
New Revision: 3116
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Car.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Government.java
ri/trunk/version-matrix/pom.xml
Log:
Removed validation rules related to deployment types and precedence
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/Validator.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -91,15 +91,11 @@
private void validateRIBean(RIBean<?> bean, BeanManagerImpl beanManager, List<RIBean<?>> specializedBeans)
{
validateBean(bean, beanManager);
- if (!(bean instanceof NewSimpleBean) && !(bean instanceof NewEnterpriseBean))
+ if (!(bean instanceof NewSimpleBean<?>) && !(bean instanceof NewEnterpriseBean<?>))
{
RIBean<?> abstractBean = bean;
if (abstractBean.isSpecializing())
{
- if (!hasHigherPrecedence(bean.getDeploymentType(), abstractBean.getSpecializedBean().getDeploymentType(), beanManager))
- {
- throw new InconsistentSpecializationException("Specializing bean must have a higher precedence deployment type than the specialized bean: " + bean);
- }
if (specializedBeans.contains(abstractBean.getSpecializedBean()))
{
throw new InconsistentSpecializationException("Two beans cannot specialize the same bean: " + bean);
@@ -136,7 +132,7 @@
ParameterizedType parameterizedType = (ParameterizedType) ij.getType();
for (Type type : parameterizedType.getActualTypeArguments())
{
- if (type instanceof TypeVariable)
+ if (type instanceof TypeVariable<?>)
{
throw new DefinitionException("Injection point cannot have a type variable type parameter " + ij);
}
@@ -170,7 +166,7 @@
}
if (Beans.isPassivatingScope(ij.getBean(), beanManager) && (!ij.isTransient()) && !Beans.isPassivationCapableBean(resolvedBean))
{
- if (resolvedBean.getScopeType().equals(Dependent.class) && resolvedBean instanceof AbstractProducerBean)
+ if (resolvedBean.getScopeType().equals(Dependent.class) && resolvedBean instanceof AbstractProducerBean<?,?>)
{
throw new IllegalProductException("The bean " + ij.getBean() + " declares a passivating scope but the producer returned a non-serializable bean for injection: " + resolvedBean);
}
@@ -231,12 +227,6 @@
}
}
- private static boolean hasHigherPrecedence(Class<? extends Annotation> deploymentType, Class<? extends Annotation> otherDeploymentType, BeanManagerImpl manager)
- {
- Comparator<Class<? extends Annotation>> comparator = new ListComparator<Class<? extends Annotation>>(manager.getEnabledDeploymentTypes());
- return comparator.compare(deploymentType, otherDeploymentType) > 0;
- }
-
private static void checkFacadeInjectionPoint(InjectionPoint injectionPoint, Class<?> type)
{
if (injectionPoint.getAnnotated().getBaseType().equals(type))
@@ -244,7 +234,7 @@
if (injectionPoint.getType() instanceof ParameterizedType)
{
ParameterizedType parameterizedType = (ParameterizedType) injectionPoint.getType();
- if (parameterizedType.getActualTypeArguments()[0] instanceof TypeVariable)
+ if (parameterizedType.getActualTypeArguments()[0] instanceof TypeVariable<?>)
{
throw new DefinitionException("An injection point of type " + type + " cannot have a type variable type parameter " + injectionPoint);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -79,6 +79,26 @@
@Override
protected abstract WBMember<T, S> getAnnotatedItem();
+ @Override
+ // Overriden to provide the class of the bean that declares the producer method/field
+ public Class<?> getBeanClass()
+ {
+ return getDeclaringBean().getBeanClass();
+ }
+
+ @Override
+ public String getId()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void destroy(T instance, CreationalContext<T> creationalContext)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
/**
* Gets the deployment types
*
@@ -377,7 +397,7 @@
{
buffer.append("simple producer bean '" + getName() + "'");
}
- buffer.append(" [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getBindings());
+ buffer.append(" [" + getBeanClass().getName() + "] for class type [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getBindings());
return buffer.toString();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -131,8 +131,7 @@
{
buffer.append("simple producer field bean '" + getName() + "'");
}
- buffer.append(" [" + getType().getName() + "] ");
- buffer.append("API types " + getTypes() + ", binding types " + getBindings());
+ buffer.append(" [" + getBeanClass().getName() + "] for class type [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getBindings());
return buffer.toString();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -240,8 +240,7 @@
{
buffer.append("simple producer method bean '" + getName() + "'");
}
- buffer.append(" [" + getType().getName() + "] ");
- buffer.append("API types " + getTypes() + ", binding types " + getBindings());
+ buffer.append(" [" + getBeanClass().getName() + "] for class type [" + getType().getName() + "] API types " + getTypes() + ", binding types " + getBindings());
return buffer.toString();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -31,6 +31,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.DefinitionException;
+import org.jboss.webbeans.bean.AbstractProducerBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.injection.FieldInjectionPoint;
@@ -80,6 +81,10 @@
{
return ((EnterpriseBean<?>) bean).getEjbDescriptor().isStateful();
}
+ else if (bean instanceof AbstractProducerBean<?, ?>)
+ {
+ return Reflections.isSerializable(((AbstractProducerBean<?, ?>) bean).getType());
+ }
else
{
return Reflections.isSerializable(bean.getBeanClass());
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Car.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Car.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Car.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -5,4 +5,6 @@
public class Car implements Serializable
{
+ private static final long serialVersionUID = 1L;
+
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Government.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Government.java 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/Government.java 2009-07-21 16:17:35 UTC (rev 3116)
@@ -8,6 +8,8 @@
public class Government implements Serializable
{
+ private static final long serialVersionUID = 1L;
+
@Important Car governmentCar;
public void destabilize()
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-07-21 15:31:30 UTC (rev 3115)
+++ ri/trunk/version-matrix/pom.xml 2009-07-21 16:17:35 UTC (rev 3116)
@@ -51,7 +51,7 @@
<webbeans.version>1.0.0-SNAPSHOT</webbeans.version>
<webbeans.servlet.version>1.0.0.CR1</webbeans.servlet.version>
<webbeans.se.version>1.0.0.BETA1</webbeans.se.version>
- <jboss.test.harness.version>1.0.0.BETA3</jboss.test.harness.version>
+ <jboss.test.harness.version>1.0.0-SNAPSHOT</jboss.test.harness.version>
</properties>
<dependencyManagement>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3115 - examples/branches.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-07-21 11:31:30 -0400 (Tue, 21 Jul 2009)
New Revision: 3115
Added:
examples/branches/1.0.0.PREVIEW2/
Log:
Branch 1.0.0.PREVIEW2
Copied: examples/branches/1.0.0.PREVIEW2 (from rev 3114, examples/branches/1.0.0.PREVIEW2-PATCH2)
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3114 - ri/branches.
by webbeans-commits@lists.jboss.org
Author: rogerk
Date: 2009-07-21 11:14:52 -0400 (Tue, 21 Jul 2009)
New Revision: 3114
Added:
ri/branches/1.0.0.PREVIEW2/
Log:
1.0.0.PREVIEW2 Branch
Copied: ri/branches/1.0.0.PREVIEW2 (from rev 3113, ri/branches/1.0.0.PREVIEW2-PATCH2)
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3113 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution: broken and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 07:49:46 -0400 (Tue, 21 Jul 2009)
New Revision: 3113
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/CrabSpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Max.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Min.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Number.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/NumberProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/Game.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/NumberProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Dao.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/IntegerHashMap.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/ObjectDao.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Result.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMember_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMember_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FakeFish.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ParameterizedBean_Broken.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DaddyLongLegs.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Farmer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Haddock.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/LadybirdSpider.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Salmon.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ScottishFishFarmer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/SeaBass.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Sole.java
Log:
Typesafe resolution
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMemberLiteral_Broken.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-abstract class BindingTypeWithBindingAnnotationMemberLiteral_Broken extends AnnotationLiteral<BindingTypeWithBindingAnnotationMember_Broken> implements BindingTypeWithBindingAnnotationMember_Broken
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMember_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMember_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingAnnotationMember_Broken.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,24 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-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.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface BindingTypeWithBindingAnnotationMember_Broken
-{
-
- Expensive expensive();
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMemberLiteral_Broken.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-abstract class BindingTypeWithBindingArrayTypeMemberLiteral_Broken extends AnnotationLiteral<BindingTypeWithBindingArrayTypeMember_Broken> implements BindingTypeWithBindingArrayTypeMember_Broken
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMember_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMember_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/BindingTypeWithBindingArrayTypeMember_Broken.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,24 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-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.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface BindingTypeWithBindingArrayTypeMember_Broken
-{
-
- boolean[] bool();
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cod.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Cod.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Whitefish
@Chunky(realChunky=true)
@Named("whitefish")
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/CrabSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/CrabSpider.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/CrabSpider.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+
+import javax.enterprise.inject.Named;
+import javax.enterprise.inject.Policy;
+
+@Policy
+@Named
+public class CrabSpider extends Spider
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DaddyLongLegs.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DaddyLongLegs.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/DaddyLongLegs.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,5 +1,8 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
+import javax.enterprise.inject.Policy;
+
+@Policy
class DaddyLongLegs extends Spider
{
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FakeFish.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FakeFish.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/FakeFish.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-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.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface FakeFish
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Farmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Farmer.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Farmer.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,8 +1,5 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-import javax.enterprise.inject.deployment.Production;
-
-@Production
class Farmer<T>
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Haddock.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Haddock.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Haddock.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Named
@FishILike
class Haddock implements Animal
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/LadybirdSpider.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/LadybirdSpider.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/LadybirdSpider.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.RequestScoped;
-@ApplicationScoped
+@RequestScoped
class LadybirdSpider extends Spider
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Max.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Max.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Max.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,34 @@
+/*
+ * 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.lookup.typesafe.resolution;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Max {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Min.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Min.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Min.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,35 @@
+/*
+ * 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.lookup.typesafe.resolution;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Min {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Number.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Number.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Number.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,34 @@
+/*
+ * 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.lookup.typesafe.resolution;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Number {
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/NumberProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/NumberProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/NumberProducer.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,34 @@
+/*
+ * 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.lookup.typesafe.resolution;
+
+import javax.enterprise.inject.Produces;
+
+class NumberProducer
+{
+
+ @Produces @Min @Number
+ public static final double min = 0;
+
+ public static final Double max = Double.valueOf(10.5);
+
+ @Produces @Max @Number
+ public static Double getMax() {
+ return max;
+ }
+
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ParameterizedBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ParameterizedBean_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ParameterizedBean_Broken.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-
-class ParameterizedBean_Broken<T>
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,6 +1,24 @@
+/*
+ * 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.lookup.typesafe.resolution;
+import java.lang.reflect.Type;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -13,23 +31,19 @@
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.literals.CurrentLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
import org.testng.annotations.Test;
/**
*
* Spec version: 20090625
- *
+ *
*/
@Artifact
-@BeansXml("beans.xml")
public class ResolutionByTypeTest extends AbstractJSR299Test
{
- @Test(groups="resolution")
- @SpecAssertions({
- @SpecAssertion(section="5.3", id = "review") // removed from spec?
- })
+ @Test(groups = "resolution")
+ @SpecAssertion(section = "5.3", id = "l")
public void testDefaultBindingTypeAssumed() throws Exception
{
Set<Bean<Tuna>> possibleTargets = getBeans(Tuna.class);
@@ -37,24 +51,8 @@
assert possibleTargets.iterator().next().getTypes().contains(Tuna.class);
}
- @Test(groups = { "resolution", "rewrite" }, expectedExceptions = IllegalArgumentException.class)
- // This assertion comes back later
- public <T> void testParameterizedTypeWithTypeParameter()
- {
- getBeans(new TypeLiteral<ParameterizedBean_Broken<T>>(){});
- }
-
- @Test(groups = { "resolution", "rewrite" }, expectedExceptions=IllegalArgumentException.class)
- @SpecAssertion(section="5.3", id = "review") // removed from spec?
- public void testDuplicateBindingTypesUsed()
- {
- getBeans(Tuna.class, new CurrentLiteral(), new CurrentLiteral());
- }
-
- @Test(groups="resolution")
- @SpecAssertions({
- @SpecAssertion(section = "5.3", id ="review") // removed from spec?
- })
+ @Test(groups = "resolution")
+ @SpecAssertion(section = "unknown", id = "unknown")
public void testResolveByType() throws Exception
{
@@ -62,7 +60,9 @@
assert getBeans(Tuna.class).size() == 1;
- Set<Bean<Animal>> beans = getBeans(Animal.class, new AnnotationLiteral<FishILike>() {});
+ Set<Bean<Animal>> beans = getBeans(Animal.class, new AnnotationLiteral<FishILike>()
+ {
+ });
assert beans.size() == 3;
List<Class<? extends Animal>> classes = new ArrayList<Class<? extends Animal>>();
for (Bean<Animal> bean : beans)
@@ -85,22 +85,30 @@
assert classes.contains(Haddock.class);
}
- @Test(groups="injection")
- @SpecAssertions({
- @SpecAssertion(section = "2.3.4", id = "b" ),
- @SpecAssertion(section = "5.3", id = "l"),
- @SpecAssertion(section = "2.3.3", id = "d" ),
- @SpecAssertion(section = "5.3.6", id = "a" )
- })
- public void testAllBindingTypesSpecifiedForResolutionMustAppearOnWebBean()
+ @Test(groups = "injection")
+ @SpecAssertions( {
+ @SpecAssertion(section = "2.3.4", id = "b"),
+ @SpecAssertion(section = "5.3", id = "l"),
+ @SpecAssertion(section = "2.3.3", id = "d"),
+ @SpecAssertion(section = "5.3.6", id = "a"),
+ @SpecAssertion(section = "5.3.6", id = "d") })
+ public void testAllBindingTypesSpecifiedForResolutionMustAppearOnBean()
{
- assert getBeans(Animal.class, new ChunkyLiteral(), new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert getBeans(Animal.class, new ChunkyLiteral(), new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Cod.class);
+ assert getBeans(Animal.class, new ChunkyLiteral(), new AnnotationLiteral<Whitefish>()
+ {
+ }).size() == 1;
+ assert getBeans(Animal.class, new ChunkyLiteral(), new AnnotationLiteral<Whitefish>()
+ {
+ }).iterator().next().getTypes().contains(Cod.class);
- assert getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}).size() == 2;
+ assert getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>()
+ {
+ }).size() == 2;
List<Class<? extends Animal>> classes = new ArrayList<Class<? extends Animal>>();
- for (Bean<ScottishFish> bean : getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>() {}))
+ for (Bean<ScottishFish> bean : getBeans(ScottishFish.class, new AnnotationLiteral<Whitefish>()
{
+ }))
+ {
if (bean.getTypes().contains(Cod.class))
{
classes.add(Cod.class);
@@ -114,49 +122,61 @@
assert classes.contains(Sole.class);
}
- @Test(groups="resolution")
- @SpecAssertions({
- @SpecAssertion(section="2.2", id="review"),
- @SpecAssertion(section="2.2", id="review") // what is this testing?
- })
+ @Test(groups = { "resolution" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.3", id = "k"),
+ @SpecAssertion(section = "2.2", id = "review"),
+ @SpecAssertion(section = "2.2", id = "review") })
public void testResolveByTypeWithTypeParameter() throws Exception
{
assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).size() == 1;
- assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}).iterator().next().getTypes().contains(ScottishFishFarmer.class);
+ assert getBeans(new TypeLiteral<Farmer<ScottishFish>>(){}
+ ).iterator().next().getTypes().contains(ScottishFishFarmer.class);
}
- @Test(groups={"resolution", "producerMethod"})
- @SpecAssertion(section="2.2.1", id = "i")
+ @Test(groups = { "resolution", "producerMethod" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.3", id = "j"),
+ @SpecAssertion(section="2.2.1", id = "i") } )
public void testResolveByTypeWithArray() throws Exception
{
assert getBeans(Spider[].class).size() == 1;
}
- @Test @SpecAssertion(section="5.3", id = "review") // deployment types removed
- public void testOnlyHighestEnabledPrecedenceWebBeansResolved() throws Exception
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.3", id = "i"),
+ @SpecAssertion(section = "5.3.4", id = "aa"),
+ @SpecAssertion(section = "5.3.4", id = "ab")})
+ public void testResolveByTypeWithPrimitives() throws Exception
{
- assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
- assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Plaice.class);
- }
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ assert getBeans(Double.class).size() == 2;
+ assert getBeans(double.class).size() == 2;
+ Double min = getInstanceByType(Double.class, new AnnotationLiteral<Min>(){});
+ double max = getInstanceByType(double.class, new AnnotationLiteral<Max>(){});
- @Test(groups="resolution")
- @SpecAssertion(section="5.3", id = "review") // deployment types removed
- public void testNoWebBeansFound() throws Exception
- {
- assert getBeans(Tuna.class, new AnnotationLiteral<FakeFish>() {}).size() == 0;
+ assert min.equals(NumberProducer.min);
+ assert NumberProducer.max.equals(max);
+ }
+ }.run();
}
- @Test(groups="resolution")
- @SpecAssertions({
- @SpecAssertion(section="5.3", id = "l")
+ @Test(groups = "resolution")
+ @SpecAssertions( {
+ @SpecAssertion(section = "5.3", id = "l"),
+ @SpecAssertion(section = "5.3.5", id = "b")
})
public void testResolveByTypeWithNonBindingMembers() throws Exception
{
Set<Bean<Animal>> beans = getBeans(Animal.class, new ExpensiveLiteral()
{
-
public int cost()
{
return 60;
@@ -167,7 +187,7 @@
return true;
}
- }, new AnnotationLiteral<Whitefish>() {});
+ }, new AnnotationLiteral<Whitefish>(){});
assert beans.size() == 2;
List<Class<? extends Animal>> classes = new ArrayList<Class<? extends Animal>>();
@@ -186,64 +206,25 @@
assert classes.contains(RoundWhitefish.class);
}
- @Test(groups={"resolution", "broken"})
- @SpecAssertion(section="5.3.5", id = "ca")
- public void testArrayValuedAnnotationMemberWithoutNonBinding()
+ @Test(groups = { "ri-broken", "policy"})
+ @SpecAssertion(section = "5.2", id = "a")
+ public void testPolicyNotAvailableInNonDeploymentArchive() throws Exception
{
- Throwable t = null;
- try
+ new RunInDependentContext()
{
- getBeans(Animal.class, new BindingTypeWithBindingArrayTypeMemberLiteral_Broken()
+ @Override
+ protected void execute() throws Exception
{
-
- public boolean[] bool()
- {
- return new boolean[0];
+ Set<Bean<Spider>> spiders = getBeans(Spider.class, new CurrentLiteral());
+ Set<Type> types = new HashSet<Type>();
+ for (Bean<Spider> spider : spiders) {
+ types.addAll(spider.getTypes());
}
-
- });
- }
- catch (Throwable throwable)
- {
- t = throwable;
- }
-
- //assert getCurrentConfiguration().getManagers().isDefinitionError(t);
+ assert !types.contains(CrabSpider.class);
+ assert !types.contains(DaddyLongLegs.class);
+
+ assert getCurrentManager().getBeans("crabSpider").size() == 0;
+ }
+ }.run();
}
-
- @Test(groups={"resolution", "broken"})//, expectedExceptions=DefinitionException.class)
- @SpecAssertion(section="5.3.5", id = "cb")
- public void testAnnotationValuedAnnotationMemberWithoutNonBinding()
- {
- Throwable t = null;
- try
- {
- getBeans(Animal.class, new BindingTypeWithBindingAnnotationMemberLiteral_Broken()
- {
- public Expensive expensive()
- {
- return new ExpensiveLiteral()
- {
- public int cost()
- {
- return 0;
- }
-
- public boolean veryExpensive()
- {
- return false;
- }
- };
- }
-
- });
- }
- catch (Throwable throwable)
- {
- t = throwable;
- }
-
- //assert getCurrentConfiguration().getManagers().isDefinitionError(t);
- }
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Salmon.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Salmon.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Salmon.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Named
@FishILike
class Salmon implements ScottishFish
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ScottishFishFarmer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ScottishFishFarmer.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ScottishFishFarmer.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,8 +1,5 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
-import javax.enterprise.inject.deployment.Production;
-
-@Production
class ScottishFishFarmer extends Farmer<ScottishFish>
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/SeaBass.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/SeaBass.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/SeaBass.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.deployment.Production;
-@Production
@RequestScoped
@FishILike
class SeaBass implements Animal
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Sole.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Sole.java 2009-07-21 11:39:17 UTC (rev 3112)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/Sole.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -1,9 +1,7 @@
package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution;
import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Production;
-@Production
@Whitefish
@Named("whitefish")
class Sole implements ScottishFish
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/Game.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/Game.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/Game.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,25 @@
+/*
+ * 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.lookup.typesafe.resolution.broken.primitive;
+
+import javax.enterprise.inject.Current;
+
+@SuppressWarnings("unused")
+class Game
+{
+ @Current private int number;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/NumberProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/NumberProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/NumberProducer.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,28 @@
+/*
+ * 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.lookup.typesafe.resolution.broken.primitive;
+
+import javax.enterprise.inject.Produces;
+
+class NumberProducer
+{
+ @Produces
+ public Integer getNumber()
+ {
+ return null;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/primitive/PrimitiveInjectionPointTest.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -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.jsr299.tck.tests.lookup.typesafe.resolution.broken.primitive;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class PrimitiveInjectionPointTest
+{
+ @Test(groups={"resolution, producerMethod", "ri-broken"})
+ @SpecAssertion(section="5.3.4", id="aa")
+ public void testPrimitiveInjectionPointResolvedToNonPrimitiveProducerMethod() {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/AssignabilityOfRawAndParameterizedTypesTest.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,87 @@
+/*
+ * 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.lookup.typesafe.resolution.parameterized;
+
+import java.util.HashMap;
+
+import javax.enterprise.inject.TypeLiteral;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Spec version: 2009625
+ */
+@Artifact
+public class AssignabilityOfRawAndParameterizedTypesTest extends AbstractJSR299Test
+{
+
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertion(section = "5.3.3", id = "a")
+ public void testAssignabilityToRawType()
+ {
+ assert getBeans(Dao.class).size() == 2; // Dao and ObjectDao
+ }
+
+ @Test(groups="resolution")
+ @SpecAssertion(section = "5.3.3", id = "b")
+ public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithActualTypes()
+ {
+ assert getBeans(new TypeLiteral<HashMap<Integer, Integer>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<HashMap<Integer, Integer>>(){}
+ ).iterator().next().getTypes().contains(IntegerHashMap.class);
+ }
+
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertion(section = "5.3.3", id = "c")
+ public void testAssignabilityOfParameterizedTypeWithActualTypesToParameterizedTypeWithWildcards()
+ {
+ assert getBeans(new TypeLiteral<HashMap<? extends Number, ? super Integer>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<HashMap<? extends Number, ? super Integer>>(){}
+ ).iterator().next().getTypes().contains(IntegerHashMap.class);
+ }
+
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertion(section = "5.3.3", id = "d")
+ public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeWithWildcards()
+ {
+ assert getBeans(new TypeLiteral<Result<? extends Throwable, ? super Exception>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<Result<? extends Throwable, ? super Exception>>(){}
+ ).iterator().next().getTypes().contains(Result.class);
+ }
+
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertion(section = "5.3.3", id = "e")
+ public void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeWithActualTypes()
+ {
+ assert getBeans(new TypeLiteral<Result<Exception, Exception>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<Result<Exception, Exception>>(){}
+ ).iterator().next().getTypes().contains(Result.class);
+ }
+
+ @Test(groups = { "resolution", "ri-broken" })
+ @SpecAssertion(section = "5.3.3", id = "f")
+ public <T1 extends Exception, T2 extends Exception> void testAssignabilityOfParameterizedTypeWithTypeVariablesToParameterizedTypeTypeVariable()
+ {
+ assert getBeans(new TypeLiteral<Result<T1, T2>>(){}).size() == 1;
+ assert getBeans(new TypeLiteral<Result<Exception, Exception>>(){}
+ ).iterator().next().getTypes().contains(Result.class);
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Dao.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Dao.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Dao.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,20 @@
+/*
+ * 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.lookup.typesafe.resolution.parameterized;
+
+class Dao<T1, T2> {
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/IntegerHashMap.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/IntegerHashMap.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/IntegerHashMap.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,24 @@
+/*
+ * 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.lookup.typesafe.resolution.parameterized;
+
+import java.util.HashMap;
+
+class IntegerHashMap extends HashMap<Integer, Integer>{
+
+ private static final long serialVersionUID = 1L;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/ObjectDao.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/ObjectDao.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/ObjectDao.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,20 @@
+/*
+ * 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.lookup.typesafe.resolution.parameterized;
+
+class ObjectDao extends Dao<Object, Object>{
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Result.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Result.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/parameterized/Result.java 2009-07-21 11:49:46 UTC (rev 3113)
@@ -0,0 +1,20 @@
+/*
+ * 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.lookup.typesafe.resolution.parameterized;
+
+public class Result<T1 extends Exception, T2 extends Exception> {
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3112 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution: broken and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 07:39:17 -0400 (Tue, 21 Jul 2009)
New Revision: 3112
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/AmbiguousDependencyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Sheep.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Small.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/UnsatisfiedDependencyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Vanilla.java
Log:
Unsatisfied and ambiguous dependencies
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/AmbiguousDependencyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/AmbiguousDependencyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/AmbiguousDependencyTest.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,42 @@
+/*
+ * 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.lookup.dependency.resolution.broken.ambiguous;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class AmbiguousDependencyTest extends AbstractJSR299Test
+{
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section="5.3.1", id="aa")
+ public void testAmbiguousDependency() {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Animal.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,22 @@
+/*
+ * 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.lookup.dependency.resolution.broken.ambiguous;
+
+interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Cow.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,22 @@
+/*
+ * 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.lookup.dependency.resolution.broken.ambiguous;
+
+class Cow implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Farm_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,25 @@
+/*
+ * 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.lookup.dependency.resolution.broken.ambiguous;
+
+import javax.enterprise.inject.Current;
+
+@SuppressWarnings("unused")
+class Farm_Broken
+{
+ @Current private Animal animal;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Sheep.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Sheep.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/ambiguous/Sheep.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,22 @@
+/*
+ * 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.lookup.dependency.resolution.broken.ambiguous;
+
+class Sheep implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Bean_Broken.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,28 @@
+/*
+ * 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.lookup.dependency.resolution.broken.unsatisfied;
+
+import javax.enterprise.inject.Current;
+
+@SuppressWarnings("unused")
+class Bean_Broken
+{
+
+ @Small
+ private Vanilla vanilla;
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Small.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Small.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Small.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,36 @@
+/*
+ * 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.lookup.dependency.resolution.broken.unsatisfied;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@BindingType
+@interface Small
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/UnsatisfiedDependencyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/UnsatisfiedDependencyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/UnsatisfiedDependencyTest.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,42 @@
+/*
+ * 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.lookup.dependency.resolution.broken.unsatisfied;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090625
+ *
+ */
+@Artifact
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class UnsatisfiedDependencyTest extends AbstractJSR299Test
+{
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section="5.3.1", id="aa")
+ public void testUnsatisfiedDependency() {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Vanilla.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Vanilla.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/broken/unsatisfied/Vanilla.java 2009-07-21 11:39:17 UTC (rev 3112)
@@ -0,0 +1,23 @@
+/*
+ * 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.lookup.dependency.resolution.broken.unsatisfied;
+
+
+class Vanilla
+{
+
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3111 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: producer/method/definition and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 07:32:00 -0400 (Tue, 21 Jul 2009)
New Revision: 3111
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/BeanWithStaticProducerMethod.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
Log:
Added @SpecAssertions to tests that verify invocation of static producer and disposal methods
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-21 11:22:46 UTC (rev 3110)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-21 11:32:00 UTC (rev 3111)
@@ -30,7 +30,8 @@
@SpecAssertion(section = "3.3.5", id = "e"),
@SpecAssertion(section = "3.3.6", id = "ba"),
@SpecAssertion(section = "3.3.7", id = "a"),
- @SpecAssertion(section = "3.3.9", id = "aa")
+ @SpecAssertion(section = "3.3.9", id = "aa"),
+ @SpecAssertion(section = "5.6.6", id = "b")
})
public void testBindingTypesAppliedToDisposalMethodParameters() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/BeanWithStaticProducerMethod.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/BeanWithStaticProducerMethod.java 2009-07-21 11:22:46 UTC (rev 3110)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/BeanWithStaticProducerMethod.java 2009-07-21 11:32:00 UTC (rev 3111)
@@ -2,9 +2,7 @@
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.deployment.Production;
-@Production
class BeanWithStaticProducerMethod
{
static boolean stringDestroyed;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-21 11:22:46 UTC (rev 3110)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-07-21 11:32:00 UTC (rev 3111)
@@ -34,7 +34,8 @@
@Test(groups = "producerMethod")
@SpecAssertions( {
@SpecAssertion(section = "3.3", id = "b"),
- @SpecAssertion(section = "7.3.4", id = "a")
+ @SpecAssertion(section = "7.3.4", id = "a"),
+ @SpecAssertion(section = "5.6.6", id = "a")
} )
public void testStaticMethod() throws Exception
{
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3110 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup: binding and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-21 07:22:46 -0400 (Tue, 21 Jul 2009)
New Revision: 3110
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/SimpleAnnotation.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java
Log:
Binding annotations with members
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/BindingAnnotationWithMemberTest.java 2009-07-21 11:22:46 UTC (rev 3110)
@@ -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.jsr299.tck.tests.lookup.binding.members.annotation;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 2009625
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class BindingAnnotationWithMemberTest {
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="5.3.5", id="cb")
+ public void testAnnotationMemberWithoutNonBinding() {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/Expensive_Broken.java 2009-07-21 11:22:46 UTC (rev 3110)
@@ -0,0 +1,35 @@
+/*
+ * 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.lookup.binding.members.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@BindingType
+@Retention(RUNTIME)
+@Target( { METHOD, FIELD, PARAMETER, TYPE })
+@interface Expensive_Broken {
+ SimpleAnnotation member();
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/SimpleAnnotation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/SimpleAnnotation.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/annotation/SimpleAnnotation.java 2009-07-21 11:22:46 UTC (rev 3110)
@@ -0,0 +1,27 @@
+/*
+ * 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.lookup.binding.members.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+@Target(TYPE)
+@interface SimpleAnnotation {}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/BindingAnnotationWithMemberTest.java 2009-07-21 11:22:46 UTC (rev 3110)
@@ -0,0 +1,38 @@
+/*
+ * 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.lookup.binding.members.array;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 2009625
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class BindingAnnotationWithMemberTest {
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="5.3.5", id="ca")
+ public void testArrayMemberWithoutNonBinding() {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/binding/members/array/Expensive_Broken.java 2009-07-21 11:22:46 UTC (rev 3110)
@@ -0,0 +1,35 @@
+/*
+ * 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.lookup.binding.members.array;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@BindingType
+@Retention(RUNTIME)
+@Target( { METHOD, FIELD, PARAMETER, TYPE })
+@interface Expensive_Broken {
+ String[] prices();
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3109 - examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess.
by webbeans-commits@lists.jboss.org
Author: peteroyle
Date: 2009-07-21 05:43:36 -0400 (Tue, 21 Jul 2009)
New Revision: 3109
Modified:
examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/MessageGenerator.java
Log:
typo
Modified: examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/MessageGenerator.java
===================================================================
--- examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/MessageGenerator.java 2009-07-21 09:24:53 UTC (rev 3108)
+++ examples/trunk/se/numberguess/src/main/java/org/jboss/webbeans/environment/se/example/numberguess/MessageGenerator.java 2009-07-21 09:43:36 UTC (rev 3109)
@@ -42,7 +42,7 @@
{
if ( game.isGameWon() )
{
- return "You guess it! The number was " + game.getNumber();
+ return "You guessed it! The number was " + game.getNumber();
} else if ( game.isGameLost() )
{
return "You are fail! The number was " + game.getNumber();
15 years, 4 months