Weld SVN: r4857 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-09 07:16:48 -0500 (Mon, 09 Nov 2009)
New Revision: 4857
Modified:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
minor
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2009-11-09 12:16:02 UTC (rev 4856)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2009-11-09 12:16:48 UTC (rev 4857)
@@ -2,8 +2,8 @@
<!-- JSR-299 TCK with mods (add excludes) -->
-<suite name="JSR-299 TCK" verbose="0" >
- <test name="JSR-299 TCK">
+<suite name="Weld / JBoss AS run of CDI TCK" verbose="0" >
+ <test name="CDI TCK">
<method-selectors>
<method-selector>
<selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
14 years, 11 months
Weld SVN: r4856 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-09 07:16:02 -0500 (Mon, 09 Nov 2009)
New Revision: 4856
Modified:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
exclude known failures
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2009-11-09 12:14:20 UTC (rev 4855)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2009-11-09 12:16:02 UTC (rev 4856)
@@ -19,6 +19,18 @@
<packages>
<package name="org.jboss.jsr299.tck.tests.*" />
</packages>
+ <classes>
+ <class name="org.jboss.jsr299.tck.tests.context.passivating.broken.interceptorWithNonPassivatingInjectedField.PassivationCapableBeanWithNonPassivatingInterceptorTest">
+ <methods>
+ <exclude name="testPassivationCapableBeanWithNonPassivatingInterceptorFails" />
+ </methods>
+ </class>
+ <class name="org.jboss.jsr299.tck.tests.context.passivating.broken.managedBeanWithNonSerializableInterceptorClass.ManagedBeanWithNonSerializableInterceptorClassTest">
+ <methods>
+ <exclude name="testManagedBeanWithNonSerializableInterceptorClassNotOK" />
+ </methods>
+ </class>
+ </classes>
</test>
</suite>
14 years, 11 months
Weld SVN: r4854 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-11-09 07:07:39 -0500 (Mon, 09 Nov 2009)
New Revision: 4854
Added:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
oops
Added: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml (rev 0)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2009-11-09 12:07:39 UTC (rev 4854)
@@ -0,0 +1,24 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+
+<!-- JSR-299 TCK with mods (add excludes) -->
+
+<suite name="JSR-299 TCK" verbose="0" >
+ <test name="JSR-299 TCK">
+ <method-selectors>
+ <method-selector>
+ <selector-class name="org.jboss.testharness.impl.testng.DisableIntegrationTestsMethodSelector" />
+ </method-selector>
+ </method-selectors>
+ <groups>
+ <run>
+ <exclude name="broken" />
+ <exclude name="ri-broken" />
+ <exclude name="jboss-as-broken" />
+ </run>
+ </groups>
+ <packages>
+ <package name="org.jboss.jsr299.tck.tests.*" />
+ </packages>
+ </test>
+
+</suite>
Property changes on: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 11 months
Weld SVN: r4853 - in core/tags/glassfish-integration/1.0.0-build3: bom and 8 other directories.
by weld-commits@lists.jboss.org
Author: rogerk
Date: 2009-11-09 07:06:03 -0500 (Mon, 09 Nov 2009)
New Revision: 4853
Modified:
core/tags/glassfish-integration/1.0.0-build3/bom/pom.xml
core/tags/glassfish-integration/1.0.0-build3/embedded-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-build3/impl/pom.xml
core/tags/glassfish-integration/1.0.0-build3/inject-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-build3/jboss-tck-runner/pom.xml
core/tags/glassfish-integration/1.0.0-build3/osgi-bundle/pom.xml
core/tags/glassfish-integration/1.0.0-build3/parent/pom.xml
core/tags/glassfish-integration/1.0.0-build3/pom.xml
core/tags/glassfish-integration/1.0.0-build3/porting-package/pom.xml
core/tags/glassfish-integration/1.0.0-build3/tests/pom.xml
Log:
version changes
Modified: core/tags/glassfish-integration/1.0.0-build3/bom/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/bom/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/bom/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -3,7 +3,7 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-bom</artifactId>
<packaging>pom</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<parent>
<groupId>org.jboss.weld</groupId>
@@ -175,9 +175,9 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/core/trunk/bom</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/trunk/bom</developerConnection>
- <url>http://fisheye.jboss.org/browse/Weld/core/bom</url>
+ <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</developerConnection>
+ <url>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</url>
</scm>
</project>
Modified: core/tags/glassfish-integration/1.0.0-build3/embedded-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/embedded-tck-runner/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/embedded-tck-runner/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.weld</groupId>
Modified: core/tags/glassfish-integration/1.0.0-build3/impl/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/impl/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/impl/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -3,7 +3,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-build3/inject-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/inject-tck-runner/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/inject-tck-runner/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -3,7 +3,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-build3/jboss-tck-runner/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/jboss-tck-runner/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/jboss-tck-runner/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-build3/osgi-bundle/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/osgi-bundle/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/osgi-bundle/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -16,7 +16,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-build3/parent/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/parent/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/parent/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -8,7 +8,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-bom</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../bom</relativePath>
</parent>
Modified: core/tags/glassfish-integration/1.0.0-build3/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -4,7 +4,7 @@
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core-build-aggregator</artifactId>
<packaging>pom</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<parent>
<groupId>org.jboss.weld</groupId>
@@ -19,9 +19,9 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/weld/core/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/Weld</url>
+ <connection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</developerConnection>
+ <url>scm:svn:https://svn.jboss.org/repos/weld/core/tags/glassfish-integration/...</url>
</scm>
<profiles>
Modified: core/tags/glassfish-integration/1.0.0-build3/porting-package/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/porting-package/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/porting-package/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -2,7 +2,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: core/tags/glassfish-integration/1.0.0-build3/tests/pom.xml
===================================================================
--- core/tags/glassfish-integration/1.0.0-build3/tests/pom.xml 2009-11-09 11:20:26 UTC (rev 4852)
+++ core/tags/glassfish-integration/1.0.0-build3/tests/pom.xml 2009-11-09 12:06:03 UTC (rev 4853)
@@ -3,7 +3,7 @@
<parent>
<artifactId>weld-core-parent</artifactId>
<groupId>org.jboss.weld</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-build3</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
14 years, 11 months
Weld SVN: r4852 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken: managedBeanWithNonSerializableInterceptorClass and 1 other directory.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-11-09 06:20:26 -0500 (Mon, 09 Nov 2009)
New Revision: 4852
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/interceptorWithNonPassivatingInjectedField/PassivationCapableBeanWithNonPassivatingInterceptorTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/managedBeanWithNonSerializableInterceptorClass/ManagedBeanWithNonSerializableInterceptorClassTest.java
Log:
Broken until validation is refactored (currently throwing DefinitionException where a DeploymentException is expected).
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/interceptorWithNonPassivatingInjectedField/PassivationCapableBeanWithNonPassivatingInterceptorTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/interceptorWithNonPassivatingInjectedField/PassivationCapableBeanWithNonPassivatingInterceptorTest.java 2009-11-09 11:19:41 UTC (rev 4851)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/interceptorWithNonPassivatingInjectedField/PassivationCapableBeanWithNonPassivatingInterceptorTest.java 2009-11-09 11:20:26 UTC (rev 4852)
@@ -15,7 +15,7 @@
@BeansXml("beans.xml")
public class PassivationCapableBeanWithNonPassivatingInterceptorTest extends AbstractJSR299Test
{
- @Test(groups = { "contexts", "passivation" })
+ @Test(groups = { "contexts", "passivation", "ri-broken" })
@SpecAssertion(section = "6.6.4", id = "aac")
public void testPassivationCapableBeanWithNonPassivatingInterceptorFails()
{
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/managedBeanWithNonSerializableInterceptorClass/ManagedBeanWithNonSerializableInterceptorClassTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/managedBeanWithNonSerializableInterceptorClass/ManagedBeanWithNonSerializableInterceptorClassTest.java 2009-11-09 11:19:41 UTC (rev 4851)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/managedBeanWithNonSerializableInterceptorClass/ManagedBeanWithNonSerializableInterceptorClassTest.java 2009-11-09 11:20:26 UTC (rev 4852)
@@ -13,7 +13,7 @@
@SpecVersion(spec="cdi", version="20091101")
public class ManagedBeanWithNonSerializableInterceptorClassTest extends AbstractJSR299Test
{
- @Test(groups = { "contexts", "passivation"})
+ @Test(groups = { "contexts", "passivation", "ri-broken"})
@SpecAssertion(section = "6.6.1", id = "bb")
// WBRI-361
public void testManagedBeanWithNonSerializableInterceptorClassNotOK()
14 years, 11 months
Weld SVN: r4851 - in core/trunk/impl/src/main: java/org/jboss/weld/bootstrap and 1 other directories.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-11-09 06:19:41 -0500 (Mon, 09 Nov 2009)
New Revision: 4851
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
Log:
WELD-265, WELD-279 - moving checkType after initialization so that everything is known about the decorators/interceptors and passivation capabilities when the check is made.
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-11-09 10:59:42 UTC (rev 4850)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-11-09 11:19:41 UTC (rev 4851)
@@ -104,6 +104,8 @@
private final ThreadLocal<T> decoratedActualInstance = new ThreadLocal<T>();
+ private boolean hasSerializationOrInvocationInterceptorMethods;
+
private WeldMethod<?, ?> postConstruct;
private WeldMethod<?, ?> preDestroy;
@@ -143,8 +145,6 @@
{
super.initialize(environment);
checkBeanImplementation();
- initDecorators();
- checkType();
if (isInterceptionCandidate())
{
initCdiBoundInterceptors();
@@ -163,7 +163,7 @@
}
}
- protected void checkType()
+ public void checkType()
{
}
@@ -557,12 +557,16 @@
return false;
}
- public boolean hasDirectlyDefinedInterceptors()
+ public boolean hasDirectlyDefinedInterceptors()
{
if (manager.getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()) != null)
- return manager.getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors().size() > 0;
+ {
+ return hasSerializationOrInvocationInterceptorMethods || manager.getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors().size() > 0;
+ }
else
+ {
return false;
+ }
}
protected void initDirectlyDefinedInterceptors()
@@ -605,7 +609,13 @@
}
}
InterceptionModel<Class<?>, Class<?>> interceptionModel = builder.build();
- if (interceptionModel.getAllInterceptors().size() > 0 || new InterceptorClassMetadataImpl(getType()).isInterceptor())
+ InterceptorClassMetadataImpl interceptorClassMetadata = new InterceptorClassMetadataImpl(getType());
+ hasSerializationOrInvocationInterceptorMethods =
+ !interceptorClassMetadata.getInterceptorMethods(org.jboss.interceptor.model.InterceptionType.AROUND_INVOKE).isEmpty()
+ || !interceptorClassMetadata.getInterceptorMethods(org.jboss.interceptor.model.InterceptionType.AROUND_TIMEOUT).isEmpty()
+ || !interceptorClassMetadata.getInterceptorMethods(org.jboss.interceptor.model.InterceptionType.PRE_PASSIVATE).isEmpty()
+ || !interceptorClassMetadata.getInterceptorMethods(org.jboss.interceptor.model.InterceptionType.POST_ACTIVATE).isEmpty();
+ if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods)
manager.getClassDeclaredInterceptorsRegistry().registerInterceptionModel(getType(), builder.build());
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-11-09 10:59:42 UTC (rev 4850)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-11-09 11:19:41 UTC (rev 4851)
@@ -40,6 +40,8 @@
import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.PassivationCapable;
import org.jboss.interceptor.proxy.InterceptionHandlerFactory;
import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
@@ -61,6 +63,7 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.logging.messages.BeanMessage;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
+import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.Reflections;
@@ -167,7 +170,7 @@
{
try
{
- if (!isInterceptionCandidate() || !hasCdiBoundInterceptors())
+ if (!isInterceptionCandidate() || !(hasCdiBoundInterceptors() || hasDirectlyDefinedInterceptors()))
{
getInjectionTarget().preDestroy(instance);
}
@@ -267,10 +270,48 @@
}
}
+ @Override
+ public void initializeAfterBeanDiscovery()
+ {
+ super.initializeAfterBeanDiscovery();
+ if (this.passivationCapable && this.hasDecorators())
+ {
+ for (Decorator<?> decorator : this.getDecorators())
+ {
+ if (!(PassivationCapable.class.isAssignableFrom(decorator.getClass())) || !Reflections.isSerializable(decorator.getBeanClass()))
+ {
+ this.passivationCapable = false;
+ break;
+ }
+ }
+ }
+ if (this.passivationCapable && hasCdiBoundInterceptors())
+ {
+ for (SerializableContextual<Interceptor<?>, ?> interceptor : getManager().getCdiInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
+ {
+ if (!(PassivationCapable.class.isAssignableFrom(interceptor.get().getClass())) || !Reflections.isSerializable(interceptor.get().getBeanClass()))
+ {
+ this.passivationCapable = false;
+ break;
+ }
+ }
+ }
+ if (this.passivationCapable && hasDirectlyDefinedInterceptors())
+ {
+ for (Class<?> interceptorClass : getManager().getClassDeclaredInterceptorsRegistry().getInterceptionModel(getType()).getAllInterceptors())
+ {
+ if (!Reflections.isSerializable(interceptorClass))
+ {
+ this.passivationCapable = false;
+ break;
+ }
+ }
+ }
+ }
+
private void initPassivationCapable()
{
this.passivationCapable = Reflections.isSerializable(getAnnotatedItem().getJavaClass());
- // TODO Add in interceptor and decorator checks
}
@Override
@@ -288,11 +329,13 @@
}
+
+
/**
* Validates the type
*/
@Override
- protected void checkType()
+ public void checkType()
{
if (getAnnotatedItem().isAnonymousClass() || (getAnnotatedItem().isMemberClass() && !getAnnotatedItem().isStatic()))
{
@@ -303,7 +346,7 @@
throw new DefinitionException(BEAN_MUST_BE_DEPENDENT, type);
}
boolean passivating = manager.getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isPassivating();
- if (passivating && !Reflections.isSerializable(getBeanClass()))
+ if (passivating && !isPassivationCapable())
{
throw new DefinitionException(PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL, this);
}
@@ -315,22 +358,29 @@
}
for (Decorator<?> decorator : getDecorators())
{
+ WeldClass<?> decoratorClass;
if (decorator instanceof DecoratorImpl<?>)
{
DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator;
- for (WeldMethod<?, ?> decoratorMethod : decoratorBean.getAnnotatedItem().getWeldMethods())
- {
- WeldMethod<?, ?> method = getAnnotatedItem().getWeldMethod(decoratorMethod.getSignature());
- if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal())
- {
- throw new DefinitionException(FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED, method, decoratorMethod);
- }
- }
+ decoratorClass = decoratorBean.getAnnotatedItem();
}
+ else if (decorator instanceof AnnotatedItemProvidingDecoratorWrapper)
+ {
+ decoratorClass = ((AnnotatedItemProvidingDecoratorWrapper) decorator).getAnnotatedItem();
+ }
else
{
throw new ForbiddenStateException(NON_CONTAINER_DECORATOR, decorator);
}
+
+ for (WeldMethod<?, ?> decoratorMethod : decoratorClass.getWeldMethods())
+ {
+ WeldMethod<?, ?> method = getAnnotatedItem().getWeldMethod(decoratorMethod.getSignature());
+ if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal())
+ {
+ throw new DefinitionException(FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED, method, decoratorMethod);
+ }
+ }
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2009-11-09 10:59:42 UTC (rev 4850)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2009-11-09 11:19:41 UTC (rev 4851)
@@ -77,6 +77,11 @@
// no-op by default
}
+ public void checkType()
+ {
+
+ }
+
public abstract boolean isSpecializing();
public boolean isDependent()
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2009-11-09 10:59:42 UTC (rev 4850)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2009-11-09 11:19:41 UTC (rev 4851)
@@ -165,6 +165,7 @@
if (bean instanceof RIBean<?>)
{
((RIBean<?>) bean).initializeAfterBeanDiscovery();
+ ((RIBean<?>) bean).checkType();
}
}
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2009-11-09 10:59:42 UTC (rev 4850)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2009-11-09 11:19:41 UTC (rev 4851)
@@ -70,7 +70,7 @@
MISSING_BINDING_ON_INTERCEPTOR=An interceptor must have at least one binding, but {0} has none
SIMPLE_BEAN_AS_NON_STATIC_INNER_CLASS_NOT_ALLOWED=Simple bean {0} cannot be a non-static inner class
BEAN_MUST_BE_DEPENDENT=Managed bean {0} must be @Dependent
-PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL=Managed bean declaring a passivating scope must have a serializable implementation class. Bean\: {0}
+PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL=Managed bean declaring a passivating scope must be passivation capable. Bean\: {0}
FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED=Bean class which has decorators cannot be declared final\: {0}
FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED=Decorated bean method {0} (decorated by {1}) cannot be declared final
PUBLIC_FIELD_ON_NORMAL_SCOPED_BEAN_NOT_ALLOWED=Normal scoped managed bean implementation class has a public field\: {0}
14 years, 11 months
Weld SVN: r4850 - core/trunk/bom.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2009-11-09 05:59:42 -0500 (Mon, 09 Nov 2009)
New Revision: 4850
Modified:
core/trunk/bom/pom.xml
Log:
setting JBoss Interceptors to 1.0.0-CR8. Fixes WELD-276, WELD-275.
Modified: core/trunk/bom/pom.xml
===================================================================
--- core/trunk/bom/pom.xml 2009-11-09 10:36:31 UTC (rev 4849)
+++ core/trunk/bom/pom.xml 2009-11-09 10:59:42 UTC (rev 4850)
@@ -76,7 +76,7 @@
<javassist.version>3.11.0.GA</javassist.version>
<cdi.tck.version>1.0.0-CR7</cdi.tck.version>
<atinject.tck.version>1.0.0-PFD-3</atinject.tck.version>
- <jboss.interceptor.version>1.0.0-CR5</jboss.interceptor.version>
+ <jboss.interceptor.version>1.0.0-CR8</jboss.interceptor.version>
<slf4j.version>1.5.9.RC1</slf4j.version>
<cal10n.version>0.7.2</cal10n.version>
</properties>
14 years, 11 months
Weld SVN: r4849 - in core/trunk/impl/src/main: java/org/jboss/weld/logging/messages and 1 other directories.
by weld-commits@lists.jboss.org
Author: dallen6
Date: 2009-11-09 05:36:31 -0500 (Mon, 09 Nov 2009)
New Revision: 4849
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
Log:
Additional exception conversion to localized messages
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2009-11-09 10:36:31 UTC (rev 4849)
@@ -16,6 +16,11 @@
*/
package org.jboss.weld.bean;
+import static org.jboss.weld.logging.messages.BeanMessage.DISPOSE_NOT_FIRST_PARAM;
+import static org.jboss.weld.logging.messages.BeanMessage.INCONSISTENT_ANNOTATIONS_ON_METHOD;
+import static org.jboss.weld.logging.messages.BeanMessage.METHOD_NOT_BUSINESS_METHOD;
+import static org.jboss.weld.logging.messages.BeanMessage.MULTIPLE_DISPOSE_PARAMS;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
@@ -181,23 +186,23 @@
{
if (!disposalMethodInjectionPoint.getWeldParameters().get(0).isAnnotationPresent(Disposes.class))
{
- throw new DefinitionException(disposalMethodInjectionPoint.toString() + " doesn't have @Dispose as first parameter");
+ throw new DefinitionException(DISPOSE_NOT_FIRST_PARAM, disposalMethodInjectionPoint);
}
if (disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).size() > 1)
{
- throw new DefinitionException(disposalMethodInjectionPoint.toString() + " has more than one @Dispose parameters");
+ throw new DefinitionException(MULTIPLE_DISPOSE_PARAMS, disposalMethodInjectionPoint);
}
if (disposalMethodInjectionPoint.getAnnotatedParameters(Observes.class).size() > 0)
{
- throw new DefinitionException("@Observes is not allowed on disposal method, see " + disposalMethodInjectionPoint.toString());
+ throw new DefinitionException(INCONSISTENT_ANNOTATIONS_ON_METHOD, "@Observes", "@Disposes", disposalMethodInjectionPoint);
}
if (disposalMethodInjectionPoint.getAnnotation(Inject.class) != null)
{
- throw new DefinitionException("@Intitializer is not allowed on a disposal method, see " + disposalMethodInjectionPoint.toString());
+ throw new DefinitionException(INCONSISTENT_ANNOTATIONS_ON_METHOD, "@Intitializer", "@Disposes", disposalMethodInjectionPoint);
}
if (disposalMethodInjectionPoint.getAnnotation(Produces.class) != null)
{
- throw new DefinitionException("@Produces is not allowed on a disposal method, see " + disposalMethodInjectionPoint.toString());
+ throw new DefinitionException(INCONSISTENT_ANNOTATIONS_ON_METHOD, "@Produces", "@Disposes", disposalMethodInjectionPoint);
}
if (getDeclaringBean() instanceof SessionBean<?>)
{
@@ -221,7 +226,7 @@
}
if (!methodDeclaredOnTypes)
{
- throw new DefinitionException("Producer method " + toString() + " must be declared on a business interface of " + getDeclaringBean());
+ throw new DefinitionException(METHOD_NOT_BUSINESS_METHOD, this, getDeclaringBean());
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-11-09 10:36:31 UTC (rev 4849)
@@ -17,6 +17,9 @@
package org.jboss.weld.bean;
+import static org.jboss.weld.logging.messages.BeanMessage.CONFLICTING_INTERCEPTOR_BINDINGS;
+import static org.jboss.weld.logging.messages.BeanMessage.MISSING_BINDING_ON_INTERCEPTOR;
+
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
@@ -31,6 +34,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DeploymentException;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.logging.messages.BeanMessage;
import org.jboss.weld.util.Beans;
/**
@@ -54,11 +58,11 @@
}
if (this.interceptorBindingTypes.size() == 0)
{
- throw new DeploymentException("An interceptor must have at least one binding, but " + type.getName() + " has none");
+ throw new DeploymentException(MISSING_BINDING_ON_INTERCEPTOR, type.getName());
}
if (Beans.findInterceptorBindingConflicts(manager, interceptorBindingTypes))
{
- throw new DeploymentException("Conflicting interceptor bindings found on " + getType());
+ throw new DeploymentException(CONFLICTING_INTERCEPTOR_BINDINGS, getType());
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-11-09 10:36:31 UTC (rev 4849)
@@ -18,8 +18,17 @@
import static org.jboss.weld.logging.Category.BEAN;
import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import static org.jboss.weld.logging.messages.BeanMessage.BEAN_MUST_BE_DEPENDENT;
import static org.jboss.weld.logging.messages.BeanMessage.DELEGATE_INJECTION_POINT_NOT_FOUND;
import static org.jboss.weld.logging.messages.BeanMessage.ERROR_DESTROYING;
+import static org.jboss.weld.logging.messages.BeanMessage.FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED;
+import static org.jboss.weld.logging.messages.BeanMessage.FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED;
+import static org.jboss.weld.logging.messages.BeanMessage.NON_CONTAINER_DECORATOR;
+import static org.jboss.weld.logging.messages.BeanMessage.PARAMETER_ANNOTATION_NOT_ALLOWED_ON_CONSTRUCTOR;
+import static org.jboss.weld.logging.messages.BeanMessage.PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL;
+import static org.jboss.weld.logging.messages.BeanMessage.PUBLIC_FIELD_ON_NORMAL_SCOPED_BEAN_NOT_ALLOWED;
+import static org.jboss.weld.logging.messages.BeanMessage.SIMPLE_BEAN_AS_NON_STATIC_INNER_CLASS_NOT_ALLOWED;
+import static org.jboss.weld.logging.messages.BeanMessage.SPECIALIZING_BEAN_MUST_EXTEND_A_BEAN;
import java.util.ArrayList;
import java.util.List;
@@ -39,6 +48,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.DeploymentException;
+import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bean.interceptor.CdiInterceptorHandlerFactory;
import org.jboss.weld.bean.interceptor.ClassInterceptionHandlerFactory;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
@@ -49,6 +59,7 @@
import org.jboss.weld.introspector.WeldConstructor;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.logging.messages.BeanMessage;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
@@ -57,8 +68,6 @@
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLogger.Level;
-import ch.qos.cal10n.IMessageConveyor;
-
/**
* Represents a simple bean
*
@@ -71,7 +80,6 @@
// Logger
private static final LocLogger log = loggerFactory().getLogger(BEAN);
private static final XLogger xLog = loggerFactory().getXLogger(BEAN);
- private static final IMessageConveyor messageConveyer = loggerFactory().getMessageConveyor();
// The constructor
private ConstructorInjectionPoint<T> constructor;
@@ -144,7 +152,8 @@
Decorator<?> decorator = getDecorators().get(getDecorators().size() - 1);
InjectionPoint outerDelegateInjectionPoint = Beans.getDelegateInjectionPoint(decorator);
if (outerDelegateInjectionPoint == null)
-{ throw new IllegalStateException(messageConveyer.getMessage(DELEGATE_INJECTION_POINT_NOT_FOUND, decorator));
+ {
+ throw new ForbiddenStateException(DELEGATE_INJECTION_POINT_NOT_FOUND, decorator);
}
return getManager().replaceOrPushCurrentInjectionPoint(outerDelegateInjectionPoint);
}
@@ -287,22 +296,22 @@
{
if (getAnnotatedItem().isAnonymousClass() || (getAnnotatedItem().isMemberClass() && !getAnnotatedItem().isStatic()))
{
- throw new DefinitionException("Simple bean " + type + " cannot be a non-static inner class");
+ throw new DefinitionException(SIMPLE_BEAN_AS_NON_STATIC_INNER_CLASS_NOT_ALLOWED, type);
}
if (!isDependent() && getAnnotatedItem().isParameterizedType())
{
- throw new DefinitionException("Managed bean " + type + " must be @Dependent");
+ throw new DefinitionException(BEAN_MUST_BE_DEPENDENT, type);
}
boolean passivating = manager.getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isPassivating();
if (passivating && !Reflections.isSerializable(getBeanClass()))
{
- throw new DefinitionException("Managed bean declaring a passivating scope must have a serializable implementation class. Bean: " + toString());
+ throw new DefinitionException(PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL, this);
}
if (hasDecorators())
{
if (getAnnotatedItem().isFinal())
{
- throw new DefinitionException("Bean class which has decorators cannot be declared final " + this);
+ throw new DefinitionException(FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED, this);
}
for (Decorator<?> decorator : getDecorators())
{
@@ -314,13 +323,13 @@
WeldMethod<?, ?> method = getAnnotatedItem().getWeldMethod(decoratorMethod.getSignature());
if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal())
{
- throw new DefinitionException("Decorated bean method " + method + " (decorated by "+ decoratorMethod + ") cannot be declarted final");
+ throw new DefinitionException(FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED, method, decoratorMethod);
}
}
}
else
{
- throw new IllegalStateException("Can only operate on container provided decorators " + decorator);
+ throw new ForbiddenStateException(NON_CONTAINER_DECORATOR, decorator);
}
}
}
@@ -336,7 +345,7 @@
{
if (field.isPublic() && !field.isStatic())
{
- throw new DefinitionException("Normal scoped Web Bean implementation class has a public field " + getAnnotatedItem());
+ throw new DefinitionException(PUBLIC_FIELD_ON_NORMAL_SCOPED_BEAN_NOT_ALLOWED, getAnnotatedItem());
}
}
}
@@ -346,11 +355,11 @@
{
if (!constructor.getAnnotatedWBParameters(Disposes.class).isEmpty())
{
- throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Disposes " + constructor);
+ throw new DefinitionException(PARAMETER_ANNOTATION_NOT_ALLOWED_ON_CONSTRUCTOR, "@Disposes", constructor);
}
if (!constructor.getAnnotatedWBParameters(Observes.class).isEmpty())
{
- throw new DefinitionException("Managed bean constructor must not have a parameter annotated @Observes " + constructor);
+ throw new DefinitionException(PARAMETER_ANNOTATION_NOT_ALLOWED_ON_CONSTRUCTOR, "@Observes", constructor);
}
}
@@ -360,7 +369,7 @@
super.preSpecialize(environment);
if (environment.getEjbDescriptors().contains(getAnnotatedItem().getWeldSuperclass().getJavaClass()))
{
- throw new DefinitionException("Simple bean must specialize a simple bean");
+ throw new DefinitionException(SPECIALIZING_BEAN_MUST_EXTEND_A_BEAN, this);
}
}
@@ -369,12 +378,12 @@
{
if (environment.getClassBean(getAnnotatedItem().getWeldSuperclass()) == null)
{
- throw new DefinitionException(toString() + " does not specialize a bean");
+ throw new DefinitionException(SPECIALIZING_BEAN_MUST_EXTEND_A_BEAN, this);
}
AbstractClassBean<?> specializedBean = environment.getClassBean(getAnnotatedItem().getWeldSuperclass());
if (!(specializedBean instanceof ManagedBean))
{
- throw new DefinitionException(toString() + " doesn't have a simple bean as a superclass " + specializedBean);
+ throw new DefinitionException(SPECIALIZING_BEAN_MUST_EXTEND_A_BEAN, this);
} else
{
this.specializedBean = (ManagedBean<?>) specializedBean;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-11-09 10:36:31 UTC (rev 4849)
@@ -16,6 +16,11 @@
*/
package org.jboss.weld.bean;
+import static org.jboss.weld.logging.messages.BeanMessage.INCONSISTENT_ANNOTATIONS_ON_METHOD;
+import static org.jboss.weld.logging.messages.BeanMessage.METHOD_NOT_BUSINESS_METHOD;
+import static org.jboss.weld.logging.messages.BeanMessage.MULTIPLE_DISPOSAL_METHODS;
+import static org.jboss.weld.logging.messages.BeanMessage.PRODUCER_METHOD_NOT_SPECIALIZING;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
@@ -31,6 +36,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
+import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
@@ -146,11 +152,11 @@
{
if (getAnnotatedItem().getAnnotatedWBParameters(Observes.class).size() > 0)
{
- throw new DefinitionException("Producer method cannot have parameter annotated @Observes");
+ throw new DefinitionException(INCONSISTENT_ANNOTATIONS_ON_METHOD, "@Produces", "@Observes");
}
else if (getAnnotatedItem().getAnnotatedWBParameters(Disposes.class).size() > 0)
{
- throw new DefinitionException("Producer method cannot have parameter annotated @Disposes");
+ throw new DefinitionException(INCONSISTENT_ANNOTATIONS_ON_METHOD, "@Produces", "@Disposes");
}
else if (getDeclaringBean() instanceof SessionBean<?>)
{
@@ -174,7 +180,7 @@
}
if (!methodDeclaredOnTypes)
{
- throw new DefinitionException("Producer method " + toString() + " must be declared on a business interface of " + getDeclaringBean());
+ throw new DefinitionException(METHOD_NOT_BUSINESS_METHOD, this, getDeclaringBean());
}
}
}
@@ -192,8 +198,7 @@
}
else if (disposalBeans.size() > 1)
{
- // TODO List out found disposal methods
- throw new DefinitionException("Cannot declare multiple disposal methods for this producer method. Producer method: " + this + ". Disposal methods: " + disposalBeans);
+ throw new DefinitionException(MULTIPLE_DISPOSAL_METHODS, this, disposalBeans);
}
}
@@ -277,7 +282,7 @@
{
if (getDeclaringBean().getAnnotatedItem().getWeldSuperclass().getDeclaredWeldMethod(getAnnotatedItem().getAnnotatedMethod()) == null)
{
- throw new DefinitionException("Specialized producer method does not override a method on the direct superclass");
+ throw new DefinitionException(PRODUCER_METHOD_NOT_SPECIALIZING, this);
}
}
@@ -287,7 +292,7 @@
WeldMethod<?, ?> superClassMethod = getDeclaringBean().getAnnotatedItem().getWeldSuperclass().getWeldMethod(getAnnotatedItem().getAnnotatedMethod());
if (environment.getProducerMethod(superClassMethod) == null)
{
- throw new IllegalStateException(toString() + " does not specialize a bean");
+ throw new ForbiddenStateException(PRODUCER_METHOD_NOT_SPECIALIZING, this);
}
this.specializedBean = environment.getProducerMethod(superClassMethod);
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2009-11-09 10:36:31 UTC (rev 4849)
@@ -82,6 +82,20 @@
@MessageId("000061") DELEGATE_MUST_SUPPORT_EVERY_DECORATED_TYPE,
@MessageId("000062") DECORATED_TYPE_PARAMETERIZED_DELEGATE_NOT,
@MessageId("000063") DELEGATE_TYPE_PARAMETER_MISMATCH,
- @MessageId("000064") UNABLE_TO_PROCESS
+ @MessageId("000064") UNABLE_TO_PROCESS,
+ @MessageId("000065") DISPOSE_NOT_FIRST_PARAM,
+ @MessageId("000066") MULTIPLE_DISPOSE_PARAMS,
+ @MessageId("000067") INCONSISTENT_ANNOTATIONS_ON_METHOD,
+ @MessageId("000068") METHOD_NOT_BUSINESS_METHOD,
+ @MessageId("000069") MISSING_BINDING_ON_INTERCEPTOR,
+ @MessageId("000070") SIMPLE_BEAN_AS_NON_STATIC_INNER_CLASS_NOT_ALLOWED,
+ @MessageId("000071") BEAN_MUST_BE_DEPENDENT,
+ @MessageId("000072") PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL,
+ @MessageId("000073") FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED,
+ @MessageId("000074") FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED,
+ @MessageId("000075") PUBLIC_FIELD_ON_NORMAL_SCOPED_BEAN_NOT_ALLOWED,
+ @MessageId("000076") PARAMETER_ANNOTATION_NOT_ALLOWED_ON_CONSTRUCTOR,
+ @MessageId("000077") MULTIPLE_DISPOSAL_METHODS,
+ @MessageId("000078") PRODUCER_METHOD_NOT_SPECIALIZING
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2009-11-09 09:36:37 UTC (rev 4848)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2009-11-09 10:36:31 UTC (rev 4849)
@@ -22,6 +22,10 @@
ANNOTATION_NOT_BINDING=The annotation {0} is not a binding for {1}
DUPLICATE_BINDING=The annotation {0} is already present in the bindings list for {1}
TYPE_PARAMETER_MUST_BE_CONCRETE=Type parameter must be a concrete type\: {0}
+DISPOSE_NOT_FIRST_PARAM={0} does not have @Dispose as first parameter
+MULTIPLE_DISPOSE_PARAMS={0} has more than one @Dispose parameter
+INCONSISTENT_ANNOTATIONS_ON_METHOD={0} is not allowed on same method as {1}, see {2}
+METHOD_NOT_BUSINESS_METHOD=Method {0} must be declared on a business interface of {1}
BEAN_NOT_EE_RESOURCE_PRODUCER=The following bean is not an EE resource producer\: {0}
NULL_INSTANCE=Unable to obtain instance from {0}
VALIDATION_SERVICE_NOT_AVAILABLE=ValidationServices are not available
@@ -63,3 +67,13 @@
DECORATED_TYPE_PARAMETERIZED_DELEGATE_NOT=The decorated type is parameterized, but the delegate type isn't. Delegate type {0} on {1}
DELEGATE_TYPE_PARAMETER_MISMATCH=The delegate type must have exactly the same type parameters as the decorated type. Decorated type {0} on decorator {1}
UNABLE_TO_PROCESS=Unable to process {0}
+MISSING_BINDING_ON_INTERCEPTOR=An interceptor must have at least one binding, but {0} has none
+SIMPLE_BEAN_AS_NON_STATIC_INNER_CLASS_NOT_ALLOWED=Simple bean {0} cannot be a non-static inner class
+BEAN_MUST_BE_DEPENDENT=Managed bean {0} must be @Dependent
+PASSIVATING_BEAN_NEEDS_SERIALIZABLE_IMPL=Managed bean declaring a passivating scope must have a serializable implementation class. Bean\: {0}
+FINAL_BEAN_CLASS_WITH_DECORATORS_NOT_ALLOWED=Bean class which has decorators cannot be declared final\: {0}
+FINAL_DECORATED_BEAN_METHOD_NOT_ALLOWED=Decorated bean method {0} (decorated by {1}) cannot be declared final
+PUBLIC_FIELD_ON_NORMAL_SCOPED_BEAN_NOT_ALLOWED=Normal scoped managed bean implementation class has a public field\: {0}
+PARAMETER_ANNOTATION_NOT_ALLOWED_ON_CONSTRUCTOR=Managed bean constructor must not have a parameter annotated {0}\: {1}
+MULTIPLE_DISPOSAL_METHODS=Cannot declare multiple disposal methods for this producer method.\\n\\nProducer method\: {0}\\nDisposal methods\: {1}
+PRODUCER_METHOD_NOT_SPECIALIZING=Specialized producer method does not override a method on the direct superclass\: {0}
14 years, 11 months
Weld SVN: r4848 - in cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback: order and 1 other directory.
by weld-commits@lists.jboss.org
Author: jharting
Date: 2009-11-09 04:36:37 -0500 (Mon, 09 Nov 2009)
New Revision: 4848
Added:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/CargoShip.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor1.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor2.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor3.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor4.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/InvocationOrderTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/LakeCargoShip.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Ship.java
Log:
Tests for lifecycle callback interceptor methods.
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/CargoShip.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/CargoShip.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/CargoShip.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.Interceptors;
+
+@Interceptors( { Interceptor3.class, Interceptor4.class })
+class CargoShip extends Ship
+{
+ @PostConstruct
+ void postConstruct2()
+ {
+ assert LakeCargoShip.getSequence() == 5;
+ LakeCargoShip.setSequence(6);
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor1.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor1.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor1.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
+class Interceptor1
+{
+ @PostConstruct
+ void postConstruct1(InvocationContext ctx)
+ {
+ assert LakeCargoShip.getSequence() == 0;
+ LakeCargoShip.setSequence(1);
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor2.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor2.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor2.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
+class Interceptor2
+{
+ @PostConstruct
+ void postConstruct2(InvocationContext ctx)
+ {
+ assert LakeCargoShip.getSequence() == 1;
+ LakeCargoShip.setSequence(2);
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor3.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor3.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor3.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
+class Interceptor3
+{
+ @PostConstruct
+ void postConstruct3(InvocationContext ctx)
+ {
+ assert LakeCargoShip.getSequence() == 2;
+ LakeCargoShip.setSequence(3);
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor4.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor4.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Interceptor4.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+import javax.interceptor.InvocationContext;
+
+class Interceptor4
+{
+ @PostConstruct
+ void postConstruct(InvocationContext ctx)
+ {
+ assert LakeCargoShip.getSequence() == 3;
+ LakeCargoShip.setSequence(4);
+ try
+ {
+ ctx.proceed();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/InvocationOrderTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/InvocationOrderTest.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/InvocationOrderTest.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+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;
+
+@Artifact
+@SpecVersion(spec = "int", version = "3.1.PFD")
+public class InvocationOrderTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.1", id = "c"),
+ @SpecAssertion(section = "5.1", id = "d"),
+ @SpecAssertion(section = "5.1", id = "e"),
+ @SpecAssertion(section = "5.1", id = "f")
+ })
+ // WELD-280
+ public void testInvocationOrder() {
+ getInstanceByType(LakeCargoShip.class);
+ assert LakeCargoShip.getSequence() == 7;
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/LakeCargoShip.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/LakeCargoShip.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/LakeCargoShip.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+
+class LakeCargoShip extends CargoShip
+{
+ // Every interceptor sets this property to a certain value.
+ // The following interceptor verifies the correct order of the chain by
+ // inspecting this value.
+ private static int sequence = 0;
+
+ static int getSequence()
+ {
+ return sequence;
+ }
+
+ static void setSequence(int value)
+ {
+ sequence = value;
+ }
+
+ @PostConstruct
+ void postConstruct3()
+ {
+ assert LakeCargoShip.getSequence() == 6;
+ LakeCargoShip.setSequence(7);
+ }
+}
Added: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Ship.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Ship.java (rev 0)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/interceptors/tests/lifecycleCallback/order/Ship.java 2009-11-09 09:36:37 UTC (rev 4848)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.interceptors.tests.lifecycleCallback.order;
+
+import javax.annotation.PostConstruct;
+
+class Ship
+{
+ @PostConstruct
+ void postConstruct1()
+ {
+ assert LakeCargoShip.getSequence() == 4;
+ LakeCargoShip.setSequence(5);
+ }
+}
14 years, 11 months