[webbeans-commits] Webbeans SVN: r3128 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/decorators/definition/broken and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-22 08:49:54 -0400 (Wed, 22 Jul 2009)
New Revision: 3128
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken1/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken3/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken4/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken5/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/tooManyDecoratorsElements/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/enabledDecoratorIsNotDecorator/EnabledDecoratorNotADecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Remove stub tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/enabledDecoratorIsNotDecorator/EnabledDecoratorNotADecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/enabledDecoratorIsNotDecorator/EnabledDecoratorNotADecoratorTest.java 2009-07-22 12:47:59 UTC (rev 3127)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/enabledDecoratorIsNotDecorator/EnabledDecoratorNotADecoratorTest.java 2009-07-22 12:49:54 UTC (rev 3128)
@@ -36,7 +36,7 @@
{
@Test
- @SpecAssertion(section="8.2", id="review") // This assertion doesn't seem to be in the latest version of the spec
+ @SpecAssertion(section="8.2", id="bb")
public void testEnabledDecoratorNotADecoratorTest()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java 2009-07-22 12:47:59 UTC (rev 3127)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/broken/addDefinitionError/AddDefinitionErrorTest.java 2009-07-22 12:49:54 UTC (rev 3128)
@@ -5,7 +5,6 @@
import org.jboss.jsr299.tck.DefinitionError;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
import org.testng.annotations.Test;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 12:47:59 UTC (rev 3127)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 12:49:54 UTC (rev 3128)
@@ -2568,8 +2568,28 @@
</assertion>
<assertion id="aac">
- <text>If a managed bean which declares a passivating scope has an interceptor or decorator with a non-transient injected field, bean constructor parameter or initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <text>If a managed bean which declares a passivating scope has an interceptor ~or decorator~ with a non-transient injected field~, bean constructor parameter or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
+
+ <assertion id="aad">
+ <text>If a managed bean which declares a passivating scope has an interceptor ~or decorator~ with a non-transient ~injected field,~ bean constructor parameter ~or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="aae">
+ <text>If a managed bean which declares a passivating scope has an interceptor ~or decorator~ with a non-transient ~injected field, bean constructor parameter or~ initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="aaf">
+ <text>If a managed bean which declares a passivating scope has an ~interceptor or~ decorator with a non-transient injected field~, bean constructor parameter or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="aag">
+ <text>If a managed bean which declares a passivating scope has an ~interceptor or~ decorator with a non-transient ~injected field,~ bean constructor parameter ~or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="aah">
+ <text>If a managed bean which declares a passivating scope has an ~interceptor or~ decorator with a non-transient ~injected field, bean constructor parameter or~ initializer method parameter that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
<assertion id="ba">
<text>If a stateful session bean has a non-transient injected field~, bean constructor parameter or initializer method parameter~ that does not resolve to a passivation capable dependency, then the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
@@ -3192,8 +3212,12 @@
<text>The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.</text>
</assertion>
+ <assertion id="ba">
+ <text>Each child |<class>| element must specify the name of a decorator bean class. If there is no class with the specified name~, or if the class with the specified name is not a decorator bean class,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
<assertion id="bb">
- <text>Each child |<class>| element must specify the name of a decorator bean class. If there is no class with the specified name, or if the class with the specified name is not a decorator bean class, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ <text>Each child |<class>| element must specify the name of a decorator bean class. If ~there is no class with the specified name, or if~ the class with the specified name is not a decorator bean class~,~ the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
<assertion id="bc">
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3127 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: implementation/simple/lifecycle and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-22 08:47:59 -0400 (Wed, 22 Jul 2009)
New Revision: 3127
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
Log:
Recognized tests matching Chapter 5 assertions
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-22 10:37:56 UTC (rev 3126)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/InitializerMethodTest.java 2009-07-22 12:47:59 UTC (rev 3127)
@@ -39,9 +39,9 @@
@Test(groups = { "initializerMethod" })
@SpecAssertions({
@SpecAssertion(section = "3.8", id = "g"),
- @SpecAssertion(section = "5.5", id = "b"),
@SpecAssertion(section = "3.8.1", id = "a"),
- @SpecAssertion(section = "3.8.2", id = "aa")
+ @SpecAssertion(section = "3.8.2", id = "aa"),
+ @SpecAssertion(section = "5.6.4", id = "b")
})
public void testMultipleInitializerMethodsAreCalled()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 10:37:56 UTC (rev 3126)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 12:47:59 UTC (rev 3127)
@@ -35,7 +35,8 @@
@SpecAssertions({
@SpecAssertion(section = "3.1.4.2", id = "b"),
@SpecAssertion(section = "3.1.4.2", id = "c"),
- @SpecAssertion(section = "2.3.5", id = "d")
+ @SpecAssertion(section = "2.3.5", id = "d"),
+ @SpecAssertion(section = "5.6.3", id = "a")
})
public void testInjectionOfParametersIntoBeanConstructor()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-07-22 10:37:56 UTC (rev 3126)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/clientProxy/ClientProxyTest.java 2009-07-22 12:47:59 UTC (rev 3127)
@@ -43,23 +43,6 @@
}
@Test
- @SpecAssertion(section = "5.5", id = "a")
- public void testClientProxyNotUsedForPseudoScope() throws Exception
- {
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<Fox> foxBean = getBeans(Fox.class).iterator().next();
- Fox fox = (Fox) getCurrentManager().getReference(foxBean,Fox.class, getCurrentManager().createCreationalContext(foxBean));
- assert !getCurrentConfiguration().getBeans().isProxy(fox);
- }
-
- }.run();
- }
-
- @Test
@SpecAssertion(section = "unknown", id = "unknown")
public void testSimpleBeanClientProxyIsSerializable() throws IOException, ClassNotFoundException
{
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3126 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-22 06:37:56 -0400 (Wed, 22 Jul 2009)
New Revision: 3126
Removed:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
Log:
Minor
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 08:59:04 UTC (rev 3125)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-07-22 10:37:56 UTC (rev 3126)
@@ -314,4 +314,10 @@
}
}.run();
}
+
+ @Test(groups = { "ri-broken", "resolution" })
+ @SpecAssertion(section = "5.3", id = "h")
+ public void testDecoratorNotResolved() {
+ assert getInstanceByType(Cat.class) != null;
+ }
}
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-22 08:59:04 UTC (rev 3125)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-07-22 10:37:56 UTC (rev 3126)
@@ -147,26 +147,20 @@
@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
+ @SpecAssertion(section = "5.3.4", id = "ab"),
+ @SpecAssertion(section = "5.3.6", id = "b"),
+ @SpecAssertion(section = "5.3.6", id = "c") })
+ public void testResolveByTypeWithPrimitives()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(Double.class).size() == 2;
- assert getBeans(double.class).size() == 2;
+ 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>(){});
+ Double min = getInstanceByType(Double.class, new AnnotationLiteral<Min>(){});
+ double max = getInstanceByType(double.class, new AnnotationLiteral<Max>(){});
- assert min.equals(NumberProducer.min);
- assert NumberProducer.max.equals(max);
- }
- }.run();
+ assert min.equals(NumberProducer.min);
+ assert NumberProducer.max.equals(max);
}
-
@Test(groups = "resolution")
@SpecAssertions( {
@SpecAssertion(section = "5.3", id = "l"),
@@ -206,25 +200,19 @@
assert classes.contains(RoundWhitefish.class);
}
- @Test(groups = { "ri-broken", "policy"})
+ @Test(groups = { "ri-broken", "policy" })
@SpecAssertion(section = "5.2", id = "a")
public void testPolicyNotAvailableInNonDeploymentArchive() throws Exception
{
- new RunInDependentContext()
+ Set<Bean<Spider>> spiders = getBeans(Spider.class, new CurrentLiteral());
+ Set<Type> types = new HashSet<Type>();
+ for (Bean<Spider> spider : spiders)
{
- @Override
- protected void execute() throws Exception
- {
- Set<Bean<Spider>> spiders = getBeans(Spider.class, new CurrentLiteral());
- Set<Type> types = new HashSet<Type>();
- for (Bean<Spider> spider : spiders) {
- types.addAll(spider.getTypes());
- }
- assert !types.contains(CrabSpider.class);
- assert !types.contains(DaddyLongLegs.class);
-
- assert getCurrentManager().getBeans("crabSpider").size() == 0;
- }
- }.run();
+ types.addAll(spider.getTypes());
+ }
+ assert !types.contains(CrabSpider.class);
+ assert !types.contains(DaddyLongLegs.class);
+
+ assert getCurrentManager().getBeans("crabSpider").size() == 0;
}
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3125 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup: circular and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: jharting
Date: 2009-07-22 04:59:04 -0400 (Wed, 22 Jul 2009)
New Revision: 3125
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Air.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Bird.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Car.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/DependentSelfConsumingNormalProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/House.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingDependentProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingNormalProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Petrol.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Planet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingDependent1.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal1.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Space.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Violation.java
Log:
Made a copy of circular dependency tests from webbeans tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Air.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Air.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Air.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Initializer;
+
+@ApplicationScoped
+class Air
+{
+
+ public Air()
+ {
+
+ }
+
+ @Initializer
+ public Air(Bird bird)
+ {
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Bird.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Bird.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Bird.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Initializer;
+
+@ApplicationScoped
+@SuppressWarnings("unused")
+class Bird
+{
+
+ private Air air;
+
+ public Bird()
+ {
+
+ }
+
+ @Initializer
+ public Bird(Air air)
+ {
+ this.air = air;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Car.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Car.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Car.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,32 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.inject.Current;
+
+class Car
+{
+
+ public static boolean success;
+
+ @Current Petrol petrol;
+
+ public Car()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (petrol.getName().equals("petrol"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "herbie";
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,110 @@
+/*
+ * 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.circular;
+
+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: 20090625
+ *
+ */
+@Artifact
+public class CircularDependencyTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testCircularInjectionOnTwoNormalBeans() throws Exception
+ {
+ getInstanceByType(Pig.class).getName();
+ assert Pig.success;
+ assert Food.success;
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testCircularInjectionOnOneNormalAndOneDependentBean() throws Exception
+ {
+
+ getInstanceByType(Car.class).getName();
+ assert Petrol.success;
+ assert Car.success;
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testCircularInjectionOnOneDependentAndOneNormalBean() throws Exception
+ {
+ getInstanceByType(Petrol.class).getName();
+ assert Petrol.success;
+ assert Car.success;
+ }
+
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testNormalProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean() throws Exception
+ {
+ getInstanceByType(NormalSelfConsumingNormalProducer.class).ping();
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testNormalProducerMethodDeclaredOnDependentBeanWhichInjectsProducedBean() throws Exception
+ {
+ getInstanceByType(DependentSelfConsumingNormalProducer.class).ping();
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testDependentProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean() throws Exception
+ {
+ getInstanceByType(NormalSelfConsumingDependentProducer.class).ping();
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testNormalSelfConsumingProducer() throws Exception
+ {
+ getInstanceByType(Violation.class).ping();
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testNormalCircularConstructors() throws Exception
+ {
+ assert getInstanceByType(Bird.class) != null;
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testNormalAndDependentCircularConstructors() throws Exception
+ {
+ assert getInstanceByType(Planet.class) != null;
+ }
+
+ @Test
+ @SpecAssertion(section="5", id="b")
+ public void testSelfConsumingConstructorsOnNormalBean() throws Exception
+ {
+ assert getInstanceByType(House.class) != null;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/DependentSelfConsumingNormalProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/DependentSelfConsumingNormalProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/DependentSelfConsumingNormalProducer.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+class DependentSelfConsumingNormalProducer
+{
+ @SelfConsumingNormal1 Violation violation;
+
+ @Produces @ApplicationScoped @SelfConsumingNormal1
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Current;
+
+@ApplicationScoped
+class Food
+{
+
+ public static boolean success;
+
+ @Current Pig pig;
+
+ public Food()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (pig.getName().equals("john"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "food";
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/House.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/House.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/House.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Initializer;
+
+@ApplicationScoped
+class House
+{
+
+ // For serialization
+ public House() {}
+
+ @Initializer
+ public House(House house)
+ {
+ house.ping();
+ }
+
+ private void ping()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingDependentProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingDependentProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingDependentProducer.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+@ApplicationScoped
+class NormalSelfConsumingDependentProducer
+{
+ @SelfConsumingDependent1 Violation violation;
+
+ @Produces @SelfConsumingDependent1
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingNormalProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingNormalProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/NormalSelfConsumingNormalProducer.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+
+@ApplicationScoped
+class NormalSelfConsumingNormalProducer
+{
+ @SelfConsumingNormal Violation violation;
+
+ @Produces @ApplicationScoped @SelfConsumingNormal
+ public Violation produceViolation() {
+ return new Violation();
+ }
+
+ public void ping() {
+
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Petrol.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Petrol.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Petrol.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Current;
+
+@ApplicationScoped
+class Petrol
+{
+
+ public static boolean success;
+
+ @Current Car car;
+
+ public Petrol()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (car.getName().equals("herbie"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "petrol";
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Current;
+
+@ApplicationScoped
+class Pig
+{
+
+ public static boolean success;
+
+ @Current Food food;
+
+ public Pig()
+ {
+ success = false;
+ }
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ if (food.getName().equals("food"))
+ {
+ success = true;
+ }
+ }
+
+ public String getName()
+ {
+ return "john";
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Planet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Planet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Planet.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,17 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.inject.Initializer;
+
+@SuppressWarnings("unused")
+class Planet
+{
+
+ private Space space;
+
+ @Initializer
+ public Planet(Space space)
+ {
+ this.space = space;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingDependent1.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingDependent1.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingDependent1.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+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 SelfConsumingDependent1
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+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 SelfConsumingNormal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal1.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal1.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/SelfConsumingNormal1.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+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 SelfConsumingNormal1
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Space.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Space.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Space.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Initializer;
+
+@ApplicationScoped
+class Space
+{
+
+ // For serialization
+ public Space() {}
+
+ @Initializer
+ public Space(Planet planet)
+ {
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Violation.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Violation.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Violation.java 2009-07-22 08:59:04 UTC (rev 3125)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.lookup.circular;
+
+import java.io.Serializable;
+
+class Violation implements Serializable
+{
+
+ private static final long serialVersionUID = 1L;
+
+ public void ping()
+ {
+
+ }
+
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3124 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-22 02:59:34 -0400 (Wed, 22 Jul 2009)
New Revision: 3124
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Delicious.java
Log:
Added missing binding annotation for the TCK.
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Delicious.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Delicious.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Delicious.java 2009-07-22 06:59:34 UTC (rev 3124)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+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
+public @interface Delicious
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Delicious.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3123 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck: tests/implementation/enterprise/lifecycle and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-21 22:58:45 -0400 (Tue, 21 Jul 2009)
New Revision: 3123
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Fail.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/FirstBorn.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Web.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AndalusianChicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bakery.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bread.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/InfertileChicken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducerNotUsed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Tame.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/BrownRecluse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/LorryProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ShipProducer_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java
Log:
bring assertions up to 20090625
fix some broken tests as a result of deployment type removal
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/MockCreationalContext.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,10 +1,13 @@
package org.jboss.jsr299.tck.impl;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.enterprise.context.spi.CreationalContext;
public class MockCreationalContext<T> implements CreationalContext<T>
{
-
+ private static List<Object> beansPushed = new ArrayList<Object>();
private static Object lastBeanPushed = null;
private static boolean pushCalled = false;
private static boolean releaseCalled = false;
@@ -13,12 +16,18 @@
{
pushCalled = true;
lastBeanPushed = incompleteInstance;
+ beansPushed.add(incompleteInstance);
}
public static Object getLastBeanPushed()
{
return lastBeanPushed;
}
+
+ public static List<Object> getBeansPushed()
+ {
+ return beansPushed;
+ }
public static void setLastBeanPushed(Object lastBeanPushed)
{
@@ -40,9 +49,15 @@
return releaseCalled;
}
+ public static void setReleaseCalled(boolean releaseCalled)
+ {
+ MockCreationalContext.releaseCalled = releaseCalled;
+ }
+
public static void reset()
{
lastBeanPushed = null;
+ beansPushed.clear();
pushCalled = false;
releaseCalled = false;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+import java.io.Serializable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -32,7 +33,6 @@
* @author David Allen
*
* Spec version: 20090625
- *
*/
@Artifact
@Packaging(PackagingType.EAR)
@@ -44,7 +44,8 @@
@SpecAssertions( {
@SpecAssertion(section = "3.2.5", id = "a"),
@SpecAssertion(section = "7.3.2", id = "aa"),
- @SpecAssertion(section = "7.3.2", id = "bb")
+ @SpecAssertion(section = "7.3.2", id = "bb"),
+ @SpecAssertion(section = "7.3.3", id = "b")
})
public void testCreateSFSB() throws Exception
{
@@ -62,11 +63,15 @@
assert frankfurt.isKleinStadtCreated();
assert anotherStadtInstance != stadtInstance : "create() should not return same bean as before";
+ stadtInstance.setName("hometown");
+ assert "hometown".equals(stadtInstance.getName());
+
// Verify that the instance returned is a proxy by checking for all local interfaces
+ assert getCurrentConfiguration().getBeans().isProxy(stadtInstance);
Set<Class> interfaces = new HashSet<Class>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(KleinStadt.class);
assert interfaces.contains(SchoeneStadt.class);
-
+ assert interfaces.contains(Serializable.class);
}
@Test(groups = { "ri-broken", "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
@@ -86,7 +91,8 @@
@Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration" })
@SpecAssertions({
- @SpecAssertion(section = "7.3.2", id = "bc")
+ @SpecAssertion(section = "7.3.2", id = "bc"),
+ @SpecAssertion(section = "7.3.3", id = "c")
})
public void testDestroyRemovesSFSB() throws Exception
{
@@ -155,7 +161,7 @@
UniStadt marburg = getInstanceByType(UniStadt.class);
assert marburg != null : "Couldn't find the main SFSB";
Bean<UniStadt> uniStadtBean = getBeans(UniStadt.class).iterator().next();
- CreationalContext<UniStadt> creationalContext = getCurrentManager().createCreationalContext(uniStadtBean);
+ CreationalContext<UniStadt> creationalContext = getCurrentManager().createCreationalContext(uniStadtBean);
uniStadtBean.destroy(marburg, creationalContext);
GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
assert frankfurt.isSchlossDestroyed();
@@ -167,14 +173,7 @@
{
OrderProcessor.postConstructCalled = false;
assert getBeans(DirectOrderProcessorLocal.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(DirectOrderProcessorLocal.class).order();
- }
- }.run();
+ getInstanceByType(DirectOrderProcessorLocal.class).order();
assert OrderProcessor.postConstructCalled;
}
@@ -184,14 +183,7 @@
{
OrderProcessor.postConstructCalled = false;
assert getBeans(OrderProcessorLocal.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(OrderProcessorLocal.class).order();
- }
- }.run();
+ getInstanceByType(OrderProcessorLocal.class).order();
assert OrderProcessor.postConstructCalled;
}
@@ -201,17 +193,10 @@
{
OrderProcessor.preDestroyCalled = false;
assert getBeans(DirectOrderProcessorLocal.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<DirectOrderProcessorLocal> bean = getBeans(DirectOrderProcessorLocal.class).iterator().next();
- CreationalContext<DirectOrderProcessorLocal> creationalContext = getCurrentManager().createCreationalContext(bean);
- DirectOrderProcessorLocal instance = getInstanceByType(DirectOrderProcessorLocal.class);
- bean.destroy(instance, creationalContext);
- }
- }.run();
+ Bean<DirectOrderProcessorLocal> bean = getBeans(DirectOrderProcessorLocal.class).iterator().next();
+ CreationalContext<DirectOrderProcessorLocal> creationalContext = getCurrentManager().createCreationalContext(bean);
+ DirectOrderProcessorLocal instance = getInstanceByType(DirectOrderProcessorLocal.class);
+ bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
}
@@ -221,17 +206,10 @@
{
OrderProcessor.preDestroyCalled = false;
assert getBeans(IndirectOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
- CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
- IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
- bean.destroy(instance, creationalContext);
- }
- }.run();
+ Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
+ bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
}
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AndalusianChicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AndalusianChicken.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/AndalusianChicken.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,15 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.enterprise.inject.Specializes;
-
-@Specializes
-class AndalusianChicken extends Chicken
-{
- public static Egg egg = new Egg();
-
- @Override
- public Egg getEgg()
- {
- return egg;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bakery.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bakery.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bakery.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,12 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.enterprise.inject.Produces;
-
-class Bakery
-{
- @Produces
- public Bread makeBread()
- {
- return null;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bread.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bread.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Bread.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-class Bread
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/BrownRecluse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/BrownRecluse.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/BrownRecluse.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -6,8 +6,7 @@
class BrownRecluse
{
- @Produces
- public SpiderEgg layAnEgg(@Current BeanManager beanManager)
+ public @Produces @FirstBorn SpiderEgg layAnEgg(@Current BeanManager beanManager)
{
assert beanManager != null : "Manager was not injected";
return new SpiderEgg();
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Fail.java (from rev 3121, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Fail.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Fail.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+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
+public @interface Fail
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/FirstBorn.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/FirstBorn.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/FirstBorn.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+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
+public @interface FirstBorn
+{
+
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/InfertileChicken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/InfertileChicken.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/InfertileChicken.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-class InfertileChicken extends Chicken
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -5,8 +5,7 @@
class Lays
{
- @Produces @Delicious @RequestScoped
- public PotatoChip makeChip()
+ public @Produces @RequestScoped PotatoChip makeChip()
{
return null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/LorryProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/LorryProducer_Broken.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/LorryProducer_Broken.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -5,8 +5,7 @@
class LorryProducer_Broken
{
- @Produces
- public Lorry produceLorry() throws Exception
+ public @Produces @Fail Lorry produceLorry() throws Exception
{
throw new Exception();
}
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java (from rev 3118, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/PreferredSpiderProducer.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -0,0 +1,96 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Specializes;
+import javax.enterprise.inject.spi.BeanManager;
+
+@Specializes class PreferredSpiderProducer extends SpiderProducer
+{
+ private @Current Web web;
+ private static Web injectedWeb;
+ private static Tarantula tarantulaCreated;
+ private static Tarantula tarantulaDestroyed;
+ private static boolean destroyArgumentsSet;
+
+ @Override
+ public @Produces @Pet Tarantula produceTarantula()
+ {
+ Tarantula tarantula = new Tarantula("Pete");
+ tarantulaCreated = tarantula;
+ resetTarantulaDestroyed();
+ injectedWeb = web;
+ return tarantula;
+ }
+
+ @Override
+ public @Produces @Null Spider getNullSpider()
+ {
+ return null;
+ }
+
+ public void destroyTarantula(@Disposes @Pet Tarantula spider, @Current BeanManager beanManager)
+ {
+ tarantulaDestroyed = spider;
+ injectedWeb = web;
+ if (beanManager != null)
+ {
+ destroyArgumentsSet = true;
+ }
+ }
+
+ public static boolean isTarantulaCreated()
+ {
+ return tarantulaCreated != null;
+ }
+
+ public static boolean isTarantulaDestroyed()
+ {
+ return tarantulaDestroyed != null;
+ }
+
+ public static Tarantula getTarantulaDestroyed()
+ {
+ return tarantulaDestroyed;
+ }
+
+ public static void resetTarantulaCreated()
+ {
+ PreferredSpiderProducer.tarantulaCreated = null;
+ }
+
+ public static void resetTarantulaDestroyed()
+ {
+ PreferredSpiderProducer.tarantulaDestroyed = null;
+ PreferredSpiderProducer.destroyArgumentsSet = false;
+ }
+
+ public static boolean isDestroyArgumentsSet()
+ {
+ return destroyArgumentsSet;
+ }
+
+ public static Tarantula getTarantulaCreated()
+ {
+ return tarantulaCreated;
+ }
+
+ public static Web getInjectedWeb()
+ {
+ return injectedWeb;
+ }
+
+ public static void resetInjections()
+ {
+ injectedWeb = null;
+ }
+
+ public static void reset()
+ {
+ resetTarantulaCreated();
+ resetTarantulaDestroyed();
+ resetInjections();
+ }
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,9 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-import java.lang.annotation.Annotation;
-
+import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.CreationException;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -15,86 +15,151 @@
import org.testng.annotations.Test;
/**
- *
* Spec version: 20090625
*
+ * NOTE May be able to get rid of some of the binding types if the producer method precedence question is resolved
*/
@Artifact
@BeansXml("beans.xml")
public class ProducerMethodLifecycleTest extends AbstractJSR299Test
{
-
- private static final Annotation PET_LITERAL = new AnnotationLiteral<Pet> () {};
- private static final Annotation DELICIOUS_LITERAL = new AnnotationLiteral<Delicious> () {};
-
- @Test(groups = { "producerMethod", "disposalMethod" })
- @SpecAssertion(section = "7.3.4", id = "ma")
- public void testProducerMethodBeanDestroy()
- {
- SpiderProducer.setTarantulaDestroyed(false);
- Tarantula tarantula = getInstanceByType(Tarantula.class, PET_LITERAL);
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
- tarantulaBean.destroy(tarantula, creationalContext);
- assert SpiderProducer.isTarantulaDestroyed();
- assert SpiderProducer.isDestroyArgumentsSet();
- assert !SpiderProducerNotUsed.isTarantulaDestroyed();
- }
-
+ private AnnotationLiteral<Pet> PET_LITERAL = new AnnotationLiteral<Pet>() {};
+ private AnnotationLiteral<FirstBorn> FIRST_BORN_LITERAL = new AnnotationLiteral<FirstBorn>() {};
+ private AnnotationLiteral<Fail> FAIL_LITERAL = new AnnotationLiteral<Fail>() {};
+ private AnnotationLiteral<Null> NULL_LITERAL = new AnnotationLiteral<Null>() {};
+
@Test(groups = { "producerMethod" })
- @SpecAssertion(section = "7.3.4", id = "review")
+ @SpecAssertion(section = "7.3.4", id = "ea")
public void testProducerMethodBeanCreate()
{
- getInstanceByType(Tarantula.class, PET_LITERAL);
- assert SpiderProducer.isTarantulaCreated();
+ PreferredSpiderProducer.reset();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ CreationalContext<Tarantula> tarantulaCc = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(tarantulaCc);
+ assert PreferredSpiderProducer.getTarantulaCreated() == tarantula;
+ assert PreferredSpiderProducer.getInjectedWeb() != null;
+ assert PreferredSpiderProducer.getInjectedWeb().isDestroyed();
}
@Test(groups = { "producerMethod" })
@SpecAssertions({
+ @SpecAssertion(section = "3.3.3", id = "b"),
+ @SpecAssertion(section = "3.3.3", id = "c"),
@SpecAssertion(section = "7.3.4", id = "ea")
})
public void testProducerMethodInvokedOnCreate()
{
- Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class).iterator().next();
- CreationalContext<SpiderEgg> creationalContext = getCurrentManager().createCreationalContext(eggBean);
- assert eggBean.create(creationalContext) != null;
+ Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class, FIRST_BORN_LITERAL).iterator().next();
+ CreationalContext<SpiderEgg> eggCc = getCurrentManager().createCreationalContext(eggBean);
+ assert eggBean.create(eggCc) != null;
}
+
+ @Test(groups = { "producerMethod" })
+ @SpecAssertion(section = "3.3", id = "j")
+ public void testWhenApplicationInvokesProducerMethodParametersAreNotInjected()
+ {
+ try
+ {
+ getInstanceByType(BrownRecluse.class).layAnEgg(null);
+ }
+ catch (AssertionError e)
+ {
+ return;
+ }
+
+ assert false : "The BeanManager should not have been injected into the producer method";
+ }
- @Test(groups = { "producerMethod", "rewrite" })
- //Test needs to user the InjectionTarget interface for these assertions
+ @Test(groups = { "producerMethod" })
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review")
+ @SpecAssertion(section = "4.3.2", id = "a"),
+ @SpecAssertion(section = "5.6.6", id = "c")
})
public void testProducerMethodFromMostSpecializedBeanUsed()
{
- Tarantula.setNumberCreated(0);
+ SpiderProducer.reset();
+ PreferredSpiderProducer.reset();
Bean<Tarantula> spiderBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(spiderBean);
- Tarantula tarantula = spiderBean.create(creationalContext);
- assert tarantula.getValue().equals("Pete");
- assert Tarantula.getNumberCreated() == 1;
+ CreationalContext<Tarantula> spiderBeanCc = getCurrentManager().createCreationalContext(spiderBean);
+ Tarantula tarantula = spiderBean.create(spiderBeanCc);
+ assert PreferredSpiderProducer.getTarantulaCreated() == tarantula;
+ assert !SpiderProducer.isTarantulaCreated();
}
@Test(groups = { "producerMethod" })
@SpecAssertions({
@SpecAssertion(section = "7.3.4", id = "k")
})
- public void testCreateReturnsNullIfProducerDoesAndDependent() throws Exception
+ public void testCreateReturnsNullIfProducerDoesAndDependent()
{
- Bean<Bread> breadBean = getBeans(Bread.class).iterator().next();
- CreationalContext<Bread> creationalContext = getCurrentManager().createCreationalContext(breadBean);
- assert breadBean.create(creationalContext) == null;
+ Bean<Spider> nullSpiderBean = getBeans(Spider.class, NULL_LITERAL).iterator().next();
+ CreationalContext<Spider> nullSpiderBeanCc = getCurrentManager().createCreationalContext(nullSpiderBean);
+ assert nullSpiderBean.create(nullSpiderBeanCc) == null;
}
- @Test(groups = { "producerMethod", "broken" }, expectedExceptions = IllegalProductException.class )
+ @Test(groups = { "producerMethod" }, expectedExceptions = IllegalProductException.class )
@SpecAssertions({
@SpecAssertion(section = "7.3.4", id = "l")
})
- // TODO I'm not quite sure what this test is currently doing!
- public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
+ public void testCreateFailsIfProducerReturnsNullAndNotDependent()
{
- Bean<PotatoChip> chipBean = getBeans(PotatoChip.class, DELICIOUS_LITERAL).iterator().next();
- CreationalContext<PotatoChip> creationalContext = getCurrentManager().createCreationalContext(chipBean);
- assert chipBean.create(creationalContext) == null;
+ // QUESTION is there an easier way to get the producer method bean instead of the top-level (dependent) type?
+ Bean<PotatoChip> potatoChipBean = null;
+ for (Bean<PotatoChip> candidate : getBeans(PotatoChip.class))
+ {
+ if (candidate.getScopeType().equals(RequestScoped.class))
+ {
+ potatoChipBean = candidate;
+ break;
+ }
+ }
+
+ assert potatoChipBean != null;
+ CreationalContext<PotatoChip> chipCc = getCurrentManager().createCreationalContext(potatoChipBean);
+ potatoChipBean.create(chipCc);
+ assert false;
}
+
+ @Test(groups = { "producerMethod", "disposalMethod" })
+ @SpecAssertions({
+ @SpecAssertion(section = "7.3.4", id = "ma"),
+ @SpecAssertion(section = "7.3.4", id = "r")
+ })
+ public void testProducerMethodBeanDestroy()
+ {
+ PreferredSpiderProducer.reset();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ CreationalContext<Tarantula> tarantulaCc = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(tarantulaCc);
+ PreferredSpiderProducer.resetInjections();
+ tarantulaBean.destroy(tarantula, tarantulaCc);
+ assert PreferredSpiderProducer.getTarantulaDestroyed() == tarantula;
+ assert PreferredSpiderProducer.isDestroyArgumentsSet();
+ assert PreferredSpiderProducer.getInjectedWeb() != null;
+ assert PreferredSpiderProducer.getInjectedWeb().isDestroyed();
+ }
+
+ @Test(groups = { "producerMethod" }, expectedExceptions = FooException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "6.1", id = "a0")
+ })
+ public void testCreateRethrowsUncheckedException()
+ {
+ Bean<Ship> shipBean = getBeans(Ship.class, FAIL_LITERAL).iterator().next();
+ CreationalContext<Ship> shipCc = getCurrentManager().createCreationalContext(shipBean);
+ shipBean.create(shipCc);
+ assert false;
+ }
+
+ @Test(groups = { "producerMethod" }, expectedExceptions = CreationException.class)
+ @SpecAssertions({
+ @SpecAssertion(section = "6.1", id = "a0")
+ })
+ public void testCreateWrapsCheckedExceptionAndRethrows()
+ {
+ Bean<Lorry> lorryBean = getBeans(Lorry.class, FAIL_LITERAL).iterator().next();
+ CreationalContext<Lorry> lorryCc = getCurrentManager().createCreationalContext(lorryBean);
+ lorryBean.create(lorryCc);
+ assert false;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ShipProducer_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ShipProducer_Broken.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ShipProducer_Broken.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -5,8 +5,7 @@
class ShipProducer_Broken
{
- @Produces
- public Ship produceShip() throws FooException
+ public @Produces @Fail Ship produceShip() throws FooException
{
throw new FooException();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,65 +1,70 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.enterprise.inject.Current;
-import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.Produces;
-import javax.enterprise.inject.spi.BeanManager;
-
-class SpiderProducer
-{
- private static boolean tarantulaCreated;
- private static boolean tarantulaDestroyed;
- private static boolean destroyArgumentsSet;
-
- @Produces @Pet public Tarantula produceTarantula()
- {
- tarantulaCreated = true;
- tarantulaDestroyed = false;
- destroyArgumentsSet = false;;
- return new Tarantula("Pete");
- }
-
- @Produces @Null public Spider getNullSpider()
- {
- return null;
- }
-
- public static void destroyTarantula(@Disposes @Pet Tarantula spider, @Current BeanManager beanManager)
- {
- tarantulaDestroyed = true;
- if (beanManager != null)
- {
- destroyArgumentsSet = true;
- }
- }
-
- public static boolean isTarantulaCreated()
- {
- return tarantulaCreated;
- }
-
- public static boolean isTarantulaDestroyed()
- {
- return tarantulaDestroyed;
- }
-
- public static void setTarantulaCreated(boolean tarantulaCreated)
- {
- SpiderProducer.tarantulaCreated = tarantulaCreated;
- }
-
- public static void setTarantulaDestroyed(boolean tarantulaDestroyed)
- {
- SpiderProducer.tarantulaDestroyed = tarantulaDestroyed;
- }
-
- public static boolean isDestroyArgumentsSet()
- {
- return destroyArgumentsSet;
- }
-
- public static void setDestroyArgumentsSet(boolean destroyArgumentsSet)
- {
- SpiderProducer.destroyArgumentsSet = destroyArgumentsSet;
- }
-}
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.enterprise.inject.Produces;
+
+class SpiderProducer
+{
+ private static Tarantula tarantulaCreated;
+ private static boolean tarantulaDestroyed;
+ private static boolean destroyArgumentsSet;
+
+ public @Produces @Pet Tarantula produceTarantula()
+ {
+ Tarantula tarantula = new Tarantula("Pete");
+ tarantulaCreated = tarantula;
+ resetTarantulaDestroyed();
+ return tarantula;
+ }
+
+ public @Produces @Null Spider getNullSpider()
+ {
+ return null;
+ }
+
+ // FIXME this should be allowed
+// public void destroyTarantula(@Disposes Tarantula spider, @Current BeanManager beanManager)
+// {
+// tarantulaDestroyed = true;
+// if (beanManager != null)
+// {
+// destroyArgumentsSet = true;
+// }
+// }
+
+ public static boolean isTarantulaCreated()
+ {
+ return tarantulaCreated != null;
+ }
+
+ public static boolean isTarantulaDestroyed()
+ {
+ return tarantulaDestroyed;
+ }
+
+ public static void resetTarantulaCreated()
+ {
+ SpiderProducer.tarantulaCreated = null;
+ }
+
+ public static void resetTarantulaDestroyed()
+ {
+ SpiderProducer.tarantulaDestroyed = false;
+ SpiderProducer.destroyArgumentsSet = false;
+ }
+
+ public static boolean isDestroyArgumentsSet()
+ {
+ return destroyArgumentsSet;
+ }
+
+ public static Tarantula getTarantulaCreated()
+ {
+ return tarantulaCreated;
+ }
+
+ public static void reset()
+ {
+ resetTarantulaCreated();
+ resetTarantulaDestroyed();
+ }
+}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducerNotUsed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducerNotUsed.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducerNotUsed.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,45 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-import javax.enterprise.inject.Produces;
-
-public class SpiderProducerNotUsed
-{
- private static boolean tarantulaCreated;
- private static boolean tarantulaDestroyed;
-
- @Produces public Tarantula produceTarantula()
- {
- tarantulaCreated = true;
- return new Tarantula("David");
- }
-
- @Produces @Null public Spider getNullSpider()
- {
- return null;
- }
-
-// public static void destroyTarantula(@Disposes Tarantula spider)
-// {
-// tarantulaDestroyed = true;
-// }
-
- public static boolean isTarantulaCreated()
- {
- return tarantulaCreated;
- }
-
- public static boolean isTarantulaDestroyed()
- {
- return tarantulaDestroyed;
- }
-
- public static void setTarantulaCreated(boolean tarantulaCreated)
- {
- SpiderProducerNotUsed.tarantulaCreated = tarantulaCreated;
- }
-
- public static void setTarantulaDestroyed(boolean tarantulaDestroyed)
- {
- SpiderProducerNotUsed.tarantulaDestroyed = tarantulaDestroyed;
- }
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Tame.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Tame.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
-
-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 Tame
-{
-
-}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Web.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Web.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Web.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+class Web
+{
+ private Boolean destroyed;
+
+ public boolean isSpun()
+ {
+ return destroyed != null;
+ }
+
+ public boolean isDestroyed()
+ {
+ return Boolean.TRUE.equals(destroyed);
+ }
+
+ @PostConstruct public void spin()
+ {
+ destroyed = false;
+ }
+
+ @PreDestroy public void destroy()
+ {
+ destroyed = true;
+ }
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FarmOffice.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,9 +1,16 @@
package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+import javax.annotation.PreDestroy;
+
class FarmOffice
{
public int noOfStaff = 20;
+ @PreDestroy
+ public void preDestroy()
+ {
+ noOfStaff = 0;
+ }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/FishPond.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -1,11 +1,13 @@
package org.jboss.jsr299.tck.tests.implementation.simple.lifecycle;
+import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.Initializer;
class FishPond
{
+ public boolean postConstructCalled;
public Animal goldfish;
@@ -21,6 +23,12 @@
this.goose = goose;
}
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructCalled = true;
+ }
+
@PreDestroy
public void destroy()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -9,9 +9,9 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.CreationException;
+import javax.enterprise.inject.Specializes;
import javax.enterprise.inject.spi.Bean;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -21,9 +21,7 @@
import org.testng.annotations.Test;
/**
- *
* Spec version: 20090625
- *
*/
@Artifact
@BeansXml("beans.xml")
@@ -44,6 +42,7 @@
assert getBeans(FishPond.class).size() == 1;
FishPond fishPond = getInstanceByType(FishPond.class);
assert fishPond.goldfish != null;
+ assert fishPond.goldfish instanceof Goldfish;
assert fishPond.goose != null;
}
@@ -57,9 +56,29 @@
@Test(groups = { "specialization" })
@SpecAssertion(section = "3.1.5", id = "aa")
- public void testSpecializedBeanSpecializesAnotherBean()
+ public void testSpecializedBeanExtendsManagedBean()
{
- assert !getBeans(MountainLion.class, TAME_LITERAL).isEmpty();
+ assert MountainLion.class.getAnnotation(Specializes.class) != null;
+ Bean<Lion> bean = null;
+ Bean<Lion> specializedBean = null;
+ for (Bean<Lion> lionBean : getBeans(Lion.class, TAME_LITERAL))
+ {
+ if (lionBean.getBeanClass().equals(Lion.class))
+ {
+ bean = lionBean;
+ }
+ else if (lionBean.getBeanClass().equals(MountainLion.class))
+ {
+ specializedBean = lionBean;
+ }
+ }
+
+ assert bean != null;
+ assert specializedBean != null;
+ assert specializedBean == getCurrentManager().getMostSpecializedBean(bean);
+ assert specializedBean.getBeanClass().getSuperclass().equals(Lion.class);
+
+ //assert getInstanceByType(Lion.class, TAME_LITERAL) instanceof MountainLion;
}
@Test(groups = "beanLifecycle")
@@ -74,11 +93,29 @@
final Contextual<ShoeFactory> bean = getBeans(ShoeFactory.class).iterator().next();
MockCreationalContext.reset();
ShoeFactory instance = getCurrentManager().getContext(Dependent.class).get(bean, creationalContext);
- if (MockCreationalContext.isPushCalled())
- {
- assert instance.equals(MockCreationalContext.getLastBeanPushed());
- }
+ assert MockCreationalContext.isPushCalled();
+ assert instance == MockCreationalContext.getLastBeanPushed();
}
+
+ @Test(groups = "beanLifecycle")
+ @SpecAssertions({
+ @SpecAssertion(section = "7.3.1", id = "aa")
+ })
+ public void testBeanCreateInjectsDependenciesAndInvokesInitializerToInstantiateInstance()
+ {
+ MockCreationalContext.reset();
+ final CreationalContext<FishPond> creationalContext = new MockCreationalContext<FishPond>();
+ final Contextual<FishPond> bean = getBeans(FishPond.class).iterator().next();
+ FishPond fishPond = bean.create(creationalContext);
+ assert fishPond != null;
+ assert MockCreationalContext.isPushCalled();
+ assert MockCreationalContext.getBeansPushed().contains(fishPond);
+ assert fishPond.goldfish != null;
+ assert fishPond.goldfish instanceof Goldfish;
+ assert fishPond.goose != null;
+ assert fishPond.salmon != null;
+ assert fishPond.postConstructCalled = true; // required by Managed Bean specification
+ }
@Test(groups = "beanLifecycle")
@SpecAssertions({
@@ -120,46 +157,48 @@
@Test(groups = { "beanLifecycle", "lifecycleCallbacks" })
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review"), // no longer explicit in the spec?
- @SpecAssertion(section = "review", id = "review")
+ @SpecAssertion(section = "7.3.1", id = "aa"),
+ @SpecAssertion(section = "7.3.1", id = "ba")
})
- public void testPostConstructPreDestroy() throws Exception
+ public void testPostConstructPreDestroy()
{
assert getBeans(Farm.class).size() == 1;
Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
CreationalContext<Farm> creationalContext = getCurrentManager().createCreationalContext(farmBean);
- Farm farm = getInstanceByType(Farm.class);
+ Farm farm = farmBean.create(creationalContext);
assert farm.founded != null;
assert farm.initialStaff == 20;
assert farm.closed == null;
farmBean.destroy(farm, creationalContext);
assert farm.closed != null;
+ assert farm.farmOffice.noOfStaff == 0;
}
@Test(groups = { "beanLifecycle", "lifecycleCallbacks" })
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review") // removed from the spec?
+ @SpecAssertion(section = "6.5.3", id = "a0"),
+ @SpecAssertion(section = "7.3.1", id = "ba")
})
- public void testContextualDestroyDisposesWhenNecessary() throws Exception
+ public void testContextualDestroyDisposesWhenNecessary()
{
final Bean<Goose> gooseBean = getBeans(Goose.class).iterator().next();
- CreationalContext<Goose> creationalContext = getCurrentManager().createCreationalContext(gooseBean);
- final Goose goose = gooseBean.create(creationalContext);
-
+ final CreationalContext<Goose> gooseCc = getCurrentManager().createCreationalContext(gooseBean);
+ final Goose goose = gooseBean.create(gooseCc);
assert !EggProducer.isEggDisposed();
assert !Egg.isEggDestroyed();
- gooseBean.destroy(goose, creationalContext);
+ gooseBean.destroy(goose, gooseCc);
assert EggProducer.isEggDisposed();
+ assert !Egg.isEggDestroyed();
}
@Test(groups = "beanLifecycle")
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review") // removed from the spec?
+ @SpecAssertion(section = "6.1", id = "a1")
})
public void testContextualDestroyCatchesException()
{
Bean<Cod> codBean = getBeans(Cod.class).iterator().next();
- CreationalContext<Cod> creationalContext = getCurrentManager().createCreationalContext(codBean);
+ CreationalContext<Cod> creationalContext = getCurrentManager().createCreationalContext(codBean);
Cod codInstance = getInstanceByType(Cod.class);
codInstance.ping();
codBean.destroy(codInstance, creationalContext);
@@ -167,7 +206,7 @@
@Test(groups = "beanLifecycle")
@SpecAssertions({
- @SpecAssertion(section = "review", id = "review") // removed from spec?
+ @SpecAssertion(section = "5.6.5", id = "a")
})
public void testDependentsDestroyedAfterPreDestroy()
{
@@ -196,7 +235,7 @@
assert getBeans(IndirectOrderProcessor.class).size() == 1;
getInstanceByType(IndirectOrderProcessor.class).order();
assert OrderProcessor.postConstructCalled;
- }
+ }
@Test
@SpecAssertion(section = "4.2", id = "bba")
@@ -205,7 +244,7 @@
OrderProcessor.preDestroyCalled = false;
assert getBeans(CdOrderProcessor.class).size() == 1;
Bean<CdOrderProcessor> bean = getBeans(CdOrderProcessor.class).iterator().next();
- CreationalContext<CdOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ CreationalContext<CdOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
CdOrderProcessor instance = getInstanceByType(CdOrderProcessor.class);
bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
@@ -218,11 +257,11 @@
OrderProcessor.preDestroyCalled = false;
assert getBeans(IndirectOrderProcessor.class).size() == 1;
Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
- CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
- }
+ }
@Test
@SpecAssertion(section = "4.2", id = "baa")
@@ -241,15 +280,14 @@
OrderProcessor.preDestroyCalled = false;
assert getBeans(NovelOrderProcessor.class).size() == 1;
Bean<NovelOrderProcessor> bean = getBeans(NovelOrderProcessor.class).iterator().next();
- CreationalContext<NovelOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ CreationalContext<NovelOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
NovelOrderProcessor instance = getInstanceByType(NovelOrderProcessor.class);
bean.destroy(instance, creationalContext);
assert !OrderProcessor.preDestroyCalled;
-
}
@Test(expectedExceptions = CreationException.class)
- @SpecAssertion(section = "review", id = "review") // removed from spec?
+ @SpecAssertion(section = "6.1", id = "a0")
public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate()
{
assert getBeans(Lorry_Broken.class).size() == 1;
@@ -257,7 +295,7 @@
}
@Test(expectedExceptions = FooException.class)
- @SpecAssertion(section = "review", id = "review") // removed from spec?
+ @SpecAssertion(section = "6.1", id = "a0")
public void testUncheckedExceptionThrownFromCreateNotWrapped()
{
assert getBeans(Van_Broken.class).size() == 1;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java 2009-07-22 02:27:04 UTC (rev 3122)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/Van_Broken.java 2009-07-22 02:58:45 UTC (rev 3123)
@@ -3,7 +3,7 @@
class Van_Broken
{
- public Van_Broken() throws Exception
+ public Van_Broken()
{
throw new FooException();
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3122 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-21 22:27:04 -0400 (Tue, 21 Jul 2009)
New Revision: 3122
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
mark test as testable after creating a test to prove it so
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 22:21:05 UTC (rev 3121)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-22 02:27:04 UTC (rev 3122)
@@ -816,7 +816,7 @@
<text>If a producer method return type is a type variable the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
</assertion>
- <assertion id="j" testable="false">
+ <assertion id="j">
<text>The application may call producer methods directly. However, if the application calls a producer method directly, no parameters will be passed to the producer method by the container; the returned object is not bound to any context; and its lifecycle is not managed by the container.</text>
</assertion>
@@ -3035,7 +3035,7 @@
</assertion>
<assertion id="r">
- <text>Finally, the container destroys dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
+ <text>Finally, the container destroys dependent objects, as defined in Section 5.6.5, "Destruction of dependent objects".</text>
</assertion>
</section>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3121 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: decorators/definition and 11 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-21 18:21:05 -0400 (Tue, 21 Jul 2009)
New Revision: 3121
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Pet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Pet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameAnnotationLiteral.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/broken/samePrecedence/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/broken/lowerPrecedence/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/broken/precedence/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
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/implementation/disposal/method/definition/DefangedTarantula.java
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/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/OtherSpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaConsumer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/JewelryShop.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/Shop.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
Log:
Fixed remaining broken tests due to bean specialization changes in the spec
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -27,6 +27,7 @@
{
private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame> () {};
+ private static final Annotation PET_LITERAL = new AnnotationLiteral<Pet> () {};
@Test(groups = { "contexts", "injection" })
@SpecAssertion(section = "6.4", id = "a")
@@ -65,7 +66,7 @@
@SpecAssertion(section = "6.4", id = "da")
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
Tarantula tarantula = tarantulaBean.create(creationalContext);
@@ -90,96 +91,59 @@
@Test(groups = { "contexts", "disposalMethod" })
@SpecAssertion(section = "6.4", id = "dc")
- public void testInstanceUsedForDisposalMethodNotShared() throws Exception
+ public void testInstanceUsedForDisposalMethodNotShared()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SpiderProducer spiderProducer = getInstanceByType(SpiderProducer.class);
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
- Tarantula tarantula = tarantulaBean.create(creationalContext);
- assert tarantula != null;
- tarantulaBean.destroy(tarantula, creationalContext);
- assert SpiderProducer.getInstanceUsedForDisposal() != null;
- assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
- }
-
- }.run();
+ SpiderProducer spiderProducer = getInstanceByType(SpiderProducer.class);
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
+ assert tarantula != null;
+ tarantulaBean.destroy(tarantula, creationalContext);
+ assert SpiderProducer.getInstanceUsedForDisposal() != null;
+ assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
}
@Test(groups = { "contexts", "observerMethod" })
@SpecAssertion(section = "6.4", id = "dd")
- public void testInstanceUsedForObserverMethodNotShared() throws Exception
+ public void testInstanceUsedForObserverMethodNotShared()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- HorseStable firstStableInstance = getInstanceByType(HorseStable.class);
- getCurrentManager().fireEvent(new HorseInStableEvent());
- assert HorseStable.getInstanceThatObservedEvent() != null;
- assert HorseStable.getInstanceThatObservedEvent() != firstStableInstance;
- }
-
- }.run();
+ HorseStable firstStableInstance = getInstanceByType(HorseStable.class);
+ getCurrentManager().fireEvent(new HorseInStableEvent());
+ assert HorseStable.getInstanceThatObservedEvent() != null;
+ assert HorseStable.getInstanceThatObservedEvent() != firstStableInstance;
}
@Test(groups = "contexts")
@SpecAssertion(section = "6.4", id = "e")
- public void testContextGetWithCreationalContextReturnsNewInstance() throws Exception
+ public void testContextGetWithCreationalContextReturnsNewInstance()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
- assert foxBeans.size() == 1;
- Bean<Fox> foxBean = foxBeans.iterator().next();
- Context context = getCurrentManager().getContext(Dependent.class);
- assert context.get(foxBean, new MockCreationalContext<Fox>()) != null;
- assert context.get(foxBean, new MockCreationalContext<Fox>()) instanceof Fox;
- }
-
- }.run();
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = getCurrentManager().getContext(Dependent.class);
+ assert context.get(foxBean, new MockCreationalContext<Fox>()) != null;
+ assert context.get(foxBean, new MockCreationalContext<Fox>()) instanceof Fox;
}
@Test(groups = "contexts")
@SpecAssertion(section = "6.4", id = "f")
- public void testContextGetWithCreateFalseReturnsNull() throws Exception
+ public void testContextGetWithCreateFalseReturnsNull()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
- assert foxBeans.size() == 1;
- Bean<Fox> foxBean = foxBeans.iterator().next();
- Context context = getCurrentManager().getContext(Dependent.class);
- assert context.get(foxBean, null) == null;
- }
-
- }.run();
+ Set<Bean<Fox>> foxBeans = getBeans(Fox.class);
+ assert foxBeans.size() == 1;
+ Bean<Fox> foxBean = foxBeans.iterator().next();
+ Context context = getCurrentManager().getContext(Dependent.class);
+ assert context.get(foxBean, null) == null;
}
- @Test(groups = { "contexts", "ri-broken" }, expectedExceptions = ContextNotActiveException.class)
+ @Test(groups = { "contexts" })
@SpecAssertions({
@SpecAssertion(section = "6.2", id = "ha"),
- @SpecAssertion(section = "6.4", id = "g") // Dependent context is now always active
+ @SpecAssertion(section = "6.4", id = "g")
})
public void testContextIsInactive()
{
- // The RI test harness is broken here, it just enables the dependent context blindly
- getCurrentManager().getContext(Dependent.class);
+ assert getCurrentManager().getContext(Dependent.class).isActive();
}
@Test(groups = { "contexts", "producerMethod" })
@@ -213,7 +177,7 @@
})
public void testContextIsActiveWhenInvokingDisposalMethod()
{
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
@@ -232,38 +196,22 @@
@Test(groups = { "contexts", "el" })
@SpecAssertion(section = "6.4", id = "g") // Dependent context is now always active
- public void testContextIsActiveWhenEvaluatingElExpression() throws Exception
+ public void testContextIsActiveWhenEvaluatingElExpression()
{
SensitiveFox.setManager(getCurrentManager());
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- String foxName = getCurrentConfiguration().getEl().evaluateMethodExpression("#{sensitiveFox.getName}", String.class, new Class[0], new Object[0]);
- assert foxName != null;
- assert SensitiveFox.isDependentContextActiveDuringEval();
- }
- }.run();
+ String foxName = getCurrentConfiguration().getEl().evaluateMethodExpression("#{sensitiveFox.getName}", String.class, new Class[0], new Object[0]);
+ assert foxName != null;
+ assert SensitiveFox.isDependentContextActiveDuringEval();
}
@Test(groups = { "contexts", "beanLifecycle" })
@SpecAssertion(section = "6.4", id = "g") // Dependent context is now always active
- public void testContextIsActiveDuringBeanCreation() throws Exception
+ public void testContextIsActiveDuringBeanCreation()
{
SensitiveFox.setManager(getCurrentManager());
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SensitiveFox fox1 = getInstanceByType(SensitiveFox.class);
- assert fox1 != null;
- assert fox1.isDependentContextActiveDuringCreate();
- }
-
- }.run();
+ SensitiveFox fox1 = getInstanceByType(SensitiveFox.class);
+ assert fox1 != null;
+ assert fox1.isDependentContextActiveDuringCreate();
}
@Test(groups = { "contexts", "injection" })
@@ -280,27 +228,18 @@
@SpecAssertion(section = "6.4.2", id = "aaa"),
@SpecAssertion(section = "6.4", id = "b")
})
- public void testDestroyingSimpleParentDestroysDependents() throws Exception
+ public void testDestroyingSimpleParentDestroysDependents()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(Farm.class).size() == 1;
- Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
- CreationalContext<Farm> creationalContext = getCurrentManager().createCreationalContext(farmBean);
- Farm farm = farmBean.create(creationalContext);
- farm.open();
- Stable.destroyed = false;
- Horse.destroyed = false;
- farmBean.destroy(farm, creationalContext);
- assert Stable.destroyed;
- assert Horse.destroyed;
- }
-
- }.run();
+ assert getBeans(Farm.class).size() == 1;
+ Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
+ CreationalContext<Farm> creationalContext = getCurrentManager().createCreationalContext(farmBean);
+ Farm farm = farmBean.create(creationalContext);
+ farm.open();
+ Stable.destroyed = false;
+ Horse.destroyed = false;
+ farmBean.destroy(farm, creationalContext);
+ assert Stable.destroyed;
+ assert Horse.destroyed;
}
@Test(groups = { "contexts", "beanDestruction"})
@@ -308,130 +247,84 @@
@SpecAssertion(section = "6.4.2", id = "aaa"),
@SpecAssertion(section = "6.4", id = "b")
})
- public void testDestroyingManagedParentDestroysDependentsOfSameBean() throws Exception
+ public void testDestroyingManagedParentDestroysDependentsOfSameBean()
{
- new RunInDependentContext()
- {
+ // Reset test class
+ Fox.setDestroyed(false);
+ Fox.setDestroyCount(0);
- @Override
- protected void execute() throws Exception
- {
- // Reset test class
- Fox.setDestroyed(false);
- Fox.setDestroyCount(0);
-
- assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
- Bean<FoxRun> bean = getBeans(FoxRun.class).iterator().next();
- CreationalContext<FoxRun> creationalContext = getCurrentManager().createCreationalContext(bean);
- FoxRun instance = bean.create(creationalContext);
- assert instance.fox != instance.anotherFox;
- bean.destroy(instance, creationalContext);
- assert Fox.isDestroyed();
- assert Fox.getDestroyCount() == 2;
- }
-
- }.run();
+ assert getCurrentManager().getBeans(FoxRun.class).size() == 1;
+ Bean<FoxRun> bean = getBeans(FoxRun.class).iterator().next();
+ CreationalContext<FoxRun> creationalContext = getCurrentManager().createCreationalContext(bean);
+ FoxRun instance = bean.create(creationalContext);
+ assert instance.fox != instance.anotherFox;
+ bean.destroy(instance, creationalContext);
+ assert Fox.isDestroyed();
+ assert Fox.getDestroyCount() == 2;
}
@Test(groups = { "contexts", "el"})
@SpecAssertion(section = "6.4.2", id = "eee")
public void testDependentsDestroyedWhenElEvaluationCompletes() throws Exception
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- // Reset test class
- Fox.setDestroyed(false);
- FoxRun.setDestroyed(false);
-
- getCurrentConfiguration().getEl().evaluateValueExpression("#{foxRun}", FoxRun.class);
- assert FoxRun.isDestroyed();
- assert Fox.isDestroyed();
- }
- }.run();
+ // Reset test class
+ Fox.setDestroyed(false);
+ FoxRun.setDestroyed(false);
+
+ getCurrentConfiguration().getEl().evaluateValueExpression("#{foxRun}", FoxRun.class);
+ assert FoxRun.isDestroyed();
+ assert Fox.isDestroyed();
}
@Test(groups = { "contexts", "producerMethod" })
@SpecAssertion(section = "6.4.2", id = "ddd")
- public void testDependentsDestroyedWhenProducerMethodCompletes() throws Exception
+ public void testDependentsDestroyedWhenProducerMethodCompletes()
{
// Reset the test class
SpiderProducer.setDestroyed(false);
- Tarantula spiderInstance = getInstanceByType(Tarantula.class);
+ Tarantula spiderInstance = getInstanceByType(Tarantula.class, PET_LITERAL);
spiderInstance.ping();
- assert spiderInstance != null;
assert SpiderProducer.isDestroyed();
}
@Test(groups = { "contexts", "producerField" })
@SpecAssertion(section = "6.4.2", id = "ddd")
- public void testDependentsDestroyedWhenProducerFieldCompletes() throws Exception
+ public void testDependentsDestroyedWhenProducerFieldCompletes()
{
- new RunInDependentContext()
- {
+ // Reset the test class
+ OtherSpiderProducer.setDestroyed(false);
- @Override
- protected void execute() throws Exception
- {
- // Reset the test class
- OtherSpiderProducer.setDestroyed(false);
-
- Tarantula spiderInstance = getInstanceByType(Tarantula.class,TAME_LITERAL);
- assert spiderInstance != null;
- assert OtherSpiderProducer.isDestroyed();
-
- }
-
- }.run();
+ Tarantula spiderInstance = getInstanceByType(Tarantula.class,TAME_LITERAL);
+ assert spiderInstance != null;
+ assert OtherSpiderProducer.isDestroyed();
}
- @Test(groups = { "contexts", "disposalMethod", "ri-broken" })
+ @Test(groups = { "contexts", "disposalMethod" })
@SpecAssertion(section = "6.4.2", id = "ddd")
- public void testDependentsDestroyedWhenDisposerMethodCompletes() throws Exception
+ public void testDependentsDestroyedWhenDisposerMethodCompletes()
{
- new RunInDependentContext()
- {
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
+ assert tarantula != null;
- @Override
- protected void execute() throws Exception
- {
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
- Tarantula tarantula = tarantulaBean.create(creationalContext);
- assert tarantula != null;
-
- // Reset test class state
- SpiderProducer.setDestroyed(false);
-
- tarantulaBean.destroy(tarantula, creationalContext);
- assert SpiderProducer.isDestroyed();
- }
+ // Reset test class state
+ SpiderProducer.setDestroyed(false);
- }.run();
+ tarantulaBean.destroy(tarantula, creationalContext);
+ assert SpiderProducer.isDestroyed();
}
@Test(groups = { "contexts", "observerMethod" })
@SpecAssertion(section = "6.4.2", id = "ddd")
- public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes() throws Exception
+ public void testDependentsDestroyedWhenObserverMethodEvaluationCompletes()
{
- new RunInDependentContext()
- {
+ // Reset test class state...
+ HorseStable.setInstanceThatObservedEvent(null);
+ HorseStable.setDestroyed(false);
- @Override
- protected void execute() throws Exception
- {
- // Reset test class state...
- HorseStable.setInstanceThatObservedEvent(null);
- HorseStable.setDestroyed(false);
-
- getCurrentManager().fireEvent(new HorseInStableEvent());
- assert HorseStable.getInstanceThatObservedEvent() != null;
- assert HorseStable.isDestroyed();
- }
-
- }.run();
+ getCurrentManager().fireEvent(new HorseInStableEvent());
+ assert HorseStable.getInstanceThatObservedEvent() != null;
+ assert HorseStable.isDestroyed();
}
-
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Pet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Pet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Pet.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.context.dependent;
+
+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
+public @interface Pet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/Pet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -2,6 +2,7 @@
import javax.annotation.PreDestroy;
import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
@@ -15,15 +16,15 @@
private static boolean dependentContextActive = false;
private static boolean destroyed = false;
private static SpiderProducer instanceUsedForDisposal = null;
-
-
- @Produces public Tarantula produceTarantula()
+
+
+ @Produces @Pet public Tarantula produceTarantula(@Current Tarantula spider)
{
dependentContextActive = beanManager.getContext(Dependent.class).isActive();
- return new Tarantula();
+ return spider;
}
- public void disposeTarantula(@Disposes Tarantula tarantula)
+ public void disposeTarantula(@Disposes @Pet Tarantula tarantula)
{
dependentContextActive = beanManager.getContext(Dependent.class).isActive();
instanceUsedForDisposal = this;
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 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/DecoratorDefinitionTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -148,7 +148,7 @@
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();
+ assert getCurrentManager().resolveDecorators(Field.TYPES).isEmpty();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DefangedTarantula.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -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/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 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -49,7 +49,6 @@
}.run();
assert SpiderProducer.isTameSpiderDestroyed();
- assert SpiderProducer.isCurrentSpiderDestroyed();
}
@Test
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/SpiderProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -7,17 +7,11 @@
class SpiderProducer
{
private static boolean tameSpiderDestroyed = false;
- private static boolean currentSpiderDestroyed = false;
private static boolean deadliestSpiderDestroyed = false;
- @Produces public Tarantula produceTarantula()
- {
- return new Tarantula();
- }
-
@Produces @Tame public Tarantula produceTameTarantula()
{
- return new DefangedTarantula();
+ return new DefangedTarantula(0);
}
@Produces @Deadliest public Tarantula producesDeadliestTarantula(@Tame Tarantula tameTarantula,
@@ -32,11 +26,6 @@
SpiderProducer.tameSpiderDestroyed = true;
}
- public static void destroyCurrentSpider(@Disposes @Current Tarantula spider)
- {
- SpiderProducer.currentSpiderDestroyed = true;
- }
-
public static void destroyDeadliestSpider(@Disposes @Deadliest Tarantula spider, @Current Tarantula anotherSpider)
{
assert spider != anotherSpider;
@@ -48,11 +37,6 @@
return tameSpiderDestroyed;
}
- public static boolean isCurrentSpiderDestroyed()
- {
- return currentSpiderDestroyed;
- }
-
public static boolean isDeadliestSpiderDestroyed()
{
return deadliestSpiderDestroyed;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/OtherSpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/OtherSpiderProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/OtherSpiderProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -6,10 +6,10 @@
class OtherSpiderProducer
{
- public static final Tarantula TARANTULA = new Tarantula();
public static final BlackWidow BLACK_WIDOW = new BlackWidow();
+ public static final WolfSpider WOLF_SPIDER = new WolfSpider();
- @Produces @Tame public Tarantula produceTarantula = TARANTULA;
+ @Produces @Pet public WolfSpider produceWolfSpider = WOLF_SPIDER;
@Produces @Tame private BlackWidow produceBlackWidow = BLACK_WIDOW;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Pet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Pet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Pet.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.field.definition;
+
+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
+public @interface Pet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Pet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/ProducerFieldDefinitionTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -26,6 +26,7 @@
public class ProducerFieldDefinitionTest extends AbstractJSR299Test
{
private static final Annotation TAME_LITERAL = new AnnotationLiteral<Tame>() {};
+ private static final Annotation PET_LITERAL = new AnnotationLiteral<Pet>() {};
private static final Annotation FOO_LITERAL = new AnnotationLiteral<Foo>() {};
private static final Annotation STATIC_LITERAL = new AnnotationLiteral<Static>() {};
@@ -54,7 +55,7 @@
public void testBeanDeclaresMultipleProducerFields()
{
assert getBeans(Tarantula.class, TAME_LITERAL).size() == 1;
- assert getInstanceByType(Tarantula.class,TAME_LITERAL).equals(OtherSpiderProducer.TARANTULA) ;
+ assert getInstanceByType(WolfSpider.class,PET_LITERAL).equals(OtherSpiderProducer.WOLF_SPIDER) ;
assert getBeans(BlackWidow.class, TAME_LITERAL).size() == 1;
assert getInstanceByType(BlackWidow.class,TAME_LITERAL).equals(OtherSpiderProducer.BLACK_WIDOW) ;
}
@@ -65,8 +66,8 @@
})
public void testDefaultBindingType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
- assert tarantulaBeans.size() == 1;
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, new CurrentLiteral());
+ assert tarantulaBeans.size() == 2;
assert tarantulaBeans.iterator().next().getBindings().contains(new CurrentLiteral());
}
@@ -74,7 +75,7 @@
@SpecAssertion(section = "3.4.1", id = "c")
public void testApiTypeForClassReturn()
{
- Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class);
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, PET_LITERAL);
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaBean = tarantulaBeans.iterator().next();
assert tarantulaBean.getTypes().size() == 6;
@@ -132,10 +133,10 @@
})
public void testBindingType()
{
- Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, new TameAnnotationLiteral());
+ Set<Bean<Tarantula>> tarantulaBeans = getBeans(Tarantula.class, TAME_LITERAL);
assert tarantulaBeans.size() == 1;
Bean<Tarantula> tarantulaModel = tarantulaBeans.iterator().next();
- assert tarantulaModel.getBindings().size() == 2;
+ assert tarantulaModel.getBindings().size() == 3;
assert tarantulaModel.getBindings().contains(TAME_LITERAL);
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameAnnotationLiteral.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameAnnotationLiteral.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TameAnnotationLiteral.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.implementation.producer.field.definition;
-
-import javax.enterprise.inject.AnnotationLiteral;
-
-class TameAnnotationLiteral extends AnnotationLiteral<Tame> implements Tame
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/TarantulaProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -4,6 +4,6 @@
class TarantulaProducer
{
- @Produces public Tarantula produceTarantula = new Tarantula();
+ @Produces @Pet public Tarantula produceTarantula = new Tarantula();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowConsumer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowConsumer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowConsumer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -17,7 +17,6 @@
package org.jboss.jsr299.tck.tests.implementation.producer.field.lifecycle;
-import javax.enterprise.inject.Current;
/**
* This simple bean contains an injection point to receive the value of a
@@ -28,7 +27,7 @@
*/
public class BlackWidowConsumer
{
- @Current
+ @Tame
private BlackWidow injectedSpider;
public BlackWidow getInjectedSpider()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/BlackWidowProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -6,7 +6,7 @@
public class BlackWidowProducer
{
public static BlackWidow blackWidow = new BlackWidow();
- @Produces
+ @Produces @Tame
@Named("blackWidow")
public BlackWidow produceBlackWidow = blackWidow;
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/Tame.java (from rev 3118, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/definition/Tame.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/Tame.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.field.lifecycle;
+
+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 Tame
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaConsumer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaConsumer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaConsumer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -17,7 +17,6 @@
package org.jboss.jsr299.tck.tests.implementation.producer.field.lifecycle;
-import javax.enterprise.inject.Current;
/**
* This bean contains an injection point for a Tarantula that must be provided
@@ -28,7 +27,7 @@
*/
public class TarantulaConsumer
{
- @Current
+ @Tame
private Tarantula consumedTarantula;
public Tarantula getConsumedTarantula()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/field/lifecycle/TarantulaProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -4,6 +4,6 @@
public class TarantulaProducer
{
- @Produces public Tarantula produceTarantula = new Tarantula();
+ @Produces @Tame public Tarantula produceTarantula = new DefangedTarantula();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Lays.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -5,7 +5,7 @@
class Lays
{
- @Produces @RequestScoped
+ @Produces @Delicious @RequestScoped
public PotatoChip makeChip()
{
return null;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+
+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
+public @interface Pet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/Pet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -1,6 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+import java.lang.annotation.Annotation;
+
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -21,64 +24,40 @@
public class ProducerMethodLifecycleTest extends AbstractJSR299Test
{
+ private static final Annotation PET_LITERAL = new AnnotationLiteral<Pet> () {};
+ private static final Annotation DELICIOUS_LITERAL = new AnnotationLiteral<Delicious> () {};
+
@Test(groups = { "producerMethod", "disposalMethod" })
@SpecAssertion(section = "7.3.4", id = "ma")
- public void testProducerMethodBeanDestroy() throws Exception
+ public void testProducerMethodBeanDestroy()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- SpiderProducer.setTarantulaDestroyed(false);
- Tarantula tarantula = getInstanceByType(Tarantula.class);
- Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
- tarantulaBean.destroy(tarantula, creationalContext);
- assert SpiderProducer.isTarantulaDestroyed();
- assert SpiderProducer.isDestroyArgumentsSet();
- assert !SpiderProducerNotUsed.isTarantulaDestroyed();
- }
-
- }.run();
+ SpiderProducer.setTarantulaDestroyed(false);
+ Tarantula tarantula = getInstanceByType(Tarantula.class, PET_LITERAL);
+ Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ tarantulaBean.destroy(tarantula, creationalContext);
+ assert SpiderProducer.isTarantulaDestroyed();
+ assert SpiderProducer.isDestroyArgumentsSet();
+ assert !SpiderProducerNotUsed.isTarantulaDestroyed();
}
@Test(groups = { "producerMethod" })
@SpecAssertion(section = "7.3.4", id = "review")
- public void testProducerMethodBeanCreate() throws Exception
+ public void testProducerMethodBeanCreate()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(Tarantula.class);
- assert SpiderProducer.isTarantulaCreated();
- }
-
- }.run();
+ getInstanceByType(Tarantula.class, PET_LITERAL);
+ assert SpiderProducer.isTarantulaCreated();
}
@Test(groups = { "producerMethod" })
@SpecAssertions({
@SpecAssertion(section = "7.3.4", id = "ea")
})
- public void testProducerMethodInvokedOnCreate() throws Exception
+ public void testProducerMethodInvokedOnCreate()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class).iterator().next();
- CreationalContext<SpiderEgg> creationalContext = getCurrentManager().createCreationalContext(eggBean);
- assert eggBean.create(creationalContext) != null;
- }
-
- }.run();
+ Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class).iterator().next();
+ CreationalContext<SpiderEgg> creationalContext = getCurrentManager().createCreationalContext(eggBean);
+ assert eggBean.create(creationalContext) != null;
}
@Test(groups = { "producerMethod", "rewrite" })
@@ -86,21 +65,14 @@
@SpecAssertions({
@SpecAssertion(section = "review", id = "review")
})
- public void testProducerMethodFromMostSpecializedBeanUsed() throws Exception
+ public void testProducerMethodFromMostSpecializedBeanUsed()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Tarantula.setNumberCreated(0);
- Bean<Tarantula> spiderBean = getBeans(Tarantula.class).iterator().next();
- CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(spiderBean);
- Tarantula tarantula = spiderBean.create(creationalContext);
- assert tarantula.getValue().equals("Pete");
- assert Tarantula.getNumberCreated() == 1;
- }
- }.run();
+ Tarantula.setNumberCreated(0);
+ Bean<Tarantula> spiderBean = getBeans(Tarantula.class, PET_LITERAL).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(spiderBean);
+ Tarantula tarantula = spiderBean.create(creationalContext);
+ assert tarantula.getValue().equals("Pete");
+ assert Tarantula.getNumberCreated() == 1;
}
@Test(groups = { "producerMethod" })
@@ -121,7 +93,7 @@
// TODO I'm not quite sure what this test is currently doing!
public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
{
- Bean<PotatoChip> chipBean = getBeans(PotatoChip.class).iterator().next();
+ Bean<PotatoChip> chipBean = getBeans(PotatoChip.class, DELICIOUS_LITERAL).iterator().next();
CreationalContext<PotatoChip> creationalContext = getCurrentManager().createCreationalContext(chipBean);
assert chipBean.create(creationalContext) == null;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/SpiderProducer.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -11,7 +11,7 @@
private static boolean tarantulaDestroyed;
private static boolean destroyArgumentsSet;
- @Produces public Tarantula produceTarantula()
+ @Produces @Pet public Tarantula produceTarantula()
{
tarantulaCreated = true;
tarantulaDestroyed = false;
@@ -24,7 +24,7 @@
return null;
}
- public static void destroyTarantula(@Disposes Tarantula spider, @Current BeanManager beanManager)
+ public static void destroyTarantula(@Disposes @Pet Tarantula spider, @Current BeanManager beanManager)
{
tarantulaDestroyed = true;
if (beanManager != null)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -49,33 +49,17 @@
@Test
@SpecAssertion(section = "3.1.4.2", id = "b")
- public void testBindingTypeAnnotatedConstructor() throws Exception
+ public void testBindingTypeAnnotatedConstructor()
{
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(Duck.class);
- assert Duck.constructedCorrectly;
- }
- }.run();
+ getInstanceByType(Duck.class);
+ assert Duck.constructedCorrectly;
}
@Test(groups = { "specialization" })
@SpecAssertion(section = "3.1.5", id = "aa")
- public void testSpecializedBeanAlwaysUsed() throws Exception
+ public void testSpecializedBeanSpecializesAnotherBean()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getInstanceByType(Lion.class,TAME_LITERAL) instanceof MountainLion;
- }
-
- }.run();
+ assert !getBeans(MountainLion.class, TAME_LITERAL).isEmpty();
}
@Test(groups = "beanLifecycle")
@@ -84,25 +68,16 @@
@SpecAssertion(section = "6.1.1", id = "d"),
@SpecAssertion(section = "6.1.1", id = "e")
})
- public void testCreateReturnsSameBeanPushed() throws Exception
+ public void testCreateReturnsSameBeanPushed()
{
final CreationalContext<ShoeFactory> creationalContext = new MockCreationalContext<ShoeFactory>();
final Contextual<ShoeFactory> bean = getBeans(ShoeFactory.class).iterator().next();
MockCreationalContext.reset();
- new RunInDependentContext()
+ ShoeFactory instance = getCurrentManager().getContext(Dependent.class).get(bean, creationalContext);
+ if (MockCreationalContext.isPushCalled())
{
-
- @Override
- protected void execute() throws Exception
- {
- ShoeFactory instance = getCurrentManager().getContext(Dependent.class).get(bean, creationalContext);
- if (MockCreationalContext.isPushCalled())
- {
- assert instance.equals(MockCreationalContext.getLastBeanPushed());
- }
- }
-
- }.run();
+ assert instance.equals(MockCreationalContext.getLastBeanPushed());
+ }
}
@Test(groups = "beanLifecycle")
@@ -205,148 +180,88 @@
@Test
@SpecAssertion(section = "4.2", id = "baa")
- public void testSubClassInheritsPostConstructOnSuperclass() throws Exception
+ public void testSubClassInheritsPostConstructOnSuperclass()
{
OrderProcessor.postConstructCalled = false;
assert getBeans(CdOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(CdOrderProcessor.class).order();
- }
- }.run();
+ getInstanceByType(CdOrderProcessor.class).order();
assert OrderProcessor.postConstructCalled;
}
@Test
@SpecAssertion(section = "4.2", id = "bac")
- public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ public void testIndirectSubClassInheritsPostConstructOnSuperclass()
{
OrderProcessor.postConstructCalled = false;
assert getBeans(IndirectOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(IndirectOrderProcessor.class).order();
- }
- }.run();
+ getInstanceByType(IndirectOrderProcessor.class).order();
assert OrderProcessor.postConstructCalled;
}
@Test
@SpecAssertion(section = "4.2", id = "bba")
- public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ public void testSubClassInheritsPreDestroyOnSuperclass()
{
OrderProcessor.preDestroyCalled = false;
assert getBeans(CdOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<CdOrderProcessor> bean = getBeans(CdOrderProcessor.class).iterator().next();
- CreationalContext<CdOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
- CdOrderProcessor instance = getInstanceByType(CdOrderProcessor.class);
- bean.destroy(instance, creationalContext);
- }
- }.run();
+ Bean<CdOrderProcessor> bean = getBeans(CdOrderProcessor.class).iterator().next();
+ CreationalContext<CdOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ CdOrderProcessor instance = getInstanceByType(CdOrderProcessor.class);
+ bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
}
@Test
@SpecAssertion(section = "4.2", id = "bbc")
- public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ public void testIndirectSubClassInheritsPreDestroyOnSuperclass()
{
OrderProcessor.preDestroyCalled = false;
assert getBeans(IndirectOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
- CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
- IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
- bean.destroy(instance, creationalContext);
- }
- }.run();
+ Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
+ bean.destroy(instance, creationalContext);
assert OrderProcessor.preDestroyCalled;
}
@Test
@SpecAssertion(section = "4.2", id = "baa")
- public void testSubClassDoesNotInheritPostConstructOnSuperclassBlockedByIntermediateClass() throws Exception
+ public void testSubClassDoesNotInheritPostConstructOnSuperclassBlockedByIntermediateClass()
{
assert getBeans(NovelOrderProcessor.class).size() == 1;
OrderProcessor.postConstructCalled = false;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(NovelOrderProcessor.class).order();
- }
- }.run();
+ getInstanceByType(NovelOrderProcessor.class).order();
assert !OrderProcessor.postConstructCalled;
}
@Test
@SpecAssertion(section = "4.2", id = "bba")
- public void testSubClassDoesNotInheritPreDestroyConstructOnSuperclassBlockedByIntermediateClass() throws Exception
+ public void testSubClassDoesNotInheritPreDestroyConstructOnSuperclassBlockedByIntermediateClass()
{
OrderProcessor.preDestroyCalled = false;
assert getBeans(NovelOrderProcessor.class).size() == 1;
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- Bean<NovelOrderProcessor> bean = getBeans(NovelOrderProcessor.class).iterator().next();
- CreationalContext<NovelOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
- NovelOrderProcessor instance = getInstanceByType(NovelOrderProcessor.class);
- bean.destroy(instance, creationalContext);
- }
- }.run();
+ Bean<NovelOrderProcessor> bean = getBeans(NovelOrderProcessor.class).iterator().next();
+ CreationalContext<NovelOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
+ NovelOrderProcessor instance = getInstanceByType(NovelOrderProcessor.class);
+ bean.destroy(instance, creationalContext);
assert !OrderProcessor.preDestroyCalled;
}
@Test(expectedExceptions = CreationException.class)
@SpecAssertion(section = "review", id = "review") // removed from spec?
- public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate() throws Exception
+ public void testCreationExceptionWrapsCheckedExceptionThrownFromCreate()
{
assert getBeans(Lorry_Broken.class).size() == 1;
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(Lorry_Broken.class);
- }
-
- }.run();
+ getInstanceByType(Lorry_Broken.class);
}
@Test(expectedExceptions = FooException.class)
@SpecAssertion(section = "review", id = "review") // removed from spec?
- public void testUncheckedExceptionThrownFromCreateNotWrapped() throws Exception
+ public void testUncheckedExceptionThrownFromCreateNotWrapped()
{
assert getBeans(Van_Broken.class).size() == 1;
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- getInstanceByType(Van_Broken.class);
- }
-
- }.run();
+ getInstanceByType(Van_Broken.class);
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/enterprise/EnterpriseBeanSpecializationTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -33,11 +33,11 @@
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
- Bean<FarmerLocal> bean = getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
- assert getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 3;
- assert annotationSetMatches( getCurrentManager().getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class, Any.class);
+ assert getCurrentManager().getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
+ Bean<LazyFarmerLocal> bean = getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).iterator().next();
+ assert getCurrentManager().getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(FarmerLocal.class);
+ assert getCurrentManager().getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches( getCurrentManager().getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getBindings(), Landowner.class, Lazy.class, Any.class);
}
@Test
@@ -46,9 +46,8 @@
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
- assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmerLocal.class);
- assert getBeans(FarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
+ assert getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).size() == 1;
+ assert getBeans(LazyFarmerLocal.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/JewelryShop.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/JewelryShop.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/JewelryShop.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -6,7 +6,7 @@
class JewelryShop extends Shop
{
@Override @Produces @Specializes @Sparkly
- public Product getExpensiveGift()
+ public Necklace getExpensiveGift()
{
return new Necklace();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/ProducerMethodSpecializationTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -13,7 +13,7 @@
import org.testng.annotations.Test;
/**
- * Spec version: 20090519
+ * Spec version: 20090625
*
*/
@Artifact
@@ -22,29 +22,21 @@
{
private static Annotation EXPENSIVE_LITERAL = new AnnotationLiteral<Expensive>() {};
+ private static Annotation SPARKLY_LITERAL = new AnnotationLiteral<Sparkly>() {};
@Test
@SpecAssertions({
- @SpecAssertion(section = "3.4.4", id = "aa")
+ @SpecAssertion(section = "5.6.6", id = "c")
})
- public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean() throws Exception
+ public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
- assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).size() == 1;
- assert getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings().size() == 3;
- assert annotationSetMatches( getCurrentManager().getBeans(Product.class, EXPENSIVE_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class, Any.class);
- assert getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).size() == 1;
- assert getBeans(Product.class, new AnnotationLiteral<Sparkly>(){}).iterator().next().getName().equals("expensiveGift");
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Product product = getInstanceByType(Product.class,EXPENSIVE_LITERAL);
- assert product instanceof Necklace;
- }
-
- }.run();
+ assert getCurrentManager().getBeans(Necklace.class, EXPENSIVE_LITERAL, SPARKLY_LITERAL).size() == 1;
+ assert getCurrentManager().getBeans(Necklace.class, EXPENSIVE_LITERAL, SPARKLY_LITERAL).iterator().next().getBindings().size() == 3;
+ assert annotationSetMatches( getCurrentManager().getBeans(Necklace.class, EXPENSIVE_LITERAL, SPARKLY_LITERAL).iterator().next().getBindings(), Expensive.class, Sparkly.class, Any.class);
+ assert getBeans(Necklace.class, new AnnotationLiteral<Sparkly>(){}).size() == 1;
+ assert getBeans(Necklace.class, new AnnotationLiteral<Sparkly>(){}).iterator().next().getName().equals("expensiveGift");
+ Product product = getInstanceByType(Product.class,EXPENSIVE_LITERAL, SPARKLY_LITERAL);
+ assert product instanceof Necklace;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/Shop.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/Shop.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/producer/method/Shop.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -8,9 +8,9 @@
{
@Produces @Expensive @Named
- public Product getExpensiveGift()
+ public Necklace getExpensiveGift()
{
- return new Product();
+ return new Necklace();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-07-21 22:13:24 UTC (rev 3120)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-07-21 22:21:05 UTC (rev 3121)
@@ -35,9 +35,9 @@
})
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
- assert getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
- Bean<?> bean = getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next();
- assert bean.getTypes().contains(LazyFarmer.class);
+ assert getBeans(LazyFarmer.class, LANDOWNER_LITERAL).size() == 1;
+ Bean<?> bean = getBeans(LazyFarmer.class, LANDOWNER_LITERAL).iterator().next();
+ assert bean.getTypes().contains(Farmer.class);
assert bean.getBindings().size() == 3;
assert annotationSetMatches(bean.getBindings(), Landowner.class, Lazy.class, Any.class);
}
@@ -49,43 +49,17 @@
})
public void testSpecializingBeanHasNameOfSpecializedBean()
{
- assert getBeans(Farmer.class, LANDOWNER_LITERAL).size() == 1;
- assert getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
- assert "farmer".equals(getBeans(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName());
+ assert getBeans(LazyFarmer.class, LANDOWNER_LITERAL).size() == 1;
+ assert "farmer".equals(getBeans(LazyFarmer.class, LANDOWNER_LITERAL).iterator().next().getName());
}
@Test
- public void testSpecializedBeanNotInstantiated() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Farmer farmer = getInstanceByType(Farmer.class,LANDOWNER_LITERAL);
- assert farmer.getClassName().equals(LazyFarmer.class.getName());
- }
-
- }.run();
- }
-
- @Test
@SpecAssertions( {
@SpecAssertion(section = "4.3.2", id = "a")
})
- public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean() throws Exception
+ public void testProducerMethodOnSpecializedBeanCalledOnSpecializingBean()
{
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(Waste.class).size() == 1;
- assert getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
- }
-
- }.run();
+ assert getBeans(Waste.class).size() == 1;
+ assert getInstanceByType(Waste.class).getFrom().equals(Office.class.getName());
}
}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3120 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-07-21 18:13:24 -0400 (Tue, 21 Jul 2009)
New Revision: 3120
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
mark assertion about undefined state as not testable
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 18:05:26 UTC (rev 3119)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 22:13:24 UTC (rev 3120)
@@ -2209,7 +2209,7 @@
<text>If an exception occurs while destroying an instance, the exception must be caught by the |destroy()| method.</text>
</assertion>
- <assertion id="a2">
+ <assertion id="a2" testable="false">
<text>If the application invokes a contextual instance after it has been destroyed, the behavior is undefined.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3119 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-21 14:05:26 -0400 (Tue, 21 Jul 2009)
New Revision: 3119
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Mark some assertions untestable
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 16:27:31 UTC (rev 3118)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-07-21 18:05:26 UTC (rev 3119)
@@ -4160,12 +4160,15 @@
</section>
<section id="11.4" title="Alternative metadata sources">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>The interfaces |AnnotatedType|, |AnnotatedField|, |AnnotatedMethod|, |AnnotatedConstructor| and |AnnotatedParameter| in the package |javax.enterprise.inject.spi| allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container.</text>
+ <note>Statement of intent</note>
</assertion>
- <assertion id="b">
+ <assertion id="b" testable="false">
<text>The interface |javax.enterprise.inject.spi.Annotated| exposes the overriding annotations and type declarations.</text>
+ <note>Statement of intent</note>
+
</assertion>
<assertion id="c">
@@ -4194,8 +4197,9 @@
</section>
<section id="11.5" title="Container lifecycle events">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process defined in Section 12.2, "Application initialization lifecycle".</text>
+ <note>Generic statement</note>
</assertion>
<assertion id="b">
@@ -4512,14 +4516,16 @@
<text>If a bean is deployed in an archive or directory that does not contain a file named |beans.xml| in the metadata directory, it will not be discovered by the container.</text>
</assertion>
- <assertion id="d">
+ <assertion id="d" testable="false">
<text>If a bean class is deployed in two different bean deployment archives, non-portable behaviour results. Portable applications must deploy each bean class in exactly one bean deployment archive.</text>
+ <note>Describes undefined behavior</note>
</assertion>
</section>
<section id="12.2" title="Application initialization lifecycle">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>When an application is started, the container performs the following steps.</text>
+ <note>Description</note>
</assertion>
<assertion id="b">
@@ -4619,16 +4625,19 @@
<text>Deployment problems are detected by the container at initialization time. If a deployment problem exists in a deployment, initialization will be aborted by the container.</text>
</assertion>
- <assertion id="d">
+ <assertion id="d" testable="false">
<text>The container is permitted to define a non-portable mode, for use at development time, in which some definition errors and deployment problems do not cause application initialization to abort.</text>
+ <note>Specifies undefined behavior</note>
</assertion>
- <assertion id="e">
+ <assertion id="e" testable="false">
<text>Exceptions represent problems that may not be detected until they actually occur at runtime. All exceptions defined by this specification are unchecked exceptions.</text>
+ <note>Explanatory note</note>
</assertion>
- <assertion id="f">
+ <assertion id="f" testable="false">
<text>All exceptions defined by this specification may be safely caught and handled by the application.</text>
+ <note>Explanatory note</note>
</assertion>
</section>
15 years, 4 months