[webbeans-commits] Webbeans SVN: r3409 - in extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se: discovery and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: peteroyle
Date: 2009-08-09 06:29:46 -0400 (Sun, 09 Aug 2009)
New Revision: 3409
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
Log:
Updated for API change: Iterable --> Collection, and stricter validation of Binding Types.
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java 2009-08-07 18:54:14 UTC (rev 3408)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java 2009-08-09 10:29:46 UTC (rev 3409)
@@ -29,5 +29,5 @@
*/
@BindingType
@Retention(RetentionPolicy.RUNTIME)
-@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
+@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE })
public @interface Parameters {}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java 2009-08-07 18:54:14 UTC (rev 3408)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEBeanDeploymentArchive.java 2009-08-09 10:29:46 UTC (rev 3409)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.environment.se.discovery;
import java.net.URL;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
@@ -42,7 +43,7 @@
/**
* @return a collection of all Bean classes on the classpath.
*/
- public Iterable<Class<?>> getBeanClasses()
+ public Collection<Class<?>> getBeanClasses()
{
return wbDiscovery.getWbClasses();
}
@@ -59,7 +60,7 @@
/**
* @return all beans.xml decriptors found on the classpath.
*/
- public Iterable<URL> getBeansXml()
+ public Collection<URL> getBeansXml()
{
return wbDiscovery.discoverWebBeansXml();
}
@@ -67,7 +68,7 @@
/**
* @return an empty collection since there are no EJBs in Java SE.
*/
- public Iterable<EjbDescriptor<?>> getEjbs()
+ public Collection<EjbDescriptor<?>> getEjbs()
{
return Collections.EMPTY_SET;
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java 2009-08-07 18:54:14 UTC (rev 3408)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java 2009-08-09 10:29:46 UTC (rev 3409)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.environment.se.discovery;
import java.net.URL;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -50,7 +51,7 @@
return Collections.unmodifiableSet(wbClasses);
}
- public Iterable<URL> discoverWebBeansXml()
+ public Collection<URL> discoverWebBeansXml()
{
return Collections.unmodifiableSet(wbUrls);
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-08-07 18:54:14 UTC (rev 3408)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-08-09 10:29:46 UTC (rev 3409)
@@ -31,5 +31,5 @@
*/
@BindingType
@Retention(RetentionPolicy.RUNTIME)
-@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
+@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD, ElementType.TYPE })
public @interface Shutdown{}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3408 - in tck/trunk/impl/src/main: resources and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-07 14:54:14 -0400 (Fri, 07 Aug 2009)
New Revision: 3408
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/producer/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/producer/javax.enterprise.inject.spi.Extension
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Assigned more assertions in chapter 11, fixed a few typos, and fixed up ProcessProducer tests.
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java 2009-08-07 18:02:55 UTC (rev 3407)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java 2009-08-07 18:54:14 UTC (rev 3408)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.extensions.producer;
+import javax.enterprise.inject.Current;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
@@ -12,7 +13,7 @@
private Dog quietDog = new Dog(DOG_COLOR);
@Produces @Noisy
- public Dog produceNoisyDog()
+ public Dog produceNoisyDog(@Current DogBed dogBed)
{
noisyDogProducerCalled = true;
return new Dog();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java 2009-08-07 18:02:55 UTC (rev 3407)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java 2009-08-07 18:54:14 UTC (rev 3408)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.extensions.producer;
+import javax.enterprise.inject.Current;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.Specializes;
@@ -22,8 +23,8 @@
return preferredQuietDog;
}
- @Override
- public Dog produceNoisyDog()
+ @Override @Produces @Noisy
+ public Dog produceNoisyDog(@Current DogBed dogBed)
{
return new Dog(DOG_COLOR);
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java 2009-08-07 18:02:55 UTC (rev 3407)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java 2009-08-07 18:54:14 UTC (rev 3408)
@@ -1,6 +1,8 @@
package org.jboss.jsr299.tck.tests.extensions.producer;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.ProcessProducer;
import javax.enterprise.inject.spi.Producer;
@@ -13,18 +15,21 @@
public void processDogProducer(@Observes ProcessProducer<Dog, Dog> producerEvent)
{
+ dogProducer = producerEvent.getProducer();
+ }
+
+ public void processDogProducerProducer(@Observes ProcessProducer<PreferredDogProducer, Dog> producerEvent)
+ {
if (producerEvent.getAnnotatedMember().isAnnotationPresent(Noisy.class))
{
noisyDogProducer = producerEvent.getProducer();
+ assert producerEvent.getAnnotatedMember() instanceof AnnotatedMethod<?>;
}
else if (producerEvent.getAnnotatedMember().isAnnotationPresent(Quiet.class))
{
quietDogProducer = producerEvent.getProducer();
+ assert producerEvent.getAnnotatedMember() instanceof AnnotatedField<?>;
}
- else
- {
- dogProducer = producerEvent.getProducer();
- }
}
public void processCatProducer(@Observes ProcessProducer<Cat, Cat> producerEvent)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java 2009-08-07 18:02:55 UTC (rev 3407)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java 2009-08-07 18:54:14 UTC (rev 3408)
@@ -22,7 +22,8 @@
{
@Test(groups = "ri-broken")
@SpecAssertions({
- @SpecAssertion(section = "11.2", id = "ba")
+ @SpecAssertion(section = "11.2", id = "ba"),
+ @SpecAssertion(section = "11.5.7", id = "b")
})
public void testProduceCallsInitializer()
{
@@ -108,7 +109,11 @@
@Test(groups = "ri-broken")
@SpecAssertions({
- @SpecAssertion(section = "11.2", id = "ea")
+ @SpecAssertion(section = "11.2", id = "ea"),
+ @SpecAssertion(section = "11.5.7", id = "a"),
+ @SpecAssertion(section = "11.5.7", id = "b"),
+ @SpecAssertion(section = "11.5.7", id = "c"),
+ @SpecAssertion(section = "11.5.7", id = "d")
})
public void testProduceCallsProducerMethod()
{
@@ -121,7 +126,11 @@
@Test(groups = "ri-broken")
@SpecAssertions({
- @SpecAssertion(section = "11.2", id = "eb")
+ @SpecAssertion(section = "11.2", id = "eb"),
+ @SpecAssertion(section = "11.5.7", id = "a"),
+ @SpecAssertion(section = "11.5.7", id = "b"),
+ @SpecAssertion(section = "11.5.7", id = "c"),
+ @SpecAssertion(section = "11.5.7", id = "d")
})
public void testProduceAccessesProducerField()
{
@@ -129,7 +138,7 @@
Dog dog = (Dog) producer.produce(new CreationalContextImpl<Dog>());
assert dog.getColor().equals(PreferredDogProducer.DOG_COLOR);
}
-
+
@Test(groups = "ri-broken")
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "fa")
@@ -142,7 +151,7 @@
producer.dispose(dog);
assert PreferredDogProducer.isNoisyDogDisposed();
}
-
+
@Test(groups = "ri-broken")
@SpecAssertions({
@SpecAssertion(section = "11.2", id = "fb")
@@ -155,4 +164,15 @@
producer.dispose(dog);
assert PreferredDogProducer.isQuietDogDisposed();
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "g")
+ })
+ public void testInjectionPointsForProducerMethod()
+ {
+ Producer<Dog> producer = ProducerProcessor.getNoisyDogProducer();
+ assert producer.getInjectionPoints().size() == 1;
+ assert producer.getInjectionPoints().iterator().next().getType().equals(DogBed.class);
+ }
}
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/producer/javax.enterprise.inject.spi.Extension (from rev 3405, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/deployment/lifecycle/javax.enterprise.inject.spi.Extension)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/producer/javax.enterprise.inject.spi.Extension (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/extensions/producer/javax.enterprise.inject.spi.Extension 2009-08-07 18:54:14 UTC (rev 3408)
@@ -0,0 +1 @@
+org.jboss.jsr299.tck.tests.extensions.producer.ProducerProcessor
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 18:02:55 UTC (rev 3407)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 18:54:14 UTC (rev 3408)
@@ -4376,7 +4376,7 @@
</assertion>
<assertion id="g">
- <text>For a Producer that represents a producer method or field, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all parameters of the producer method.</text>
+ <text>For a Producer that represents a producer method, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all parameters of the producer method.</text>
</assertion>
<assertion id="h">
@@ -4909,7 +4909,7 @@
</assertion>
<assertion id="h">
- <text>If any observer method of a |ProcessInjectionTarget| event throws an exception, the exception is treated as a definition error by the container.</text>
+ <text>If any observer method of a |ProcessProducer| event throws an exception, the exception is treated as a definition error by the container.</text>
</assertion>
</section>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3407 - in ri/trunk/tests: src/test/java/org/jboss/webbeans/test/unit and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-07 14:02:55 -0400 (Fri, 07 Aug 2009)
New Revision: 3407
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
Modified:
ri/trunk/tests/unit-tests.xml
Log:
Add security test to validate an assumption about setAccessible
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java 2009-08-07 18:02:55 UTC (rev 3407)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.test.unit.security;
+
+import java.lang.reflect.Field;
+
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+public class SecurityTest
+{
+
+ private String foo;
+
+ @Test
+ public void testSetAccessibleDoesNotPropagate() throws Exception
+ {
+ Field field = SecurityTest.class.getDeclaredField("foo");
+ assert !field.isAccessible();
+ field.setAccessible(true);
+ assert field.isAccessible();
+ assert !SecurityTest.class.getDeclaredField("foo").isAccessible();
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/security/SecurityTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/unit-tests.xml
===================================================================
--- ri/trunk/tests/unit-tests.xml 2009-08-07 18:01:19 UTC (rev 3406)
+++ ri/trunk/tests/unit-tests.xml 2009-08-07 18:02:55 UTC (rev 3407)
@@ -13,35 +13,11 @@
</method-selectors>
<groups>
<run>
-<!--
- <exclude name="specialization" />
- <exclude name="deployment" />
- <exclude name="disposalMethod" />
-
- <exclude name="observerMethod" />
- <exclude name="deferredEvent" />
- <exclude name="ejb3" />
- <exclude name="webservice" />
- <exclude name="annotationDefinition" />
- <exclude name="webbeansxml" />
- <exclude name="el" />
- <exclude name="jms" />
- <exclude name="interceptors" />
- <exclude name="decorators" />
- <exclude name="servlet" />
-
- <exclude name="passivation" />
- <exclude name="singletons" />
- <exclude name="ejbjarxml" />
- <exclude name="beanDestruction" />
- <exclude name="commonAnnotations" />
--->
<exclude name="stub" />
<exclude name="broken" />
</run>
</groups>
<packages>
-<!-- <package name="org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle" />-->
<package name="org.jboss.webbeans.test.examples" />
<package name="org.jboss.webbeans.test.unit.activities" />
@@ -76,8 +52,7 @@
<package name="org.jboss.webbeans.test.unit.lookup.circular" />
<package name="org.jboss.webbeans.test.unit.lookup.wbri279" />
<package name="org.jboss.webbeans.test.unit.manager" />
- <package name="org.jboss.webbeans.test.unit.servlet" />
- <package name="org.jboss.webbeans.test.unit.xml.deploy" />
+ <package name="org.jboss.webbeans.test.unit.security" />
</packages>
</test>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3405 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-07 10:41:00 -0400 (Fri, 07 Aug 2009)
New Revision: 3405
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
Groupings
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 13:02:37 UTC (rev 3404)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 14:41:00 UTC (rev 3405)
@@ -3364,13 +3364,30 @@
</section>
<section id="7.2" title="Container invocations and interception">
- <assertion id="e">
- <text>When the container invokes a method of a bean, if, and only if, the invocation is a business method invocation it passes through the method interceptor and decorator stacks, ~and in the case of a session bean, it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by the EJB specification.~</text>
- </assertion>
+ <group>
+ <text>When the container invokes a method of a bean, if, and only if, the invocation is a business method invocation it passes through the method interceptor and decorator stacks, and in the case of a session bean, it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by the EJB specification.</text>
+
+ <assertion id="a">
+ <text>Verify that a managed bean's business methods are intercepted</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Verify that a managed bean's business methods are decorated</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Verify that a session bean's business methods are intercepted</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Verify that a session bean's business methods are decorated</text>
+ </assertion>
- <assertion id="f">
- <text>When the container invokes a method of a bean, if, and only if, the invocation is a business method invocation it passes through the method interceptor and decorator stacks, and in the case of a session bean, _it is subject to EJB services such a declarative transaction management, concurrency, security and asynchronicity, as defined by the EJB specification._</text>
- </assertion>
+ <assertion id="f" testable="false">
+ <text>Verify that a session bean's business methods receive EJB services</text>
+ <note>This is tested by the EJB TCK</note>
+ </assertion>
+ </group>
<assertion id="g">
<text>If the invocation is not a business method invocation, it is treated as a normal Java method call and is not intercepted by the container.</text>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3404 - ri/trunk/impl and 44 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-08-07 09:02:37 -0400 (Fri, 07 Aug 2009)
New Revision: 3404
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ForwardingWBCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/WBCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELContextListener.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansExpressionFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplication.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplicationFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplication.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplicationFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/JspInitialization.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationList.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingExpressionFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingMethodExpression.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingValueExpression.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/CowShed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/DelegateInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/MockLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/CowShed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/DelegateInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/MockLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/CowShed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/DelegateFieldInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/MockLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/CowShed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/DelegateInjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/Logger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/MockLogger.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationIterable.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/jpa/spi/
Modified:
ri/trunk/api/src/main/java/javax/decorator/Decorates.java
ri/trunk/impl/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/CreationalContextImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/DefaultResourceLoader.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingWebBeanDiscovery.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/ForwardingResourceLoader.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el/EL.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/version-matrix/pom.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
WBRI-322, also ensure dependent instance always used for an evaluation, alter SPI methods to expose collection, not Iterable, add some decorator tests
Modified: ri/trunk/api/src/main/java/javax/decorator/Decorates.java
===================================================================
--- ri/trunk/api/src/main/java/javax/decorator/Decorates.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/api/src/main/java/javax/decorator/Decorates.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,23 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-* http://www.apache.org/licenses/LICENSE-2.0
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * 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 javax.decorator;
import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
@@ -25,12 +26,13 @@
import java.lang.annotation.Target;
/**
- * Specifies that a field of a decorator class is the delegate attribute.
+ * Specifies that an injected field, initializer method parameter or bean
+ * constructor parameter of a decorator class is the delegate attribute.
*
* @author Gavin King
* @author Pete Muir
*/
-@Target(FIELD)
+@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
@Documented
public @interface Decorates
Modified: ri/trunk/impl/pom.xml
===================================================================
--- ri/trunk/impl/pom.xml 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/pom.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -56,6 +56,12 @@
<artifactId>servlet-api</artifactId>
<optional>true</optional>
</dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <optional>true</optional>
+ </dependency>
<dependency>
<groupId>javax.transaction</groupId>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -69,6 +69,7 @@
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.context.WBCreationalContext;
import org.jboss.webbeans.el.Namespace;
import org.jboss.webbeans.el.WebBeansELResolverImpl;
import org.jboss.webbeans.introspector.WBAnnotated;
@@ -837,9 +838,9 @@
public Object getReference(Bean<?> bean, CreationalContext<?> creationalContext)
{
bean = getMostSpecializedBean(bean);
- if (creationalContext instanceof CreationalContextImpl)
+ if (creationalContext instanceof WBCreationalContext<?>)
{
- creationalContext = ((CreationalContextImpl<?>) creationalContext).getCreationalContext(bean);
+ creationalContext = ((WBCreationalContext<?>) creationalContext).getCreationalContext(bean);
}
if (getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScopeType()).isNormal())
{
@@ -891,16 +892,16 @@
throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
}
// TODO Can we move this logic to getReference?
- if (creationalContext instanceof CreationalContextImpl)
+ if (creationalContext instanceof WBCreationalContext<?>)
{
- CreationalContextImpl<?> creationalContextImpl = (CreationalContextImpl<?>) creationalContext;
- if (creationalContextImpl.containsIncompleteInstance(resolvedBean))
+ WBCreationalContext<?> wbCreationalContext = (WBCreationalContext<?>) creationalContext;
+ if (wbCreationalContext.containsIncompleteInstance(resolvedBean))
{
- return creationalContextImpl.getIncompleteInstance(resolvedBean);
+ return wbCreationalContext.getIncompleteInstance(resolvedBean);
}
else
{
- return getReference(resolvedBean, creationalContextImpl);
+ return getReference(resolvedBean, wbCreationalContext);
}
}
else
@@ -1321,7 +1322,7 @@
return webbeansELResolver;
}
- public <T> CreationalContextImpl<T> createCreationalContext(Contextual<T> contextual)
+ public <T> WBCreationalContext<T> createCreationalContext(Contextual<T> contextual)
{
return new CreationalContextImpl<T>(contextual);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractReceiverBean.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -23,7 +23,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.context.WBCreationalContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -67,9 +67,9 @@
}
else
{
- if (creationalContext instanceof CreationalContextImpl<?>)
+ if (creationalContext instanceof WBCreationalContext<?>)
{
- CreationalContextImpl<?> creationalContextImpl = (CreationalContextImpl<?>) creationalContext;
+ WBCreationalContext<?> creationalContextImpl = (WBCreationalContext<?>) creationalContext;
if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
{
log.warn("Executing producer field or method " + getAnnotatedItem() + " on incomplete declaring bean " + getDeclaringBean() + " due to circular injection");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -26,7 +26,7 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.context.WBCreationalContext;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Reflections;
@@ -53,7 +53,7 @@
private final BeanManagerImpl manager;
- private static final ThreadLocal<CreationalContextImpl<?>> currentCreationalContext = new ThreadLocal<CreationalContextImpl<?>>();
+ private static final ThreadLocal<WBCreationalContext<?>> currentCreationalContext = new ThreadLocal<WBCreationalContext<?>>();
/**
* Constructor
@@ -119,7 +119,7 @@
private <T> T getProxiedInstance(Bean<T> bean)
{
- CreationalContextImpl<T> creationalContext;
+ WBCreationalContext<T> creationalContext;
boolean outer;
if (currentCreationalContext.get() == null)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/CreationalContextImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/CreationalContextImpl.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/CreationalContextImpl.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -22,7 +22,7 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-public class CreationalContextImpl<T> implements CreationalContext<T>
+public class CreationalContextImpl<T> implements CreationalContext<T>, WBCreationalContext<T>
{
private final Map<Contextual<?>, Object> incompleteInstances;
@@ -50,7 +50,7 @@
incompleteInstances.put(contextual, incompleteInstance);
}
- public <S> CreationalContextImpl<S> getCreationalContext(Contextual<S> Contextual)
+ public <S> WBCreationalContext<S> getCreationalContext(Contextual<S> Contextual)
{
return new CreationalContextImpl<S>(Contextual, new HashMap<Contextual<?>, Object>(incompleteInstances), dependentInstancesStore);
}
@@ -73,6 +73,7 @@
public void release()
{
dependentInstancesStore.destroyDependentInstances();
+ incompleteInstances.clear();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -61,9 +61,9 @@
if (creationalContext != null)
{
T instance = contextual.create(creationalContext);
- if (creationalContext instanceof CreationalContextImpl<?>)
+ if (creationalContext instanceof WBCreationalContext<?>)
{
- CreationalContextImpl<T> creationalContextImpl = (CreationalContextImpl<T>) creationalContext;
+ WBCreationalContext<T> creationalContextImpl = (WBCreationalContext<T>) creationalContext;
ContexutalInstance<T> beanInstance = new BeanInstanceImpl<T>(contextual, instance, creationalContext);
creationalContextImpl.getParentDependentInstancesStore().addDependentInstance(beanInstance);
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ForwardingWBCreationalContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ForwardingWBCreationalContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ForwardingWBCreationalContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.context;
+
+import javax.enterprise.context.spi.Contextual;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingWBCreationalContext<T> implements WBCreationalContext<T>
+{
+
+ protected abstract WBCreationalContext<T> delegate();
+
+ public void push(T incompleteInstance)
+ {
+ delegate().push(incompleteInstance);
+ }
+
+ public void release()
+ {
+ delegate().release();
+ }
+
+ public boolean containsIncompleteInstance(Contextual<?> bean)
+ {
+ return delegate().containsIncompleteInstance(bean);
+ }
+
+ public <S> WBCreationalContext<S> getCreationalContext(Contextual<S> Contextual)
+ {
+ return delegate().getCreationalContext(Contextual);
+ }
+
+ public <S> S getIncompleteInstance(Contextual<S> bean)
+ {
+ return delegate().getIncompleteInstance(bean);
+ }
+
+ public DependentInstancesStore getParentDependentInstancesStore()
+ {
+ return delegate().getParentDependentInstancesStore();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/ForwardingWBCreationalContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/WBCreationalContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/WBCreationalContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/WBCreationalContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.context;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+/**
+ * @author pmuir
+ *
+ * @param <T>
+ */
+public interface WBCreationalContext<T> extends CreationalContext<T>
+{
+
+ public abstract void push(T incompleteInstance);
+
+ public abstract <S> WBCreationalContext<S> getCreationalContext(Contextual<S> Contextual);
+
+ public abstract <S> S getIncompleteInstance(Contextual<S> bean);
+
+ public abstract boolean containsIncompleteInstance(Contextual<?> bean);
+
+ public abstract DependentInstancesStore getParentDependentInstancesStore();
+
+ public abstract void release();
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/WBCreationalContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/beanstore/AbstractAttributeBackedBeanStore.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.context.beanstore;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.List;
@@ -29,7 +30,7 @@
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.collections.EnumerationIterable;
+import org.jboss.webbeans.util.collections.EnumerationList;
/**
* Provides common BeanStore operations
@@ -91,7 +92,7 @@
*
* @return The beans
*/
- public Iterable<Contextual<? extends Object>> getContextuals()
+ public Collection<Contextual<? extends Object>> getContextuals()
{
List<Contextual<?>> contextuals = new ArrayList<Contextual<?>>();
BeanStoreNamingScheme namingScheme = getNamingScheme();
@@ -113,7 +114,7 @@
{
List<String> attributeNames = new ArrayList<String>();
BeanStoreNamingScheme namingScheme = getNamingScheme();
- for (String attributeName : new EnumerationIterable<String>(getAttributeNames()))
+ for (String attributeName : new EnumerationList<String>(getAttributeNames()))
{
if (namingScheme.acceptKey(attributeName))
{
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,58 @@
+package org.jboss.webbeans.el;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.webbeans.context.ForwardingWBCreationalContext;
+import org.jboss.webbeans.context.WBCreationalContext;
+
+abstract class ELCreationalContext<T> extends ForwardingWBCreationalContext<T>
+{
+
+ public static <X> ELCreationalContext<X> of(final WBCreationalContext<X> creationalContext)
+ {
+ return new ELCreationalContext<X>()
+ {
+
+ @Override
+ protected WBCreationalContext<X> delegate()
+ {
+ return creationalContext;
+ }
+
+ };
+ }
+
+ private final Map<String, Object> dependentInstances;
+
+ public ELCreationalContext()
+ {
+ this.dependentInstances = new HashMap<String, Object>();
+ }
+
+ public Object putIfAbsent(Bean<?> bean, Callable<Object> value) throws Exception
+ {
+ if (bean.getScopeType().equals(Dependent.class))
+ {
+ if (dependentInstances.containsKey(bean.getName()))
+ {
+ return dependentInstances.get(bean.getName());
+ }
+ else
+ {
+ Object instance = value.call();
+ dependentInstances.put(bean.getName(), instance);
+ return instance;
+ }
+ }
+ else
+ {
+ return value.call();
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.el;
+
+import java.util.Stack;
+
+import javax.el.ELContext;
+
+class ELCreationalContextStack extends Stack<ELCreationalContext<?>>
+{
+
+ private static final long serialVersionUID = -57142365866995726L;
+
+ public static ELCreationalContextStack addToContext(ELContext context)
+ {
+ ELCreationalContextStack store = new ELCreationalContextStack();
+ context.putContext(ELCreationalContextStack.class, store);
+ return store;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ELCreationalContextStack.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELContext.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,110 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.el;
-
-import java.util.Locale;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.FunctionMapper;
-import javax.el.VariableMapper;
-
-/**
- * A forwarding class that delegates to an ELContext
- *
- * @author Pete Muir
- *
- */
-public abstract class ForwardingELContext extends ELContext
-{
-
- protected abstract ELContext delgate();
-
- @Override
- public ELResolver getELResolver()
- {
- return delgate().getELResolver();
- }
-
- @Override
- public FunctionMapper getFunctionMapper()
- {
- return delgate().getFunctionMapper();
- }
-
- @Override
- public VariableMapper getVariableMapper()
- {
- return delgate().getVariableMapper();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delgate().equals(obj);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Object getContext(Class key)
- {
- return delgate().getContext(key);
- }
-
- @Override
- public Locale getLocale()
- {
- return delgate().getLocale();
- }
-
- @Override
- public int hashCode()
- {
- return delgate().hashCode();
- }
-
- @Override
- public boolean isPropertyResolved()
- {
- return delgate().isPropertyResolved();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void putContext(Class key, Object contextObject)
- {
- delgate().putContext(key, contextObject);
- }
-
- @Override
- public void setLocale(Locale locale)
- {
- delgate().setLocale(locale);
- }
-
- @Override
- public void setPropertyResolved(boolean resolved)
- {
- delgate().setPropertyResolved(resolved);
- }
-
- @Override
- public String toString()
- {
- return delgate().toString();
- }
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.el;
-
-import java.util.Iterator;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-
-public abstract class ForwardingELResolver extends ELResolver
-{
-
- protected abstract ELResolver delegate();
-
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base)
- {
- return delegate().getCommonPropertyType(context, base);
- }
-
- @Override
- public Iterator<?> getFeatureDescriptors(ELContext context, Object base)
- {
- return delegate().getFeatureDescriptors(context, base);
- }
-
- @Override
- public Class<?> getType(ELContext context, Object base, Object property)
- {
- return delegate().getType(context, base, property);
- }
-
- @Override
- public Object getValue(ELContext context, Object base, Object property)
- {
- return delegate().getValue(context, base, property);
- }
-
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property)
- {
- return delegate().isReadOnly(context, base, property);
- }
-
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value)
- {
- delegate().setValue(context, base, property, value);
- }
-
-}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELContextListener.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELContextListener.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELContextListener.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.el;
+
+import javax.el.ELContextEvent;
+import javax.el.ELContextListener;
+
+/**
+ * Responsible for pushing the CreationalContext stack into the ELContext which
+ * is later populated by our expression wrappers
+ *
+ * @author pmuir
+ *
+ */
+public class WebBeansELContextListener implements ELContextListener
+{
+
+ public void contextCreated(ELContextEvent contextEvent)
+ {
+ ELCreationalContextStack.addToContext(contextEvent.getELContext());
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELContextListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -19,6 +19,7 @@
import javax.el.ELResolver;
import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.util.el.ForwardingELResolver;
public class WebBeansELResolver extends ForwardingELResolver
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,13 +18,16 @@
import java.beans.FeatureDescriptor;
import java.util.Iterator;
+import java.util.concurrent.Callable;
import javax.el.ELContext;
import javax.el.ELResolver;
+import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.CurrentManager;
/**
* An EL-resolver against the named beans
@@ -34,22 +37,17 @@
public class WebBeansELResolverImpl extends ELResolver
{
- private static final class ValueHolder<T>
+ private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
{
-
- private T value;
-
- public T getValue()
+
+ public Object create(CreationalContext<Object> creationalContext)
{
- return value;
+ return null;
}
+
+ public void destroy(Object instance, CreationalContext<Object> creationalContext) {}
- public void setValue(T value)
- {
- this.value = value;
- }
-
- }
+ };
private final BeanManagerImpl manager;
@@ -58,36 +56,24 @@
this.manager = manager;
}
- /**
- * @see javax.el.ELResolver#getCommonPropertyType(ELContext, Object)
- */
@Override
public Class<?> getCommonPropertyType(ELContext context, Object base)
{
return null;
}
- /**
- * @see javax.el.ELResolver#getFeatureDescriptors(ELContext, Object)
- */
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
{
return null;
}
- /**
- * @see javax.el.ELResolver#getType(ELContext, Object, Object)
- */
@Override
public Class<?> getType(ELContext context, Object base, Object property)
{
return null;
}
- /**
- * @see javax.el.ELResolver#getValue(ELContext, Object, Object)
- */
@Override
public Object getValue(ELContext context, Object base, Object property)
{
@@ -132,13 +118,20 @@
Object value = null;
try
{
- Bean<?> bean = manager.resolve(manager.getBeans(name));
- CreationalContext<?> creationalContext = manager.createCreationalContext(bean);
+ final Bean<?> bean = manager.resolve(manager.getBeans(name));
+ final ELCreationalContext<?> creationalContext = getCreationalContextStore(context).peek();
if (bean != null)
{
- value = manager.getReference(bean, creationalContext);
+ value = creationalContext.putIfAbsent(bean, new Callable<Object>()
+ {
+
+ public Object call() throws Exception
+ {
+ return manager.getReference(bean, creationalContext);
+ }
+
+ });
}
- creationalContext.release();
}
catch (Exception e)
{
@@ -153,22 +146,31 @@
return null;
}
- /**
- * @see javax.el.ELResolver#isReadOnly(ELContext, Object, Object)
- */
@Override
public boolean isReadOnly(ELContext context, Object base, Object property)
{
return false;
}
- /**
- * @see javax.el.ELResolver#setValue(ELContext, Object, Object, Object)
- */
@Override
public void setValue(ELContext context, Object base, Object property, Object value)
{
}
+
+ private static ELCreationalContextStack getCreationalContextStore(ELContext context)
+ {
+ Object o = context.getContext(ELCreationalContextStack.class);
+
+ if (!(o instanceof ELCreationalContextStack))
+ {
+ ELCreationalContextStack store = ELCreationalContextStack.addToContext(context);
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ store.push(creationalContext);
+ o = store;
+ }
+ return (ELCreationalContextStack) o;
+ }
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansExpressionFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansExpressionFactory.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansExpressionFactory.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.el;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
+import org.jboss.webbeans.util.el.ForwardingExpressionFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WebBeansExpressionFactory extends ForwardingExpressionFactory
+{
+
+ private final ExpressionFactory delegate;
+
+ public WebBeansExpressionFactory(ExpressionFactory expressionFactory)
+ {
+ this.delegate = expressionFactory;
+ }
+
+ @Override
+ protected ExpressionFactory delegate()
+ {
+ return delegate;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public ValueExpression createValueExpression(ELContext context, String expression, Class expectedType)
+ {
+ return new WebBeansValueExpression(super.createValueExpression(context, expression, expectedType));
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public MethodExpression createMethodExpression(ELContext context, String expression, Class expectedReturnType, Class[] expectedParamTypes)
+ {
+ return new WebBeansMethodExpression(super.createMethodExpression(context, expression, expectedReturnType, expectedParamTypes));
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansExpressionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.el;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.util.el.ForwardingMethodExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WebBeansMethodExpression extends ForwardingMethodExpression
+{
+
+ private static final long serialVersionUID = 7070020110515571744L;
+
+ private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
+ {
+
+ public Object create(CreationalContext<Object> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(Object instance, CreationalContext<Object> creationalContext) {}
+
+ };
+
+ private final MethodExpression delegate;
+
+ public WebBeansMethodExpression(MethodExpression delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ protected MethodExpression delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public Object invoke(ELContext context, Object[] params)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return super.invoke(context, params);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @Override
+ public MethodInfo getMethodInfo(ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return super.getMethodInfo(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ private ELCreationalContextStack getCreationalContextStore(ELContext context)
+ {
+ Object o = context.getContext(ELCreationalContextStack.class);
+ if (!(o instanceof ELCreationalContextStack))
+ {
+ throw new IllegalStateException("Something went wrong with the ELContext, expecting a CreationalContextStore to be present, but instead got " + o);
+ }
+ return (ELCreationalContextStack) o;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansMethodExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,123 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.el;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.util.el.ForwardingValueExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WebBeansValueExpression extends ForwardingValueExpression
+{
+
+ private static final long serialVersionUID = 1122137212009930853L;
+
+ private static final Contextual<?> CONTEXTUAL = new Contextual<Object>()
+ {
+
+ public Object create(CreationalContext<Object> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(Object instance, CreationalContext<Object> creationalContext) {}
+
+ };
+
+ private final ValueExpression delegate;
+
+ public WebBeansValueExpression(ValueExpression delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ protected ValueExpression delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public Object getValue(final ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return delegate().getValue(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @Override
+ public void setValue(ELContext context, Object value)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ delegate().setValue(context, value);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class getType(ELContext context)
+ {
+ // TODO need to use correct manager for module
+ ELCreationalContext<?> creationalContext = ELCreationalContext.of(CurrentManager.rootManager().createCreationalContext(CONTEXTUAL));
+ try
+ {
+ getCreationalContextStore(context).push(creationalContext);
+ return delegate().getType(context);
+ }
+ finally
+ {
+ getCreationalContextStore(context).pop();
+ creationalContext.release();
+ }
+ }
+
+ private ELCreationalContextStack getCreationalContextStore(ELContext context)
+ {
+ Object o = context.getContext(ELCreationalContextStack.class);
+ if (!(o instanceof ELCreationalContextStack))
+ {
+ throw new IllegalStateException("Something went wrong with the ELContext, expecting a CreationalContextStore to be present, but instead got " + o);
+ }
+ return (ELCreationalContextStack) o;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansValueExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplication.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplication.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplication.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,289 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.jsf;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ReferenceSyntaxException;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+import javax.faces.event.ActionListener;
+import javax.faces.validator.Validator;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingApplication extends Application
+{
+
+ protected abstract Application delegate();
+
+ @Override
+ public void addComponent(String componentType, String componentClass)
+ {
+ delegate().addComponent(componentType, componentClass);
+ }
+
+ @Override
+ public void addConverter(String converterId, String converterClass)
+ {
+ delegate().addConverter(converterId, converterClass);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void addConverter(Class targetClass, String converterClass)
+ {
+ delegate().addConverter(targetClass, converterClass);
+ }
+
+ @Override
+ public void addValidator(String validatorId, String validatorClass)
+ {
+ delegate().addValidator(validatorId, validatorClass);
+ }
+
+ @Override
+ public UIComponent createComponent(String componentType) throws FacesException
+ {
+ return delegate().createComponent(componentType);
+ }
+
+ @Override
+ @Deprecated
+ public UIComponent createComponent(ValueBinding componentBinding, FacesContext context, String componentType) throws FacesException
+ {
+ return delegate().createComponent(componentBinding, context, componentType);
+ }
+
+ @Override
+ public Converter createConverter(String converterId)
+ {
+ return delegate().createConverter(converterId);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Converter createConverter(Class targetClass)
+ {
+ return delegate().createConverter(targetClass);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Deprecated
+ @Override
+ public MethodBinding createMethodBinding(String ref, Class[] params) throws ReferenceSyntaxException
+ {
+ return delegate().createMethodBinding(ref, params);
+ }
+
+ @Override
+ public Validator createValidator(String validatorId) throws FacesException
+ {
+ return delegate().createValidator(validatorId);
+ }
+
+ @Override
+ @Deprecated
+ public ValueBinding createValueBinding(String ref) throws ReferenceSyntaxException
+ {
+ return delegate().createValueBinding(ref);
+ }
+
+ @Override
+ public ActionListener getActionListener()
+ {
+ return delegate().getActionListener();
+ }
+
+ @Override
+ public Iterator<String> getComponentTypes()
+ {
+ return delegate().getComponentTypes();
+ }
+
+ @Override
+ public Iterator<String> getConverterIds()
+ {
+ return delegate().getConverterIds();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Iterator<Class> getConverterTypes()
+ {
+ return delegate().getConverterTypes();
+ }
+
+ @Override
+ public Locale getDefaultLocale()
+ {
+ return delegate().getDefaultLocale();
+ }
+
+ @Override
+ public String getDefaultRenderKitId()
+ {
+ return delegate().getDefaultRenderKitId();
+ }
+
+ @Override
+ public String getMessageBundle()
+ {
+ return delegate().getMessageBundle();
+ }
+
+ @Override
+ public NavigationHandler getNavigationHandler()
+ {
+ return delegate().getNavigationHandler();
+ }
+
+ @Override
+ @Deprecated
+ public PropertyResolver getPropertyResolver()
+ {
+ return delegate().getPropertyResolver();
+ }
+
+ @Override
+ public StateManager getStateManager()
+ {
+ return delegate().getStateManager();
+ }
+
+ @Override
+ public Iterator<Locale> getSupportedLocales()
+ {
+ return delegate().getSupportedLocales();
+ }
+
+ @Override
+ public Iterator<String> getValidatorIds()
+ {
+ return delegate().getValidatorIds();
+ }
+
+ @Override
+ @Deprecated
+ public VariableResolver getVariableResolver()
+ {
+ return delegate().getVariableResolver();
+ }
+
+ @Override
+ public ViewHandler getViewHandler()
+ {
+ return delegate().getViewHandler();
+ }
+
+ @Override
+ public void setActionListener(ActionListener listener)
+ {
+ delegate().setActionListener(listener);
+ }
+
+ @Override
+ public void setDefaultLocale(Locale locale)
+ {
+ delegate().setDefaultLocale(locale);
+ }
+
+ @Override
+ public void setDefaultRenderKitId(String renderKitId)
+ {
+ delegate().setDefaultRenderKitId(renderKitId);
+ }
+
+ @Override
+ public void setMessageBundle(String bundle)
+ {
+ delegate().setMessageBundle(bundle);
+ }
+
+ @Override
+ public void setNavigationHandler(NavigationHandler handler)
+ {
+ delegate().setNavigationHandler(handler);
+ }
+
+
+ @Override
+ @Deprecated
+ public void setPropertyResolver(PropertyResolver resolver)
+ {
+ delegate().setPropertyResolver(resolver);
+ }
+
+ @Override
+ public void setStateManager(StateManager manager)
+ {
+ delegate().setStateManager(manager);
+ }
+
+ @Override
+ public void setSupportedLocales(Collection<Locale> locales)
+ {
+ delegate().setSupportedLocales(locales);
+
+ }
+
+ @Override
+ @Deprecated
+ public void setVariableResolver(VariableResolver resolver)
+ {
+ delegate().setVariableResolver(resolver);
+ }
+
+ @Override
+ public void setViewHandler(ViewHandler handler)
+ {
+ delegate().setViewHandler(handler);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplication.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplicationFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplicationFactory.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplicationFactory.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.jsf;
+
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingApplicationFactory extends ApplicationFactory
+{
+
+ protected abstract ApplicationFactory delegate();
+
+ @Override
+ public Application getApplication()
+ {
+ return delegate().getApplication();
+ }
+
+ @Override
+ public void setApplication(Application application)
+ {
+ delegate().setApplication(application);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ForwardingApplicationFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplication.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplication.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplication.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.jsf;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.el.ELContextListener;
+import javax.el.ExpressionFactory;
+import javax.faces.application.Application;
+
+import org.jboss.webbeans.el.WebBeansELContextListener;
+import org.jboss.webbeans.el.WebBeansExpressionFactory;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WebBeansApplication extends ForwardingApplication
+{
+
+ private static final ELContextListener[] EMPTY_LISTENERS = {};
+
+ private final Application application;
+ private final Collection<ELContextListener> elContextListeners;
+
+ public WebBeansApplication(Application application)
+ {
+ this.application = application;
+ this.elContextListeners = new ArrayList<ELContextListener>();
+ this.elContextListeners.add(new WebBeansELContextListener());
+ }
+
+ @Override
+ protected Application delegate()
+ {
+ return application;
+ }
+
+ @Override
+ public ExpressionFactory getExpressionFactory()
+ {
+ return new WebBeansExpressionFactory(delegate().getExpressionFactory());
+ }
+
+ @Override
+ public ELContextListener[] getELContextListeners()
+ {
+ return elContextListeners.toArray(EMPTY_LISTENERS);
+ }
+
+ @Override
+ public void addELContextListener(ELContextListener listener)
+ {
+ elContextListeners.add(listener);
+ }
+
+ @Override
+ public void removeELContextListener(ELContextListener listener)
+ {
+ elContextListeners.remove(listener);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplication.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplicationFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplicationFactory.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplicationFactory.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.jsf;
+
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public class WebBeansApplicationFactory extends ForwardingApplicationFactory
+{
+
+ private final ApplicationFactory applicationFactory;
+
+ public WebBeansApplicationFactory(ApplicationFactory applicationFactory)
+ {
+ this.applicationFactory = applicationFactory;
+ }
+
+ @Override
+ protected ApplicationFactory delegate()
+ {
+ return applicationFactory;
+ }
+
+ @Override
+ public Application getApplication()
+ {
+ return new WebBeansApplication(delegate().getApplication());
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/WebBeansApplicationFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/JspInitialization.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/JspInitialization.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/JspInitialization.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.jsp;
+
+import javax.servlet.ServletContext;
+import javax.servlet.jsp.JspApplicationContext;
+import javax.servlet.jsp.JspFactory;
+
+import org.jboss.webbeans.el.WebBeansELResolver;
+
+/**
+ * @author pmuir
+ *
+ */
+public class JspInitialization
+{
+
+ public void init(ServletContext context)
+ {
+ // JSP 2.1 specific check
+ if (JspFactory.getDefaultFactory().getJspApplicationContext(context) == null)
+ {
+ return;
+ }
+
+ // get JspApplicationContext.
+ JspApplicationContext jspAppContext = JspFactory.getDefaultFactory().getJspApplicationContext(context);
+
+ // register compositeELResolver with JSP
+ jspAppContext.addELResolver(new WebBeansELResolver());
+
+ // DOesn't really achieve much :-(
+ //jspAppContext.addELContextListener(new WebBeansELContextListener());
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsp/JspInitialization.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/DefaultResourceLoader.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/DefaultResourceLoader.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/DefaultResourceLoader.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,10 +18,11 @@
import java.io.IOException;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
-import org.jboss.webbeans.util.collections.EnumerationIterable;
+import org.jboss.webbeans.util.collections.EnumerationList;
/**
* A simple resource loader.
@@ -71,17 +72,17 @@
}
}
- public Iterable<URL> getResources(String name)
+ public Collection<URL> getResources(String name)
{
try
{
if (Thread.currentThread().getContextClassLoader() != null)
{
- return new EnumerationIterable<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
+ return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
}
else
{
- return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
+ return new EnumerationList<URL>(getClass().getClassLoader().getResources(name));
}
}
catch (IOException e)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/servlet/WebBeansListener.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -22,12 +22,14 @@
*/
package org.jboss.webbeans.servlet;
+import javax.servlet.ServletContextEvent;
import javax.servlet.ServletRequestEvent;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSessionEvent;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.context.ContextLifecycle;
+import org.jboss.webbeans.jsp.JspInitialization;
import org.jboss.webbeans.servlet.api.helpers.AbstractServletListener;
/**
@@ -53,6 +55,12 @@
}
return lifecycle;
}
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ new JspInitialization().init(sce.getServletContext());
+ }
/**
* Called when the session is created
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationIterable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationIterable.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationIterable.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.util.collections;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-
-import com.google.common.collect.Iterables;
-
-
-/**
- * An Enumeration -> Iteratble adaptor
- *
- * @author Pete Muir
- * @see org.jboss.webbeans.util.collections.EnumerationIterator
- */
-public class EnumerationIterable<T> implements Iterable<T>
-{
- // The enumeration as a list
- private final List<T> list = new ArrayList<T>();
-
- /**
- * Constructor
- *
- * @param enumeration The enumeration
- */
- public EnumerationIterable(Enumeration<T> enumeration)
- {
- while (enumeration.hasMoreElements())
- {
- list.add(enumeration.nextElement());
- }
- }
-
- /**
- * Gets an iterator
- *
- * @return The iterator
- */
- public Iterator<T> iterator()
- {
- return Iterables.unmodifiableIterable(list).iterator();
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationList.java (from rev 3399, ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationIterable.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationList.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationList.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.util.collections;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import com.google.common.collect.ForwardingList;
+
+
+/**
+ * An Enumeration -> List adaptor
+ *
+ * @author Pete Muir
+ */
+public class EnumerationList<T> extends ForwardingList<T>
+{
+ // The enumeration as a list
+ private final List<T> list = new ArrayList<T>();
+
+ /**
+ * Constructor
+ *
+ * @param enumeration The enumeration
+ */
+ public EnumerationList(Enumeration<T> enumeration)
+ {
+ while (enumeration.hasMoreElements())
+ {
+ list.add(enumeration.nextElement());
+ }
+ }
+
+ @Override
+ protected List<T> delegate()
+ {
+ return list;
+ }
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/collections/EnumerationList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELContext.java (from rev 3395, ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELContext.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELContext.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELContext.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -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.webbeans.util.el;
+
+import java.util.Locale;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.VariableMapper;
+
+/**
+ * A forwarding class that delegates to an ELContext
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class ForwardingELContext extends ELContext
+{
+
+ protected abstract ELContext delgate();
+
+ @Override
+ public ELResolver getELResolver()
+ {
+ return delgate().getELResolver();
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper()
+ {
+ return delgate().getFunctionMapper();
+ }
+
+ @Override
+ public VariableMapper getVariableMapper()
+ {
+ return delgate().getVariableMapper();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delgate().equals(obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object getContext(Class key)
+ {
+ return delgate().getContext(key);
+ }
+
+ @Override
+ public Locale getLocale()
+ {
+ return delgate().getLocale();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delgate().hashCode();
+ }
+
+ @Override
+ public boolean isPropertyResolved()
+ {
+ return delgate().isPropertyResolved();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void putContext(Class key, Object contextObject)
+ {
+ delgate().putContext(key, contextObject);
+ }
+
+ @Override
+ public void setLocale(Locale locale)
+ {
+ delgate().setLocale(locale);
+ }
+
+ @Override
+ public void setPropertyResolved(boolean resolved)
+ {
+ delgate().setPropertyResolved(resolved);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delgate().toString();
+ }
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELResolver.java (from rev 3395, ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELResolver.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELResolver.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.util.el;
+
+import java.util.Iterator;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+
+public abstract class ForwardingELResolver extends ELResolver
+{
+
+ protected abstract ELResolver delegate();
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base)
+ {
+ return delegate().getCommonPropertyType(context, base);
+ }
+
+ @Override
+ public Iterator<?> getFeatureDescriptors(ELContext context, Object base)
+ {
+ return delegate().getFeatureDescriptors(context, base);
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property)
+ {
+ return delegate().getType(context, base, property);
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property)
+ {
+ return delegate().getValue(context, base, property);
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property)
+ {
+ return delegate().isReadOnly(context, base, property);
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value)
+ {
+ delegate().setValue(context, base, property, value);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingELResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingExpressionFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingExpressionFactory.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingExpressionFactory.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.util.el;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingExpressionFactory extends ExpressionFactory
+{
+
+ protected abstract ExpressionFactory delegate();
+
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object coerceToType(Object obj, Class targetType)
+ {
+ return delegate().coerceToType(obj, targetType);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public MethodExpression createMethodExpression(ELContext context, String expression, Class expectedReturnType, Class[] expectedParamTypes)
+ {
+ return delegate().createMethodExpression(context, expression, expectedReturnType, expectedParamTypes);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public ValueExpression createValueExpression(Object instance, Class expectedType)
+ {
+ return delegate().createValueExpression(instance, expectedType);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public ValueExpression createValueExpression(ELContext context, String expression, Class expectedType)
+ {
+ return delegate().createValueExpression(context, expression, expectedType);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingExpressionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingMethodExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingMethodExpression.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingMethodExpression.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.util.el;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingMethodExpression extends MethodExpression
+{
+
+ private static final long serialVersionUID = -2614033937482335044L;
+
+ protected abstract MethodExpression delegate();
+
+ @Override
+ public MethodInfo getMethodInfo(ELContext context)
+ {
+ return delegate().getMethodInfo(context);
+ }
+
+ @Override
+ public Object invoke(ELContext context, Object[] params)
+ {
+ return delegate().invoke(context, params);
+ }
+
+ @Override
+ public String getExpressionString()
+ {
+ return delegate().getExpressionString();
+ }
+
+ @Override
+ public boolean isLiteralText()
+ {
+ return delegate().isLiteralText();
+ }
+
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingMethodExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingValueExpression.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingValueExpression.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingValueExpression.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.util.el;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingValueExpression extends ValueExpression
+{
+
+ private static final long serialVersionUID = -2318681808639242038L;
+
+ protected abstract ValueExpression delegate();
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class getExpectedType()
+ {
+ return delegate().getExpectedType();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Class getType(ELContext context)
+ {
+ return delegate().getType(context);
+ }
+
+ @Override
+ public Object getValue(ELContext context)
+ {
+ return delegate().getValue(context);
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context)
+ {
+ return delegate().isReadOnly(context);
+ }
+
+ @Override
+ public void setValue(ELContext context, Object value)
+ {
+ delegate().setValue(context, value);
+ }
+
+ @Override
+ public String getExpressionString()
+ {
+ return delegate().getExpressionString();
+ }
+
+ @Override
+ public boolean isLiteralText()
+ {
+ return delegate().isLiteralText();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/el/ForwardingValueExpression.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -17,7 +17,7 @@
package org.jboss.webbeans.bootstrap.spi;
import java.net.URL;
-import java.util.List;
+import java.util.Collection;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
@@ -48,23 +48,24 @@
{
/**
- * Get the ordered bean deployment archives which are accessible to this bean
+ * Get the bean deployment archives which are accessible to this bean
* deployment archive and adjacent to it in the deployment archive graph.
*
- * The bean deployment archives will be processed in the order specified.
+ * Cycles in the accessible BeanDeploymentArchive graph are allowed. If a
+ * cycle is detected by Web Beans, it will be automatically removed by Web
+ * Beans. This means any implementor of this interface don't need to worry
+ * about circularities.
*
- * Circular dependencies will be detected and ignored by the container
- *
- * @return the ordered accessible bean deployment archives
+ * @return the accessible bean deployment archives
*/
- public List<BeanDeploymentArchive> getBeanDeploymentArchives();
+ public Collection<BeanDeploymentArchive> getBeanDeploymentArchives();
/**
* Gets all classes in the bean deployment archive
*
- * @return an iteration over the classes, empty if no classes are present
+ * @return the classes, empty if no classes are present
*/
- public Iterable<Class<?>> getBeanClasses();
+ public Collection<Class<?>> getBeanClasses();
/**
* Get any deployment descriptors in the bean deployment archive.
@@ -74,17 +75,17 @@
* however it is permitted to return other deployment descriptors defined
* using other methods.
*
- * @return an iteration over the URLs pointing to the deployment descriptor,
+ * @return the URLs pointing to the deployment descriptor,
* or an empty set if none are present
*/
- public Iterable<URL> getBeansXml();
+ public Collection<URL> getBeansXml();
/**
* Get all the EJBs in the deployment archive
*
- * @return an iteration of the EJBs, or empty if no EJBs are present or if
+ * @return the EJBs, or empty if no EJBs are present or if
* this is not an EJB archive
*/
- public Iterable<EjbDescriptor<?>> getEjbs();
+ public Collection<EjbDescriptor<?>> getEjbs();
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -16,7 +16,7 @@
*/
package org.jboss.webbeans.bootstrap.spi;
-import java.util.List;
+import java.util.Collection;
import org.jboss.webbeans.bootstrap.api.Service;
@@ -119,18 +119,15 @@
* Get the bean deployment archives which are accessible by this deployment
* and adjacent to it in the deployment archive graph.
*
- * The bean deployment archives will be processed in using the natural order
- * of the list.
- *
* Cycles in the accessible BeanDeploymentArchive graph are allowed. If a
* cycle is detected by Web Beans, it will be automatically removed by Web
* Beans. This means any implementor of this interface don't need to worry
* about circularities.
*
- * @return the ordered accessible bean deployment archives
+ * @return the accessible bean deployment archives
*
*/
- public List<BeanDeploymentArchive> getBeanDeploymentArchives();
+ public Collection<BeanDeploymentArchive> getBeanDeploymentArchives();
/**
* Load the {@link BeanDeploymentArchive} containing the given class.
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingWebBeanDiscovery.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingWebBeanDiscovery.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/helpers/ForwardingWebBeanDiscovery.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -14,6 +14,7 @@
* @author Pete Muir
*
*/
+@Deprecated
public abstract class ForwardingWebBeanDiscovery implements WebBeanDiscovery
{
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -17,6 +17,8 @@
package org.jboss.webbeans.context.api;
+import java.util.Collection;
+
import javax.enterprise.context.spi.Contextual;
@@ -42,11 +44,11 @@
public abstract void clear();
/**
- * Returns an iteration over the current contextual instances in the store
+ * Returns the current contextual instances in the store
*
- * @return the iteration
+ * @return the instances
*/
- public abstract Iterable<Contextual<?>> getContextuals();
+ public abstract Collection<Contextual<?>> getContextuals();
/**
* Adds a bean instance to the storage
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,9 +1,11 @@
package org.jboss.webbeans.context.api.helpers;
+import java.util.Collection;
+
import javax.enterprise.context.spi.Contextual;
+import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.ContexutalInstance;
-import org.jboss.webbeans.context.api.BeanStore;
public abstract class ForwardingBeanStore implements BeanStore
{
@@ -20,7 +22,7 @@
return delegate().get(bean);
}
- public Iterable<Contextual<? extends Object>> getContextuals()
+ public Collection<Contextual<? extends Object>> getContextuals()
{
return delegate().getContextuals();
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbDescriptor.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,6 +18,7 @@
package org.jboss.webbeans.ejb.spi;
import java.lang.reflect.Method;
+import java.util.Collection;
/**
@@ -42,14 +43,14 @@
*
* @return An iterator over the local business interfaces
*/
- public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();
+ public Collection<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();
/**
* Get the remove methods of the EJB
*
* @return An iterator over the remove methods
*/
- public Iterable<Method> getRemoveMethods();
+ public Collection<Method> getRemoveMethods();
/**
* Indicates if the bean is a stateless session bean
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbDescriptor.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.ejb.spi.helpers;
import java.lang.reflect.Method;
+import java.util.Collection;
import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
@@ -21,12 +22,12 @@
protected abstract EjbDescriptor<T> delegate();
- public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
+ public Collection<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
{
return delegate().getLocalBusinessInterfaces();
}
- public Iterable<Method> getRemoveMethods()
+ public Collection<Method> getRemoveMethods()
{
return delegate().getRemoveMethods();
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/ResourceLoader.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,6 +18,7 @@
package org.jboss.webbeans.resources.spi;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.bootstrap.api.Service;
@@ -54,8 +55,8 @@
* Gets resources as URLs by name
*
* @param name The name of the resource
- * @return An iterable reference to the URLS
+ * @return references to the URLS
*/
- public Iterable<URL> getResources(String name);
+ public Collection<URL> getResources(String name);
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/ForwardingResourceLoader.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/ForwardingResourceLoader.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/ForwardingResourceLoader.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.resources.spi.helpers;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.resources.spi.ResourceLoader;
@@ -29,7 +30,7 @@
return delegate().getResource(name);
}
- public Iterable<URL> getResources(String name)
+ public Collection<URL> getResources(String name)
{
return delegate().getResources(name);
}
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockResourceLoader.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,6 +1,7 @@
package org.jboss.webbeans.bootstrap.api.test;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.resources.spi.ResourceLoader;
@@ -17,7 +18,7 @@
return null;
}
- public Iterable<URL> getResources(String name)
+ public Collection<URL> getResources(String name)
{
return null;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,6 +18,7 @@
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -39,23 +40,27 @@
{
- private Iterable<Class<?>> beanClasses = new HashSet<Class<?>>();
+ private Set<Class<?>> beanClasses = new HashSet<Class<?>>();
- private Iterable<URL> webBeansXmlFiles = new HashSet<URL>();
+ private Collection<URL> webBeansXmlFiles = new HashSet<URL>();
- public Iterable<Class<?>> getBeanClasses()
+ public Collection<Class<?>> getBeanClasses()
{
return beanClasses;
}
- public Iterable<URL> getBeansXml()
+ public Collection<URL> getBeansXml()
{
return webBeansXmlFiles;
}
public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
{
- this.webBeansXmlFiles = webBeansXmlFiles;
+ this.webBeansXmlFiles.clear();
+ for (URL url : webBeansXmlFiles)
+ {
+ this.webBeansXmlFiles.add(url);
+ }
}
public List<BeanDeploymentArchive> getBeanDeploymentArchives()
@@ -67,7 +72,11 @@
public void setBeanClasses(Iterable<Class<?>> beanClasses)
{
- this.beanClasses = beanClasses;
+ this.beanClasses.clear();
+ for (Class<?> clazz : beanClasses)
+ {
+ this.beanClasses.add(clazz);
+ }
ejbs = new ArrayList<EjbDescriptor<?>>();
for (Class<?> ejbClass : discoverEjbs(getBeanClasses()))
{
@@ -75,7 +84,7 @@
}
}
- public Iterable<EjbDescriptor<?>> getEjbs()
+ public Collection<EjbDescriptor<?>> getEjbs()
{
return ejbs;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,6 +18,7 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -105,7 +106,7 @@
return ejbName;
}
- public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
+ public Collection<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
{
return localInterfaces;
}
@@ -115,7 +116,7 @@
return Collections.emptyList();
}
- public Iterable<Method> getRemoveMethods()
+ public Collection<Method> getRemoveMethods()
{
return removeMethods;
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockResourceLoader.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,10 +18,11 @@
import java.io.IOException;
import java.net.URL;
+import java.util.Collection;
import org.jboss.webbeans.resources.spi.ResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
-import org.jboss.webbeans.util.collections.EnumerationIterable;
+import org.jboss.webbeans.util.collections.EnumerationList;
public class MockResourceLoader implements ResourceLoader
{
@@ -43,11 +44,11 @@
return Thread.currentThread().getContextClassLoader().getResource(name);
}
- public Iterable<URL> getResources(String name)
+ public Collection<URL> getResources(String name)
{
try
{
- return new EnumerationIterable<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
+ return new EnumerationList<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
}
catch (IOException e)
{
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el/EL.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el/EL.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/el/EL.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -20,6 +20,8 @@
import javax.el.BeanELResolver;
import javax.el.CompositeELResolver;
import javax.el.ELContext;
+import javax.el.ELContextEvent;
+import javax.el.ELContextListener;
import javax.el.ELResolver;
import javax.el.ExpressionFactory;
import javax.el.FunctionMapper;
@@ -28,7 +30,9 @@
import javax.el.ResourceBundleELResolver;
import javax.el.VariableMapper;
+import org.jboss.webbeans.el.WebBeansELContextListener;
import org.jboss.webbeans.el.WebBeansELResolver;
+import org.jboss.webbeans.el.WebBeansExpressionFactory;
import com.sun.el.ExpressionFactoryImpl;
import com.sun.el.lang.FunctionMapperImpl;
@@ -44,8 +48,10 @@
{
public static final ELResolver EL_RESOLVER = createELResolver();
- public static final ExpressionFactory EXPRESSION_FACTORY = new ExpressionFactoryImpl();
+ public static final ExpressionFactory EXPRESSION_FACTORY = new WebBeansExpressionFactory(new ExpressionFactoryImpl());
+ public static final ELContextListener[] EL_CONTEXT_LISTENERS = { new WebBeansELContextListener() };
+
private static ELResolver createELResolver()
{
CompositeELResolver resolver = new CompositeELResolver();
@@ -64,7 +70,7 @@
public static ELContext createELContext(final ELResolver resolver, final FunctionMapper functionMapper)
{
- return new ELContext()
+ ELContext context = new ELContext()
{
final VariableMapperImpl variableMapper = new VariableMapperImpl();
@@ -87,6 +93,17 @@
}
};
+ callELContextListeners(context);
+ return context;
}
+ public static void callELContextListeners(ELContext context)
+ {
+ ELContextEvent event = new ELContextEvent(context);
+ for (ELContextListener listener : EL_CONTEXT_LISTENERS)
+ {
+ listener.contextCreated(event);
+ }
+ }
+
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -21,7 +21,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.mock.el.EL;
-import org.jboss.webbeans.util.collections.EnumerationIterable;
+import org.jboss.webbeans.util.collections.EnumerationList;
import org.testng.ITestContext;
import org.testng.annotations.BeforeSuite;
@@ -81,7 +81,7 @@
}
try
{
- return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
+ return new EnumerationList<URL>(getClass().getClassLoader().getResources(name));
}
catch (IOException e)
{
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-08-07 11:28:32 UTC (rev 3403)
+++ ri/trunk/version-matrix/pom.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -113,6 +113,12 @@
</dependency>
<dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -18,7 +18,7 @@
@SpecVersion("20090625")
public class EnterpriseBeanWithNonPassivatingDecoratorTest extends AbstractJSR299Test
{
- @Test(groups = { "contexts", "passivation", "integration"})
+ @Test(groups = { "contexts", "passivation", "integration", "ri-broken"})
@SpecAssertion(section = "6.6.4", id = "hb")
public void testEnterpriseBeanWithNonPassivatingDecoratorFails()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/CowShed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/CowShed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/CowShed.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,37 @@
+/*
+ * 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.decorators.definition.inject.broken.delegateProducerMethod;
+
+import javax.enterprise.inject.Current;
+
+/**
+ * @author pmuir
+ *
+ */
+public class CowShed
+{
+
+ public static final String MESSAGE = "cowShed";
+
+ @Current Logger logger;
+
+ public void milk()
+ {
+ logger.log(MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/CowShed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/DelegateInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/DelegateInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/DelegateInjectionPointTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,49 @@
+/*
+ * 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.decorators.definition.inject.broken.delegateProducerMethod;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DefinitionError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+(a)ExpectedDeploymentException(DefinitionError.class)
+public class DelegateInjectionPointTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="8.1.2", id="cf")
+ })
+ public void testDecoratorDelegateInjectionPoints()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/DelegateInjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/Logger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/Logger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,29 @@
+/*
+ * 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.decorators.definition.inject.broken.delegateProducerMethod;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Logger
+{
+
+ public void log(String string);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/MockLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/MockLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/MockLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,32 @@
+/*
+ * 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.decorators.definition.inject.broken.delegateProducerMethod;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockLogger implements Logger
+{
+
+
+
+ public void log(String string)
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/MockLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,45 @@
+/*
+ * 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.decorators.definition.inject.broken.delegateProducerMethod;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Produces;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class TimestampLogger
+{
+
+ @Produces
+ public String setLogger(@Decorates Logger logger)
+ {
+ return "";
+ }
+
+ public void log(String message)
+ {
+
+ }
+
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/CowShed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/CowShed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/CowShed.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,37 @@
+/*
+ * 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.decorators.definition.inject.delegateConstructor;
+
+import javax.enterprise.inject.Current;
+
+/**
+ * @author pmuir
+ *
+ */
+public class CowShed
+{
+
+ public static final String MESSAGE = "cowShed";
+
+ @Current Logger logger;
+
+ public void milk()
+ {
+ logger.log(MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/CowShed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/DelegateInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/DelegateInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/DelegateInjectionPointTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,50 @@
+/*
+ * 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.decorators.definition.inject.delegateConstructor;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DelegateInjectionPointTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="8.1.2", id="ce")
+ })
+ public void testDecoratorDelegateInjectionPoints()
+ {
+ TimestampLogger.reset();
+ MockLogger.reset();
+ getInstanceByType(CowShed.class).milk();
+ assert TimestampLogger.getConstructor() != null;
+ assert MockLogger.getMessage().equals(TimestampLogger.PREFIX + CowShed.MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/DelegateInjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/Logger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/Logger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,29 @@
+/*
+ * 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.decorators.definition.inject.delegateConstructor;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Logger
+{
+
+ public void log(String string);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/MockLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/MockLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/MockLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,46 @@
+/*
+ * 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.decorators.definition.inject.delegateConstructor;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockLogger implements Logger
+{
+
+ private static String message = "";
+
+ public void log(String string)
+ {
+ message = string;
+ }
+
+ public static void reset()
+ {
+ message = null;
+ }
+
+ /**
+ * @return the message
+ */
+ public static String getMessage()
+ {
+ return message;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/MockLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,64 @@
+/*
+ * 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.decorators.definition.inject.delegateConstructor;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Initializer;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class TimestampLogger
+{
+
+ public static final String PREFIX = TimestampLogger.class.getSimpleName();
+
+ private static Logger constructor;
+
+ @Initializer
+ public TimestampLogger(@Decorates Logger logger)
+ {
+ constructor = logger;
+ }
+
+ public void log(String message)
+ {
+ constructor.log(PREFIX + message);
+ }
+
+ /**
+ * @return the constructor
+ */
+ public static Logger getConstructor()
+ {
+ return constructor;
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public static void reset()
+ {
+ constructor = null;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/CowShed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/CowShed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/CowShed.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,37 @@
+/*
+ * 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.decorators.definition.inject.delegateField;
+
+import javax.enterprise.inject.Current;
+
+/**
+ * @author pmuir
+ *
+ */
+public class CowShed
+{
+
+ public static final String MESSAGE = "cowShed";
+
+ @Current Logger logger;
+
+ public void milk()
+ {
+ logger.log(MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/CowShed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/DelegateFieldInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/DelegateFieldInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/DelegateFieldInjectionPointTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,50 @@
+/*
+ * 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.decorators.definition.inject.delegateField;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DelegateFieldInjectionPointTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="8.1.2", id="cc")
+ })
+ public void testDecoratorDelegateInjectionPoints()
+ {
+ TimestampLogger.reset();
+ MockLogger.reset();
+ getInstanceByType(CowShed.class).milk();
+ assert TimestampLogger.getField() != null;
+ assert MockLogger.getMessage().equals(TimestampLogger.PREFIX + CowShed.MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/DelegateFieldInjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/Logger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/Logger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,29 @@
+/*
+ * 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.decorators.definition.inject.delegateField;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Logger
+{
+
+ public void log(String string);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/MockLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/MockLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/MockLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,46 @@
+/*
+ * 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.decorators.definition.inject.delegateField;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockLogger implements Logger
+{
+
+ private static String message = "";
+
+ public void log(String string)
+ {
+ message = string;
+ }
+
+ public static void reset()
+ {
+ message = null;
+ }
+
+ /**
+ * @return the message
+ */
+ public static String getMessage()
+ {
+ return message;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/MockLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,61 @@
+/*
+ * 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.decorators.definition.inject.delegateField;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class TimestampLogger
+{
+
+ public static final String PREFIX = TimestampLogger.class.getSimpleName();
+
+ @Decorates
+ private Logger instanceField;
+
+ private static Logger field;
+
+ public void log(String message)
+ {
+ field = instanceField;
+ field.log(PREFIX + message);
+ }
+
+ /**
+ * @return the field
+ */
+ public static Logger getField()
+ {
+ return field;
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public static void reset()
+ {
+ field = null;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/CowShed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/CowShed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/CowShed.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,37 @@
+/*
+ * 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.decorators.definition.inject.delegateInitializerMethod;
+
+import javax.enterprise.inject.Current;
+
+/**
+ * @author pmuir
+ *
+ */
+public class CowShed
+{
+
+ public static final String MESSAGE = "cowShed";
+
+ @Current Logger logger;
+
+ public void milk()
+ {
+ logger.log(MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/CowShed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/DelegateInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/DelegateInjectionPointTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/DelegateInjectionPointTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,50 @@
+/*
+ * 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.decorators.definition.inject.delegateInitializerMethod;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+@BeansXml("beans.xml")
+@SpecVersion("20090625")
+public class DelegateInjectionPointTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertions({
+ @SpecAssertion(section="8.1.2", id="cd")
+ })
+ public void testDecoratorDelegateInjectionPoints()
+ {
+ TimestampLogger.reset();
+ MockLogger.reset();
+ getInstanceByType(CowShed.class).milk();
+ assert TimestampLogger.getInitializerMethod() != null;
+ assert MockLogger.getMessage().equals(TimestampLogger.PREFIX + CowShed.MESSAGE);
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/DelegateInjectionPointTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/Logger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/Logger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/Logger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,29 @@
+/*
+ * 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.decorators.definition.inject.delegateInitializerMethod;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public interface Logger
+{
+
+ public void log(String string);
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/Logger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/MockLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/MockLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/MockLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,46 @@
+/*
+ * 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.decorators.definition.inject.delegateInitializerMethod;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockLogger implements Logger
+{
+
+ private static String message = "";
+
+ public void log(String string)
+ {
+ message = string;
+ }
+
+ public static void reset()
+ {
+ message = null;
+ }
+
+ /**
+ * @return the message
+ */
+ public static String getMessage()
+ {
+ return message;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/MockLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,64 @@
+/*
+ * 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.decorators.definition.inject.delegateInitializerMethod;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Initializer;
+
+
+/**
+ * @author pmuir
+ *
+ */
+@Decorator
+public class TimestampLogger
+{
+
+ public static final String PREFIX = TimestampLogger.class.getSimpleName();
+
+ private static Logger initializerMethod;
+
+ @Initializer
+ public void setLogger(@Decorates Logger logger)
+ {
+ initializerMethod = logger;
+ }
+
+ public void log(String message)
+ {
+ initializerMethod.log(PREFIX + message);
+ }
+
+ /**
+ * @return the initializerMethod
+ */
+ public static Logger getInitializerMethod()
+ {
+ return initializerMethod;
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public static void reset()
+ {
+ initializerMethod = null;
+ }
+
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/TimestampLogger.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/Game.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -4,14 +4,16 @@
import javax.enterprise.inject.Named;
@Named
-class Game
+public class Game
{
@Initializer
public void initialize(Counter counter) {
counter.add();
}
- public boolean getValue() {
- return true;
+ public String getValue()
+ {
+ return "foo";
}
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-08-07 11:28:32 UTC (rev 3403)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/el/ResolutionByNameTest.java 2009-08-07 13:02:37 UTC (rev 3404)
@@ -20,10 +20,10 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -32,12 +32,11 @@
public class ResolutionByNameTest extends AbstractJSR299Test
{
- @Test(groups="ri-broken")
+ @Test
@SpecAssertion(section="5.8", id="c")
- //WBRI-322
public void testQualifiedNameLookup()
{
- assert getCurrentConfiguration().getEl().evaluateValueExpression("#{(game.value and game.value) ? game.value : false}", Boolean.class);
+ assert getCurrentConfiguration().getEl().evaluateValueExpression("#{(game.value == 'foo' and game.value == 'foo') ? game.value == 'foo' : false}", Boolean.class);
assert getInstanceByType(Counter.class).getCount() == 1;
}
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/beans.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.definition.inject.broken.delegateProducerMethod.TimestampLogger</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/broken/delegateProducerMethod/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.definition.inject.delegateConstructor.TimestampLogger</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateConstructor/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/beans.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.definition.inject.delegateField.TimestampLogger</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -0,0 +1,5 @@
+<beans>
+ <decorators>
+ <class>org.jboss.jsr299.tck.tests.decorators.definition.inject.delegateInitializerMethod.TimestampLogger</class>
+ </decorators>
+</beans>
Property changes on: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateInitializerMethod/beans.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 11:28:32 UTC (rev 3403)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 13:02:37 UTC (rev 3404)
@@ -1,7 +1,7 @@
<specification
xmlns="http://jboss.com/products/webbeans/tck/audit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit http://snapshots.jboss.org/maven2/org/hibernate/tck-utils-api/0.9-SNAPSHO..."
+ xsi:schemaLocation="http://jboss.com/products/webbeans/tck/audit /Users/pmuir/workspace/jboss-test-audit/api/src/main/resources/tck-audit.xsd"
name="JSR-299: Java Contexts and Dependency Injection"
version="20090625">
@@ -3551,19 +3551,28 @@
<text>A decorator must have exactly one delegate injection point. If a decorator ~has more than one delegate injection point, or~ does not have a delegate injection point, 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="cc">
- <text>The delegate injection point must be an injected field, ~initializer method parameter or bean constructor method parameter~. If an injection point that is not an injected field, ~initializer method parameter or bean constructor method parameter ~is annotated |@Decorates|, 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>
+ <group>
+ <text>The delegate injection point must be an injected field, initializer method parameter or bean constructor method parameter. If an injection point that is not an injected field, initializer method parameter or bean constructor method parameter is annotated |@Decorates|, 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 id="cd">
- <text>The delegate injection point must be an ~injected field~, initializer method parameter or ~bean constructor method parameter~. If an injection point that is not an ~injected field~, initializer method parameter or ~bean constructor method parameter ~is annotated |@Decorates|, 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="cc">
+ <text>Check an injected field is ok</text>
+ </assertion>
- <assertion id="ce">
- <text>The delegate injection point must be an ~injected field, initializer method parameter~ or bean constructor method parameter. If an injection point that is not an ~injected field, initializer method parameter~ or bean constructor method parameter is annotated |@Decorates|, 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="cd">
+ <text>Check an initializer method parameter is ok</text>
+ </assertion>
- <assertion id="cf">
+ <assertion id="ce">
+ <text>Check a bean constructor method parameter is ok</text>
+ </assertion>
+
+ <assertion id="cf">
+ <text>Check that a producer method parameter is not ok</text>
+ </assertion>
+
+ </group>
+
+ <assertion id="cg">
<text>If a bean class that is not a decorator has an injection point annotated |@Decorates|, 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>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3403 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-08-07 07:28:32 -0400 (Fri, 07 Aug 2009)
New Revision: 3403
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AbstractC.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AlternativeMetaDataTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ClassD.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/DogHouse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceA.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceB.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Bird.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CreationalContextImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Dog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogBed.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Noisy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Preferred.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Quiet.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
More tests for chapter 11 and some general cleanup in the API and impl.
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java 2009-08-05 03:51:22 UTC (rev 3402)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -22,7 +22,15 @@
import javax.interceptor.InvocationContext;
-
+/**
+ * Main interface for all Bean objects representing an interceptor.
+ *
+ * @author Gavin King
+ * @author Pete Muir
+ * @author David Allen
+ *
+ * @param <T>
+ */
public interface Interceptor<T> extends Bean<T>
{
@@ -33,7 +41,23 @@
*/
public Set<Annotation> getInterceptorBindingTypes();
+ /**
+ * Tests if this intercepts callbacks or business methods of the given type
+ *
+ * @param type The type of interception
+ * @return true if this intercepts the given type of methods
+ */
public boolean intercepts(InterceptionType type);
+
+ /**
+ * Invokes the specified kind of lifecycle callback or business method upon the
+ * given instance
+ *
+ * @param type the interception type
+ * @param instance the instance to invoke
+ * @param ctx the context for the invocation
+ * @return the return value from the invocation
+ */
public Object intercept(InterceptionType type, T instance, InvocationContext ctx);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-08-05 03:51:22 UTC (rev 3402)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -18,15 +18,11 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
-import java.util.Arrays;
import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
import java.util.Set;
import javax.decorator.Decorates;
import javax.enterprise.context.Dependent;
-import javax.enterprise.event.Event;
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Named;
import javax.enterprise.inject.Policy;
@@ -37,7 +33,6 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.conversation.ConversationImpl;
import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBField;
@@ -64,30 +59,8 @@
private static final Annotation ANY_LITERAL = new AnyLiteral();
private static final Annotation CURRENT_LITERAL = new CurrentLiteral();
- @SuppressWarnings("unchecked")
- private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, BeanManagerImpl.class, ConversationImpl.class));
-
private boolean proxyable;
- /**
- * Helper method for getting the highest precedence enabled deployment type
- *
- * @param enabledDeploymentTypes The currently enabled deployment types
- * @param possibleDeploymentTypes The possible deployment types
- * @return The deployment type
- */
- public static Class<? extends Annotation> getDeploymentType(List<Class<? extends Annotation>> enabledDeploymentTypes, Map<Class<? extends Annotation>, Annotation> possibleDeploymentTypes)
- {
- for (int i = (enabledDeploymentTypes.size() - 1); i > 0; i--)
- {
- if (possibleDeploymentTypes.containsKey((enabledDeploymentTypes.get(i))))
- {
- return enabledDeploymentTypes.get(i);
- }
- }
- return null;
- }
-
// Logger
private final Log log = Logging.getLog(AbstractBean.class);
// The binding types
@@ -283,7 +256,7 @@
Bean<?> resolvedBean = manager.getBeans(injectionPoint.getJavaClass(), bindings).iterator().next();
if (passivating)
{
- if (Dependent.class.equals(resolvedBean.getScopeType()) && !Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint instanceof WBField) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter)))
+ if (Dependent.class.equals(resolvedBean.getScopeType()) && !Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint instanceof WBField<?>) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter<?>)))
{
return false;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-08-05 03:51:22 UTC (rev 3402)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -114,7 +114,7 @@
AnnotationStore annotationStore = AnnotationStore.of(clazz.getAnnotations(), clazz.getDeclaredAnnotations(), classTransformer.getTypeStore());
return new WBClassImpl<T>(clazz, clazz, annotationStore, classTransformer);
}
-
+
public static <T> WBClass<T> of(AnnotatedType<T> annotatedType, ClassTransformer classTransformer)
{
AnnotationStore annotationStore = AnnotationStore.of(annotatedType.getAnnotations(), annotatedType.getAnnotations(), classTransformer.getTypeStore());
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AbstractC.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AbstractC.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AbstractC.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class AbstractC implements InterfaceA
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AbstractC.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AlternativeMetaDataTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AlternativeMetaDataTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AlternativeMetaDataTest.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Contains all the functioning tests for the extension which provides
+ * alternative meta data sources. Some of the assertions are really statements
+ * of intent, but are tested here to make sure the container provides implementations
+ * that meet that same intent as any third party extension would.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@SpecVersion("20090625")
+public class AlternativeMetaDataTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "c")
+ public void testBaseType()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(DogHouse.class);
+ assert annotatedType.getBaseType().equals(DogHouse.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "d")
+ public void testTypeClosure()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(ClassD.class);
+ assert annotatedType.getTypeClosure().contains(Object.class);
+ assert annotatedType.getTypeClosure().contains(InterfaceA.class);
+ assert annotatedType.getTypeClosure().contains(InterfaceB.class);
+ assert annotatedType.getTypeClosure().contains(AbstractC.class);
+ assert annotatedType.getTypeClosure().contains(ClassD.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "e")
+ public void testGetAnnotation()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(ClassD.class);
+ assert annotatedType.getAnnotation(RequestScoped.class) != null;
+ assert annotatedType.getAnnotation(ApplicationScoped.class) == null;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "f")
+ public void testGetAnnotations()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(ClassD.class);
+ assert annotatedType.getAnnotations().size() == 2;
+ assert annotatedType.getAnnotations().contains(RequestScoped.class);
+ assert annotatedType.getAnnotations().contains(Tame.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.4", id = "g")
+ public void testIsAnnotationPresent()
+ {
+ AnnotatedType<?> annotatedType = getCurrentManager().createAnnotatedType(ClassD.class);
+ assert annotatedType.isAnnotationPresent(RequestScoped.class);
+ assert annotatedType.isAnnotationPresent(ApplicationScoped.class);
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/AlternativeMetaDataTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ClassD.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ClassD.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ClassD.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.context.RequestScoped;
+
+@RequestScoped
+@Tame
+class ClassD extends AbstractC implements InterfaceB
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/ClassD.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Dog.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+class Dog
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Dog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/DogHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/DogHouse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/DogHouse.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import javax.enterprise.inject.Current;
+
+class DogHouse
+{
+ @Current
+ protected Dog dog;
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/DogHouse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceA.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceA.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceA.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+interface InterfaceA
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceA.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceB.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceB.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceB.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+interface InterfaceB
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/InterfaceB.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Tame.java (from rev 3398, tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Tame.java)
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/annotated/Tame.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.annotated;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.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/extensions/beanManager/BeanManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-05 03:51:22 UTC (rev 3402)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -89,12 +89,11 @@
getCurrentManager().resolve(beans);
}
- @Test(groups = "ri-broken", expectedExceptions = InjectionException.class)
+ @Test(expectedExceptions = InjectionException.class)
@SpecAssertions({
@SpecAssertion(section = "11.3.9", id = "a"),
@SpecAssertion(section = "11.3.9", id = "b")
})
- //WBRI-333
public void testValidateThrowsException()
{
DogHouse dogHouse = getInstanceByType(DogHouse.class);
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Bird.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Bird.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Bird.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+class Bird
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Bird.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+class Cat
+{
+ private static boolean initializerCalled;
+
+ @Current
+ protected Bird bird;
+
+ @Initializer
+ public Cat(Dog friend)
+ {
+ initializerCalled = true;
+ }
+
+ public static boolean isInitializerCalled()
+ {
+ return initializerCalled;
+ }
+
+ public static void setInitializerCalled(boolean initializerCalled)
+ {
+ Cat.initializerCalled = initializerCalled;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Cat.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CreationalContextImpl.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CreationalContextImpl.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CreationalContextImpl.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.context.spi.CreationalContext;
+
+class CreationalContextImpl<T> implements CreationalContext<T>
+{
+
+ public void push(T incompleteInstance)
+ {
+ }
+
+ public void release()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/CreationalContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Dog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Dog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Dog.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,55 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+
+class Dog
+{
+ private static boolean constructorCalled = false;
+ private static DogBed dogBed;
+
+ public static final String DEFAULT_COLOR = "Brown";
+ private String color = DEFAULT_COLOR;
+
+ public Dog()
+ {
+ constructorCalled = true;
+ }
+
+ public Dog(String color)
+ {
+ this.color = color;
+ }
+
+ @Initializer
+ public void init(@Current DogBed dogBed)
+ {
+ Dog.dogBed = dogBed;
+ }
+
+ public static boolean isConstructorCalled()
+ {
+ return constructorCalled;
+ }
+
+ public static void setConstructorCalled(boolean constructorCalled)
+ {
+ Dog.constructorCalled = constructorCalled;
+ }
+
+ public static DogBed getDogBed()
+ {
+ return dogBed;
+ }
+
+ public static void setDogBed(DogBed dogBed)
+ {
+ Dog.dogBed = dogBed;
+ }
+
+ public String getColor()
+ {
+ return color;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Dog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogBed.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogBed.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogBed.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+class DogBed
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogBed.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,45 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+
+class DogProducer
+{
+ public static final String DOG_COLOR = "Black";
+ private static boolean noisyDogProducerCalled;
+
+ @Produces @Quiet
+ private Dog quietDog = new Dog(DOG_COLOR);
+
+ @Produces @Noisy
+ public Dog produceNoisyDog()
+ {
+ noisyDogProducerCalled = true;
+ return new Dog();
+ }
+
+ public void disposeNoisyDog(@Disposes @Noisy Dog dog)
+ {
+
+ }
+
+ public void disposeQuietDog(@Disposes @Quiet Dog dog)
+ {
+
+ }
+
+ public static boolean isNoisyDogProducerCalled()
+ {
+ return noisyDogProducerCalled;
+ }
+
+ public static void setNoisyDogProducerCalled(boolean noisyDogProducerCalled)
+ {
+ DogProducer.noisyDogProducerCalled = noisyDogProducerCalled;
+ }
+
+ public Dog getQuietDog()
+ {
+ return quietDog;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/DogProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Noisy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Noisy.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Noisy.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+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 Noisy
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Noisy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Preferred.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Preferred.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Preferred.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+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 Preferred
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Preferred.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,71 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Specializes;
+
+@Specializes @Preferred
+class PreferredDogProducer extends DogProducer
+{
+
+ public static final String DOG_COLOR = "Gray";
+ private static boolean noisyDogProducerCalled;
+ private static boolean noisyDogDisposed;
+ private static boolean quietDogDisposed;
+
+ @Produces @Quiet
+ private Dog preferredQuietDog = new Dog(DOG_COLOR);
+
+ @Override
+ public Dog getQuietDog()
+ {
+ return preferredQuietDog;
+ }
+
+ @Override
+ public Dog produceNoisyDog()
+ {
+ return new Dog(DOG_COLOR);
+ }
+
+ public void disposeNoisyDog(@Disposes @Noisy Dog dog)
+ {
+ noisyDogDisposed = true;
+ }
+
+ public void disposeQuietDog(@Disposes @Quiet Dog dog)
+ {
+ quietDogDisposed = true;
+ }
+
+ public static boolean isNoisyDogProducerCalled()
+ {
+ return noisyDogProducerCalled;
+ }
+
+ public static void setNoisyDogProducerCalled(boolean noisyDogProducerCalled)
+ {
+ PreferredDogProducer.noisyDogProducerCalled = noisyDogProducerCalled;
+ }
+
+ public static boolean isNoisyDogDisposed()
+ {
+ return noisyDogDisposed;
+ }
+
+ public static boolean isQuietDogDisposed()
+ {
+ return quietDogDisposed;
+ }
+
+ public static void setNoisyDogDisposed(boolean noisyDogDisposed)
+ {
+ PreferredDogProducer.noisyDogDisposed = noisyDogDisposed;
+ }
+
+ public static void setQuietDogDisposed(boolean quietDogDisposed)
+ {
+ PreferredDogProducer.quietDogDisposed = quietDogDisposed;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/PreferredDogProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,54 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.ProcessProducer;
+import javax.enterprise.inject.spi.Producer;
+
+class ProducerProcessor
+{
+ private static Producer<Dog> dogProducer;
+ private static Producer<Cat> catProducer;
+ private static Producer<Dog> noisyDogProducer;
+ private static Producer<Dog> quietDogProducer;
+
+ public void processDogProducer(@Observes ProcessProducer<Dog, Dog> producerEvent)
+ {
+ if (producerEvent.getAnnotatedMember().isAnnotationPresent(Noisy.class))
+ {
+ noisyDogProducer = producerEvent.getProducer();
+ }
+ else if (producerEvent.getAnnotatedMember().isAnnotationPresent(Quiet.class))
+ {
+ quietDogProducer = producerEvent.getProducer();
+ }
+ else
+ {
+ dogProducer = producerEvent.getProducer();
+ }
+ }
+
+ public void processCatProducer(@Observes ProcessProducer<Cat, Cat> producerEvent)
+ {
+ catProducer = producerEvent.getProducer();
+ }
+
+ public static Producer<Dog> getDogProducer()
+ {
+ return dogProducer;
+ }
+
+ public static Producer<Dog> getNoisyDogProducer()
+ {
+ return noisyDogProducer;
+ }
+
+ public static Producer<Dog> getQuietDogProducer()
+ {
+ return quietDogProducer;
+ }
+
+ public static Producer<Cat> getCatProducer()
+ {
+ return catProducer;
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,158 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.Producer;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+/**
+ * Producer extension tests.
+ *
+ * @author David Allen
+ *
+ */
+@Artifact
+@SpecVersion("20090625")
+public class ProducerTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "ba")
+ })
+ public void testProduceCallsInitializer()
+ {
+ Producer<Cat> producer = ProducerProcessor.getCatProducer();
+ Cat.setInitializerCalled(false);
+ producer.produce(new CreationalContextImpl<Cat>());
+ assert Cat.isInitializerCalled();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "bb")
+ })
+ public void testProduceCallsConstructor()
+ {
+ Producer<Dog> producer = ProducerProcessor.getDogProducer();
+ Dog.setConstructorCalled(false);
+ producer.produce(new CreationalContextImpl<Dog>());
+ assert Dog.isConstructorCalled();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "c")
+ })
+ public void testDisposeDoesNothing()
+ {
+ Producer<Dog> producer = ProducerProcessor.getDogProducer();
+ Dog dog = getInstanceByType(Dog.class);
+ producer.dispose(dog);
+ // The instance should still be available
+ assert dog == getInstanceByType(Dog.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "da")
+ })
+ public void testGetInjectionPointsForFields()
+ {
+ Producer<Cat> producer = ProducerProcessor.getCatProducer();
+ assert producer.getInjectionPoints().size() == 2;
+ boolean birdIPPresent = false;
+ for (InjectionPoint injectionPoint : producer.getInjectionPoints())
+ {
+ if (injectionPoint.getType().equals(Bird.class))
+ {
+ birdIPPresent = true;
+ }
+ }
+ assert birdIPPresent;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "db")
+ })
+ public void testGetInjectionPointsForConstructor()
+ {
+ Producer<Cat> producer = ProducerProcessor.getCatProducer();
+ assert producer.getInjectionPoints().size() == 2;
+ boolean dogIPPresent = false;
+ for (InjectionPoint injectionPoint : producer.getInjectionPoints())
+ {
+ if (injectionPoint.getType().equals(Dog.class))
+ {
+ dogIPPresent = true;
+ }
+ }
+ assert dogIPPresent;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "dc")
+ })
+ public void testGetInjectionPointsForInitializer()
+ {
+ Producer<Dog> producer = ProducerProcessor.getDogProducer();
+ assert producer.getInjectionPoints().size() == 1;
+ assert producer.getInjectionPoints().iterator().next().getType().equals(DogBed.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "ea")
+ })
+ public void testProduceCallsProducerMethod()
+ {
+ PreferredDogProducer.setNoisyDogProducerCalled(false);
+ Producer<Dog> producer = ProducerProcessor.getNoisyDogProducer();
+ Dog dog = (Dog) producer.produce(new CreationalContextImpl<Dog>());
+ assert PreferredDogProducer.isNoisyDogProducerCalled();
+ assert dog.getColor().equals(PreferredDogProducer.DOG_COLOR);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "eb")
+ })
+ public void testProduceAccessesProducerField()
+ {
+ Producer<Dog> producer = ProducerProcessor.getQuietDogProducer();
+ Dog dog = (Dog) producer.produce(new CreationalContextImpl<Dog>());
+ assert dog.getColor().equals(PreferredDogProducer.DOG_COLOR);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "fa")
+ })
+ public void testProducerForMethodDisposesProduct()
+ {
+ PreferredDogProducer.setNoisyDogDisposed(false);
+ Producer<Dog> producer = ProducerProcessor.getNoisyDogProducer();
+ Dog dog = (Dog) producer.produce(new CreationalContextImpl<Dog>());
+ producer.dispose(dog);
+ assert PreferredDogProducer.isNoisyDogDisposed();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.2", id = "fb")
+ })
+ public void testProducerForFieldDisposesProduct()
+ {
+ PreferredDogProducer.setQuietDogDisposed(false);
+ Producer<Dog> producer = ProducerProcessor.getQuietDogProducer();
+ Dog dog = (Dog) producer.produce(new CreationalContextImpl<Dog>());
+ producer.dispose(dog);
+ assert PreferredDogProducer.isQuietDogDisposed();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/ProducerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Quiet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Quiet.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Quiet.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.extensions.producer;
+
+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 Quiet
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/producer/Quiet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-08-05 03:51:22 UTC (rev 3402)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/interceptors/definition/InterceptorDefinitionTest.java 2009-08-07 11:28:32 UTC (rev 3403)
@@ -73,8 +73,46 @@
@Test(groups = "ri-broken")
@SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "b")
+ })
+ // WBRI-59
+ public void testInterceptorBindingTypes()
+ {
+ Interceptor<?> interceptorBean = (Interceptor<?>) getBeans(TransactionalInterceptor.class).iterator().next();
+ assert interceptorBean.getInterceptorBindingTypes().size() == 1;
+ assert interceptorBean.getInterceptorBindingTypes().contains(Transactional.class);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "11.1.2", id = "c"),
+ @SpecAssertion(section = "11.1.2", id = "e")
+ })
+ // WBRI-59
+ public void testInterceptionType()
+ {
+ Interceptor<?> interceptorBean = (Interceptor<?>) getBeans(TransactionalInterceptor.class).iterator().next();
+ assert interceptorBean.intercepts(InterceptionType.AROUND_INVOKE);
+ assert !interceptorBean.intercepts(InterceptionType.POST_ACTIVATE);
+ assert !interceptorBean.intercepts(InterceptionType.POST_CONSTRUCT);
+ assert !interceptorBean.intercepts(InterceptionType.PRE_DESTROY);
+ assert !interceptorBean.intercepts(InterceptionType.PRE_PASSIVATE);
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "11.1.2", id = "f")
+ // WBRI-59
+ public void testInstanceOfInterceptorForEveryEnabledInterceptor()
+ {
+ assert !getBeans(TransactionalInterceptor.class).isEmpty();
+ assert !getBeans(SecureInterceptor.class).isEmpty();
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
@SpecAssertion(section = "11.3.13", id = "a")
})
+ // WBRI-59
public void testResolveInterceptorsReturnsOrderedList()
{
Annotation transactionalBinding = new AnnotationLiteral<Transactional>() {};
@@ -95,6 +133,7 @@
@SpecAssertions({
@SpecAssertion(section = "11.3.13", id = "b")
})
+ // WBRI-59
public void testSameBindingTypesToResolveInterceptorsFails()
{
Annotation transactionalBinding = new AnnotationLiteral<Transactional>() {};
@@ -105,6 +144,7 @@
@SpecAssertions({
@SpecAssertion(section = "11.3.13", id = "c")
})
+ // WBRI-59
public void testNoBindingTypesToResolveInterceptorsFails()
{
getCurrentManager().resolveInterceptors(InterceptionType.AROUND_INVOKE);
@@ -114,6 +154,7 @@
@SpecAssertions({
@SpecAssertion(section = "11.3.13", id = "d")
})
+ // WBRI-59
public void testNonBindingTypeToResolveInterceptorsFails()
{
Annotation nonBinding = new AnnotationLiteral<NonBindingType>() {};
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-05 03:51:22 UTC (rev 3402)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-07 11:28:32 UTC (rev 3403)
@@ -4304,11 +4304,16 @@
</section>
<section id="11.2" title="The Producer and InjectionTarget interfaces">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>The interface |javax.enterprise.inject.spi.Producer| provides a generic operation for producing an instance of a type.</text>
+ <note>Statement of intent</note>
</assertion>
+
+ <assertion id="ba">
+ <text>For a |Producer| that represents a class, |produce()| calls the constructor annotated |@Initializer| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.6.3, "Injection using the bean constructor".</text>
+ </assertion>
- <assertion id="b">
+ <assertion id="bb">
<text>For a |Producer| that represents a class, |produce()| calls the constructor annotated |@Initializer| if it exists, or the constructor with no parameters otherwise, as defined in Section 5.6.3, "Injection using the bean constructor".</text>
</assertion>
@@ -4316,18 +4321,34 @@
<text>For a |Producer| that represents a class, |dispose()| does nothing.</text>
</assertion>
- <assertion id="d">
- <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and initializer method parameters.</text>
+ <assertion id="da">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all _injected fields_, bean constructor parameters and initializer method parameters.</text>
</assertion>
- <assertion id="e">
- <text>For a Producer that represents a producer method or field, |produce()| calls the producer method on, or accesses the producer field of, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
+ <assertion id="db">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, _bean constructor parameters_ and initializer method parameters.</text>
</assertion>
- <assertion id="f">
- <text>For a Producer that represents a producer method or field, |dispose()| calls the disposer method, if any, on a contextual instance of the most specialized bean that specializes the bean that declares the disposer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods", or performs any additional required cleanup, if any, to destroy state associated with a resource.</text>
+ <assertion id="dc">
+ <text>For a |Producer| that represents a class, |getInjectionPoints()| returns a set of |InjectionPoint| objects representing all injected fields, bean constructor parameters and _initializer method parameters_.</text>
</assertion>
+ <assertion id="ea">
+ <text>For a Producer that represents a producer _method_ or field, |produce()| _calls the producer method on_, or accesses the producer field of, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
+ </assertion>
+
+ <assertion id="eb">
+ <text>For a Producer that represents a producer method or _field_, |produce()| calls the producer method on, _or accesses the producer field of_, a contextual instance of the most specialized bean that specializes the bean that declares the producer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods".</text>
+ </assertion>
+
+ <assertion id="fa">
+ <text>For a Producer that represents a producer _method_ or field, |dispose()| calls the disposer method, if any, on a contextual instance of the most specialized bean that specializes the bean that declares the disposer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods", or performs any additional required cleanup, if any, to destroy state associated with a resource.</text>
+ </assertion>
+
+ <assertion id="fb">
+ <text>For a Producer that represents a producer method or _field_, |dispose()| calls the disposer method, if any, on a contextual instance of the most specialized bean that specializes the bean that declares the disposer method, as defined in Section 5.6.6, "Invocation of producer or disposer methods", or performs any additional required cleanup, if any, to destroy state associated with a resource.</text>
+ </assertion>
+
<assertion id="g">
<text>For a Producer that represents a producer method or field, |getInjectionPoints()| returns the set of |InjectionPoint| objects representing all parameters of the producer method.</text>
</assertion>
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3402 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating: broken27 and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-04 23:51:22 -0400 (Tue, 04 Aug 2009)
New Revision: 3402
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/BrokenDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/District.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EspooLocal_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/Espoo_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/BrokenDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/District.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EnterpriseBeanWithNonPassivatingConstructorFieldInDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EspooLocal_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/Espoo_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/BrokenDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/District.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EnterpriseBeanWithNonPassivatingInitializerFieldInDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EspooLocal_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/Espoo_Broken.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
Log:
tests for 6.6.4.bdd, bde, bdf
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java 2009-08-05 01:03:49 UTC (rev 3401)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -1,7 +1,5 @@
package org.jboss.jsr299.tck.tests.context.passivating.broken27;
-import javax.enterprise.inject.IllegalProductException;
-
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/BrokenDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/BrokenDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/BrokenDecorator.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken28;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Current;
+
+@Decorator
+class BrokenDecorator implements EspooLocal_Broken
+{
+ @Decorates EspooLocal_Broken espooLocal;
+
+ @Current District district;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/District.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/District.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/District.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken28;
+
+import javax.enterprise.context.Dependent;
+
+@Dependent
+class District
+{
+ public void ping()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken28;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DeploymentError.class)
+@SpecVersion("20090625")
+public class EnterpriseBeanWithNonPassivatingInjectedFieldInDecoratorTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "passivation", "ri-broken" })
+ @SpecAssertion(section = "6.6.4", id = "bdd")
+ public void testSessionBeanWithNonPassivatingInjectedFieldInDecoratorFails()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EspooLocal_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EspooLocal_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/EspooLocal_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken28;
+
+import javax.ejb.Local;
+
+@Local
+public interface EspooLocal_Broken
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/Espoo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/Espoo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken28/Espoo_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken28;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@Stateful
+@SessionScoped
+(a)Interceptors(BrokenDecorator.class)
+class Espoo_Broken implements EspooLocal_Broken
+{
+ @Remove
+ public void bye() {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/BrokenDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/BrokenDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/BrokenDecorator.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken29;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+@Decorator
+class BrokenDecorator implements EspooLocal_Broken
+{
+ @Decorates EspooLocal_Broken espooLocal;
+
+ @Initializer
+ public BrokenDecorator(@Current District district) {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/District.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/District.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/District.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken29;
+
+import javax.enterprise.context.Dependent;
+
+@Dependent
+class District
+{
+ public void ping()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EnterpriseBeanWithNonPassivatingConstructorFieldInDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EnterpriseBeanWithNonPassivatingConstructorFieldInDecoratorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EnterpriseBeanWithNonPassivatingConstructorFieldInDecoratorTest.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken29;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DeploymentError.class)
+@SpecVersion("20090625")
+public class EnterpriseBeanWithNonPassivatingConstructorFieldInDecoratorTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "passivation", "ri-broken" })
+ @SpecAssertion(section = "6.6.4", id = "bde")
+ public void testSessionBeanWithNonPassivatingConstructorFieldInDecoratorFails()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EspooLocal_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EspooLocal_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/EspooLocal_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken29;
+
+import javax.ejb.Local;
+
+@Local
+public interface EspooLocal_Broken
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/Espoo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/Espoo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken29/Espoo_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken29;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@Stateful
+@SessionScoped
+(a)Interceptors(BrokenDecorator.class)
+class Espoo_Broken implements EspooLocal_Broken
+{
+ @Remove
+ public void bye() {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/BrokenDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/BrokenDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/BrokenDecorator.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken30;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
+
+@Decorator
+class BrokenDecorator implements EspooLocal_Broken
+{
+ @Decorates EspooLocal_Broken espooLocal;
+
+ @Initializer
+ public void init(@Current District district) {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/District.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/District.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/District.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken30;
+
+import javax.enterprise.context.Dependent;
+
+@Dependent
+class District
+{
+ public void ping()
+ {
+
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EnterpriseBeanWithNonPassivatingInitializerFieldInDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EnterpriseBeanWithNonPassivatingInitializerFieldInDecoratorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EnterpriseBeanWithNonPassivatingInitializerFieldInDecoratorTest.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,26 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken30;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DeploymentError.class)
+@SpecVersion("20090625")
+public class EnterpriseBeanWithNonPassivatingInitializerFieldInDecoratorTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "passivation", "ri-broken" })
+ @SpecAssertion(section = "6.6.4", id = "bdf")
+ public void testSessionBeanWithNonPassivatingInitializerFieldInDecoratorFails()
+ {
+ assert false;
+ }
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EspooLocal_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EspooLocal_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/EspooLocal_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken30;
+
+import javax.ejb.Local;
+
+@Local
+public interface EspooLocal_Broken
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/Espoo_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/Espoo_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken30/Espoo_Broken.java 2009-08-05 03:51:22 UTC (rev 3402)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken30;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.enterprise.context.SessionScoped;
+import javax.interceptor.Interceptors;
+
+@Stateful
+@SessionScoped
+(a)Interceptors(BrokenDecorator.class)
+class Espoo_Broken implements EspooLocal_Broken
+{
+ @Remove
+ public void bye() {
+ }
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3401 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating: broken25 and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-04 21:03:49 -0400 (Tue, 04 Aug 2009)
New Revision: 3401
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/Broken_Record.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/FooScoped.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/NonPassivationCapableProducerFieldTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/RecordProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/British.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/CowProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/EnterpriseBeanWithIllegalDependencyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/MaarianHaminaLocal_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Maarianhamina_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianHaminaLocal_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianhaminaDecorator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/Maarianhamina_Broken.java
Log:
more passivating context tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/Broken_Record.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/Broken_Record.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/Broken_Record.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken25;
+
+class Broken_Record
+{
+ public Broken_Record(String foo) {}
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/FooScoped.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/FooScoped.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/FooScoped.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken25;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType(passivating = true)
+@interface FooScoped
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/NonPassivationCapableProducerFieldTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/NonPassivationCapableProducerFieldTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/NonPassivationCapableProducerFieldTest.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,34 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken25;
+
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Shane Bryzak
+ */
+@Artifact
+(a)Packaging(PackagingType.EAR)
+@SpecVersion("20090625")
+(a)ExpectedDeploymentException(DeploymentError.class)
+public class NonPassivationCapableProducerFieldTest
+{
+ @Test(groups = { "passivation", "ri-broken" })
+ @SpecAssertions({
+ @SpecAssertion(section = "6.6.1", id = "db"),
+ @SpecAssertion(section = "6.6.3", id = "a"),
+ @SpecAssertion(section = "6.6.3", id = "b"),
+ @SpecAssertion(section = "6.6.4", id = "d")
+ })
+ public void testNonPassivationCapableProducerFieldNotOk()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/RecordProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/RecordProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken25/RecordProducer.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken25;
+
+import javax.enterprise.inject.Produces;
+
+class RecordProducer
+{
+ public final @Produces @FooScoped Broken_Record record = new Broken_Record(null);
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/British.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/British.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/British.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+
+@BindingType
+@Target( { FIELD, PARAMETER, METHOD, TYPE })
+@Retention(RUNTIME)
+@interface British
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Cow.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+class Cow
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/CowProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/CowProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/CowProducer.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+import javax.enterprise.inject.Produces;
+
+public class CowProducer
+{
+ @Produces @British public Cow cow = new Cow();
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/EnterpriseBeanWithIllegalDependencyTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/EnterpriseBeanWithIllegalDependencyTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/EnterpriseBeanWithIllegalDependencyTest.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+import javax.enterprise.inject.IllegalProductException;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+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.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(IllegalProductException.class)
+@SpecVersion("20090625")
+public class EnterpriseBeanWithIllegalDependencyTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "passivation", "integration"})
+ @SpecAssertion(section = "6.6.4", id = "fb")
+ public void testDependentScopedProducerFieldReturnsNonSerializableObjectForInjectionIntoStatefulSessionBeanFails()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/MaarianHaminaLocal_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/MaarianHaminaLocal_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/MaarianHaminaLocal_Broken.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+import javax.ejb.Local;
+
+@Local
+public interface MaarianHaminaLocal_Broken
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Maarianhamina_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Maarianhamina_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken26/Maarianhamina_Broken.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken26;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+public class Maarianhamina_Broken implements MaarianHaminaLocal_Broken
+{
+ @SuppressWarnings("unused")
+ @British Cow cow;
+
+ @Remove
+ public void bye() {
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/EnterpriseBeanWithNonPassivatingDecoratorTest.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,29 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken27;
+
+import javax.enterprise.inject.IllegalProductException;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.api.DeploymentException;
+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.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+@IntegrationTest
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DeploymentException.class)
+@SpecVersion("20090625")
+public class EnterpriseBeanWithNonPassivatingDecoratorTest extends AbstractJSR299Test
+{
+ @Test(groups = { "contexts", "passivation", "integration"})
+ @SpecAssertion(section = "6.6.4", id = "hb")
+ public void testEnterpriseBeanWithNonPassivatingDecoratorFails()
+ {
+ assert false;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianHaminaLocal_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianHaminaLocal_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianHaminaLocal_Broken.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken27;
+
+import javax.ejb.Local;
+
+@Local
+public interface MaarianHaminaLocal_Broken
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianhaminaDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianhaminaDecorator.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/MaarianhaminaDecorator.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken27;
+
+import javax.decorator.Decorates;
+import javax.decorator.Decorator;
+
+@Decorator
+class MaarianhaminaDecorator implements MaarianHaminaLocal_Broken
+{
+ public MaarianhaminaDecorator(String foo) {}
+
+ @Decorates MaarianHaminaLocal_Broken maarianHamina;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/Maarianhamina_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/Maarianhamina_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken27/Maarianhamina_Broken.java 2009-08-05 01:03:49 UTC (rev 3401)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken27;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+public class Maarianhamina_Broken implements MaarianHaminaLocal_Broken
+{
+ @Remove
+ public void bye() {
+ }
+}
15 years, 4 months
[webbeans-commits] Webbeans SVN: r3400 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/passivating/broken19 and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-08-04 20:43:53 -0400 (Tue, 04 Aug 2009)
New Revision: 3400
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Wheat.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/WheatProducer.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
passivating context tests, test groupings in tck-audit
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-08-04 16:57:40 UTC (rev 3399)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-08-05 00:43:53 UTC (rev 3400)
@@ -63,6 +63,14 @@
assert !beans.isEmpty();
}
+ @Test(groups = { "contexts", "passivation" })
+ @SpecAssertion(section = "6.6.1", id = "da")
+ public void testPassivationCapableProducerFieldIsOK()
+ {
+ Set<Bean<Wheat>> beans = getBeans(Wheat.class);
+ assert !beans.isEmpty();
+ }
+
@Test @SpecAssertion(section="6.6.2", id = "c")
public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Wheat.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Wheat.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Wheat.java 2009-08-05 00:43:53 UTC (rev 3400)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+class Wheat implements Serializable
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/WheatProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/WheatProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/WheatProducer.java 2009-08-05 00:43:53 UTC (rev 3400)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+
+public class WheatProducer
+{
+ public @Produces @SessionScoped Wheat wheat = new Wheat();
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java 2009-08-04 16:57:40 UTC (rev 3399)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java 2009-08-05 00:43:53 UTC (rev 3400)
@@ -2,6 +2,7 @@
import org.jboss.jsr299.tck.DeploymentError;
import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecAssertions;
import org.jboss.test.audit.annotations.SpecVersion;
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
@@ -20,7 +21,10 @@
public class NonPassivationCapableProducerMethodTest
{
@Test(groups = { "passivation", "ri-broken" })
- @SpecAssertion(section = "6.6.1", id = "cb")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.6.1", id = "cb"),
+ @SpecAssertion(section = "6.6.4", id = "ca")
+ })
public void testNonPassivationCapableProducerMethodNotOk()
{
assert false;
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-04 16:57:40 UTC (rev 3399)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-08-05 00:43:53 UTC (rev 3400)
@@ -2639,15 +2639,19 @@
</section>
<section id="6.4.2" title="Dependent object destruction">
-
- <assertion id="aaaa">
- <text>The container must ensure that all dependent objects of a non-contextual instance of a bean ~or other Java EE component~ class are destroyed when the instance is destroyed by the container.</text>
- </assertion>
-
- <assertion id="aaab">
- <text>The container must ensure that all dependent objects of a non-contextual instance of a ~bean~ or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
- </assertion>
+
+ <group>
+ <text>The container must ensure that all dependent objects of a non-contextual instance of a bean or other Java EE component class are destroyed when the instance is destroyed by the container.</text>
+
+ <assertion id="aaaa">
+ <text>Test with a managed bean.</text>
+ </assertion>
+ <assertion id="aaab">
+ <text>Test with a Java EE component.</text>
+ </assertion>
+ </group>
+
<assertion id="bbb">
<text>The container must ensure that all |@Dependent| scoped contextual instances injected into method parameters of an observer method of any container lifecycle event, as defined in Section 11.5, "Container lifecycle events", are destroyed after all observers of the |BeforeShutdown| event complete.</text>
</assertion>
@@ -2832,10 +2836,18 @@
</assertion>
</section>
- <section id="6.6.3" title="Passivating scopes">
- <assertion id="a">
- <text>A passivating scope requires that beans with the scope are passivation capable, and implementations of |Contextual| passed to any context object for the scope are passivation capable.</text>
- </assertion>
+ <section id="6.6.3" title="Passivating scopes">
+ <group>
+ <text>A passivating scope requires that beans with the scope are passivation capable, and implementations of |Contextual| passed to any context object for the scope are passivation capable.</text>
+
+ <assertion id="a">
+ <text>Test that a bean with the scope is passivation capable.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Test that an implementation of |Contextual| passed to the context object for the scope is passivation capable.</text>
+ </assertion>
+ </group>
<assertion id="b">
<text>Passivating scopes must be explicitly declared |@ScopeType(passivating=true)|.</text>
@@ -3031,34 +3043,42 @@
<assertion id="e">
<text>The request scope is active during any asynchronous observer method notification.</text>
</assertion>
+
+ <group>
+ <text>The request scope is active during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.</text>
- <assertion id="ga">
- <text>The request scope is active during any remote method invocation of any EJB,~ during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.~</text>
- </assertion>
+ <assertion id="ga" testable="false">
+ <text>Test the request scope is active during a remote method invocation of any EJB.</text>
+ </assertion>
- <assertion id="gb">
- <text>The request scope is active ~during any remote method invocation of any EJB~, during any asynchronous method invocation of any EJB, ~during any call to an EJB timeout method and during message delivery to any EJB message-driven bean.~</text>
- </assertion>
+ <assertion id="gb" testable="false">
+ <text>Test the request scope is active during any asynchronous method invocation of any EJB.</text>
+ </assertion>
- <assertion id="gc">
- <text>The request scope is active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB,~ during any call to an EJB timeout method ~and during message delivery to any EJB message-driven bean~.</text>
- </assertion>
+ <assertion id="gc">
+ <text>Test the request scope is active during any call to an EJB timeout method.</text>
+ </assertion>
- <assertion id="gd">
- <text>The request scope is active ~during any remote method invocation of any EJB, during any asynchronous method invocation of any EJB, during any call to an EJB timeout method and~ during message delivery to any EJB message-driven bean.</text>
- </assertion>
-
+ <assertion id="gd">
+ <text>Test the request scope is active during message delivery to any EJB message-driven bean.</text>
+ </assertion>
+ </group>
+
<assertion id="ge">
<text>The request scope is active during any message delivery to a |MessageListener| for a JMS topic or queue obtained from the Java EE component environment.</text>
- </assertion>
+ </assertion>
+
+ <group>
+ <text>The request context is destroyed at the end of the servlet request, after the |service()| method and all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
- <assertion id="baa">
- <text>The request context is destroyed at the end of the servlet request, after the |service()| method ~and all |doFilter()| methods~, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
- </assertion>
+ <assertion id="baa">
+ <text>Test the request context is destroyed at the end of the servlet request, after the |service()| method.</text>
+ </assertion>
- <assertion id="bba">
- <text>The request context is destroyed at the end of the servlet request, after ~the |service()| method and~ all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
- </assertion>
+ <assertion id="bba">
+ <text>Test the request context is destroyed after all |doFilter()| methods, and all |requestDestroyed()| and |onComplete()| notifications return.</text>
+ </assertion>
+ </group>
<assertion id="d">
<text>The request context is destroyed after the web service invocation completes.</text>
@@ -3067,22 +3087,26 @@
<assertion id="fa">
<text>The request context is destroyed after the asynchronous observer notification completes</text>
</assertion>
-
- <assertion id="ha">
- <text>The request context is destroyed after the EJB remote method invocation,~ asynchronous method invocation, timeout or message delivery completes~.</text>
- </assertion>
+
+ <group>
+ <text>The request context is destroyed after the EJB remote method invocation, asynchronous method invocation, timeout or message delivery completes.</text>
+
+ <assertion id="ha" testable="false">
+ <text>Test the request context is destroyed after an EJB remote method invocation.</text>
+ </assertion>
- <assertion id="hb">
- <text>The request context is destroyed after the ~EJB remote method invocation,~ asynchronous method invocation~, timeout or message delivery completes~.</text>
- </assertion>
+ <assertion id="hb">
+ <text>Test the request context is destroyed after an EJB asynchronous method invocation.</text>
+ </assertion>
- <assertion id="hc">
- <text>The request context is destroyed after the ~EJB remote method invocation, asynchronous method invocation,~ timeout~ or message delivery completes~.</text>
- </assertion>
+ <assertion id="hc">
+ <text>Test the request context is destroyed after the EJB timeout.</text>
+ </assertion>
- <assertion id="hd">
- <text>The request context is destroyed after the ~EJB remote method invocation, asynchronous method invocation, timeout or~ message delivery completes.</text>
- </assertion>
+ <assertion id="hd">
+ <text>Test the request context is destroyed after the message delivery completes.</text>
+ </assertion>
+ </group>
<assertion id="i">
<text>The request context is destroyed after the message delivery to the |MessageListener| completes.</text>
15 years, 4 months