Weld SVN: r6867 - in archetypes/javaee6-webapp/trunk: src/main/java/com/mycompany and 1 other directory.
by weld-commits@lists.jboss.org
Author: sboscarine
Date: 2010-07-31 18:30:07 -0400 (Sat, 31 Jul 2010)
New Revision: 6867
Modified:
archetypes/javaee6-webapp/trunk/pom.xml
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java
Log:
Updated comments, fix compiler error.
Modified: archetypes/javaee6-webapp/trunk/pom.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/pom.xml 2010-07-31 17:56:17 UTC (rev 6866)
+++ archetypes/javaee6-webapp/trunk/pom.xml 2010-07-31 22:30:07 UTC (rev 6867)
@@ -64,7 +64,6 @@
</pluginRepositories>
<dependencies>
-
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
@@ -129,7 +128,6 @@
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
-
</dependencies>
<build>
@@ -244,7 +242,7 @@
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
- <!-- This imports the Java EE 6 runtime provided by GlassFish Embedded -->
+ <!-- This imports the Java EE 6 runtime libraries provided by GlassFish Embedded -->
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
@@ -302,7 +300,7 @@
<type>pom</type>
<scope>provided</scope>
</dependency>
- <!-- need for org.jnp.interfaces.NamingContextFactory -->
+ <!-- needed for org.jnp.interfaces.NamingContextFactory -->
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java 2010-07-31 17:56:17 UTC (rev 6866)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java 2010-07-31 22:30:07 UTC (rev 6867)
@@ -8,10 +8,9 @@
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.transaction.UserTransaction;
-import javax.ejb.Stateful;
import org.slf4j.Logger;
-// @Stateful // Adding this annotation eliminates need for manual transaction demarcation
+// @javax.ejb.Stateful// Adding this annotation eliminates need for manual transaction demarcation
@Model
public class MemberRegistration
{
@@ -22,8 +21,8 @@
@MemberRepository
private EntityManager em;
- //@Inject
- //private UserTransaction utx;
+ @Inject
+ private UserTransaction utx;
@Inject
private Event<Member> memberEventSrc;
14 years, 3 months
Weld SVN: r6866 - archetypes/javaee6-webapp/trunk.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-31 13:56:17 -0400 (Sat, 31 Jul 2010)
New Revision: 6866
Modified:
archetypes/javaee6-webapp/trunk/readme.txt
Log:
clarify the Eclipse recommendation
Modified: archetypes/javaee6-webapp/trunk/readme.txt
===================================================================
--- archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 17:55:07 UTC (rev 6865)
+++ archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 17:56:17 UTC (rev 6866)
@@ -171,7 +171,8 @@
ready to import the project into Eclipse.
NOTE:
- We strongly recommend Eclipse 3.6 (Helios) - http://www.eclipse.org/helios
+ If you are using Eclipse as your IDE, we we strongly recommend that you use
+ Eclipse 3.6 (Helios) - http://www.eclipse.org/helios
Select File > Import. . . and choose the Maven > Existing Maven Projects option.
Navigate to the root directory of your project. Eclipse should recognize the
14 years, 3 months
Weld SVN: r6865 - archetypes/javaee6-webapp/trunk.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-31 13:55:07 -0400 (Sat, 31 Jul 2010)
New Revision: 6865
Modified:
archetypes/javaee6-webapp/trunk/readme.txt
Log:
phrasing
Modified: archetypes/javaee6-webapp/trunk/readme.txt
===================================================================
--- archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 17:51:15 UTC (rev 6864)
+++ archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 17:55:07 UTC (rev 6865)
@@ -192,7 +192,7 @@
Check "Enable annotation processing" then click OK and OK again when your are
prompted to run a project build.
- You can verify your configuration by referring to the Hibernate JPA documentation.
+ This configuration is described in further detail in the Hibernate JPA documentation:
- http://docs.jboss.org/hibernate/stable/jpamodelgen/reference/en-US/html_s...
14 years, 3 months
Weld SVN: r6864 - in archetypes/javaee6-webapp/trunk: src/main/java/com/mycompany and 1 other directory.
by weld-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-07-31 13:51:15 -0400 (Sat, 31 Jul 2010)
New Revision: 6864
Modified:
archetypes/javaee6-webapp/trunk/pom.xml
archetypes/javaee6-webapp/trunk/readme.txt
archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java
Log:
bump support for JBoss AS to 6.0.0.M4
Modified: archetypes/javaee6-webapp/trunk/pom.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/pom.xml 2010-07-31 01:07:01 UTC (rev 6863)
+++ archetypes/javaee6-webapp/trunk/pom.xml 2010-07-31 17:51:15 UTC (rev 6864)
@@ -218,7 +218,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
- <version>1.4.1-SNAPSHOT</version>
+ <version>1.4.1</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.domain}</serverName>
@@ -306,7 +306,7 @@
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
- <version>6.0.0.20100429-M3</version>
+ <version>6.0.0.20100721-M4</version>
<type>pom</type>
<scope>test</scope>
</dependency>
Modified: archetypes/javaee6-webapp/trunk/readme.txt
===================================================================
--- archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 01:07:01 UTC (rev 6863)
+++ archetypes/javaee6-webapp/trunk/readme.txt 2010-07-31 17:51:15 UTC (rev 6864)
@@ -1,8 +1,8 @@
+ jboss-javaee6-webapp-src
+ ************************
- jboss-javaee6-webapp-src
+ #Source archetype:# jboss-javaee6-webapp
- Source archetype: jboss-javaee6-webapp
-
What is it?
===========
@@ -20,7 +20,7 @@
All you need to run this project is Java 5.0 (Java SDK 1.5) or greator and
Maven 2.0.10 or greater. However, we strongly recommend Java 6.0 and Maven 3.
This application is configured to be run on a Java EE 6 application server.
- We've tested it on both GlassFish 3.0.1 and JBoss AS 6.0.0.M3.
+ We've tested it on both GlassFish 3.0.1 and JBoss AS 6.0.0.M4.
NOTE:
This project retrieves artifacts from the JBoss Community Maven repository
@@ -43,26 +43,26 @@
Alternatively, you can set the location of JBoss AS using the following
profile defintion in the .m2/settings.xml file in your home directory:
-<?xml version="1.0" encoding="UTF-8"?>
-<settings
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <?xml version="1.0" encoding="UTF-8"?>
+ <settings
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+ <profiles>
+ <profile>
+ <id>environment</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <jboss.home>/path/to/jboss-as-6.0.0.M4</jboss.home>
+ </properties>
+ </profile>
+ </profiles>
+
+ </settings>
- <profiles>
- <profile>
- <id>environment</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <jboss.home>/path/to/jboss-as-6.0.0.M3</jboss.home>
- </properties>
- </profile>
- </profiles>
-
-</settings>
-
Once you've set either the JBOSS_HOME environment variable or the jboss.home
Maven property, you can deploy to JBoss AS by executing the following command:
@@ -80,10 +80,9 @@
You can also set jboss.home on the commandline:
- mvn package jboss:hard-deploy -Djboss.home=/path/to/jboss-as-6.0.0.M3
+ mvn package jboss:hard-deploy -Djboss.home=/path/to/jboss-as-6.0.0.M4
- To summarize, you have three options for specifying the path to your JBoss AS
- installation:
+ In all, you have three options to set the path of your JBoss AS installation:
1. Set the JBOSS_HOME environment variable (e.g., export JBOSS_HOME=/path/to/jboss-as)
2. Define the jboss.home Maven property in $HOME/.m2/settings.xml
@@ -91,7 +90,7 @@
Now start JBoss AS. The application will be running at the following URL:
- http://localhost:8080/jboss-javaee6-webapp-src/
+ - http://localhost:8080/jboss-javaee6-webapp-src/
To undeploy from JBoss AS, run this command:
@@ -151,7 +150,7 @@
Consult the Arquillian reference documentation to register profiles for any
supported container.
- http://docs.jboss.org/arquillian/reference/latest/en-US/html/containers.h...
+ - http://docs.jboss.org/arquillian/reference/latest/en-US/html/containers.h...
Importing the project into an IDE
=================================
@@ -165,16 +164,16 @@
IntelliJ IDEA 9, then all you have to do is open the project as an existing
project. Both of these IDEs recognize Maven 2 projects natively.
- To import into Eclipse, you first need to install the m2eclipse plugin. To get
- started, add the m2eclipse update site (http://m2eclipse.sonatype.org/update/)
- to Eclipse (or use the Help > Eclipse Marketplace...) and install the
+ To import the project into Eclipse, you need the m2eclipse. To install this
+ plugin, add the m2eclipse update site http://m2eclipse.sonatype.org/update/ to
+ Eclipse (or use the Help > Eclipse Marketplace. . .) and then install the
m2eclipse plugin and required dependencies. Once that's installed, you'll be
ready to import the project into Eclipse.
NOTE:
We strongly recommend Eclipse 3.6 (Helios) - http://www.eclipse.org/helios
- Select File > Import... and choose the Maven > Existing Maven Projects option.
+ Select File > Import. . . and choose the Maven > Existing Maven Projects option.
Navigate to the root directory of your project. Eclipse should recognize the
Maven project and preselect it in the Project box. Click Finish and m2eclipse
will take it from there.
@@ -186,23 +185,23 @@
Additional configuration is required to get Eclipse to generate the JPA
metamodel. The archetype includes the necessary Eclipse config files in your
- project. To enable this feature, right click on the project and select:
+ project. To enable this feature, right click on the project and select:
- Properties > Java Compiler > Annotation Processing
+ Properties > Java Compiler > Annotation Processing
Check "Enable annotation processing" then click OK and OK again when your are
prompted to run a project build.
You can verify your configuration by referring to the Hibernate JPA documentation.
- http://docs.jboss.org/hibernate/stable/jpamodelgen/reference/en-US/html_s...
+ - http://docs.jboss.org/hibernate/stable/jpamodelgen/reference/en-US/html_s...
Once the project is imported into the IDE, you can execute the Maven commands
through the IDE controls to deploy the application to a container.
To deploy to GlassFish from Eclipse, you'll need the GlassFish Tools Bundle,
available at the update site http://download.java.net/glassfish/eclipse/helios
- or from the Help > Eclipse Marketplace...
+ or from the Help > Eclipse Marketplace. . .
Downloading the sources and Javadocs
====================================
@@ -218,11 +217,11 @@
Resources
=========
- Weld archetypes:
- - Quickstart: http://seamframework.org/Documentation/WeldQuickstartForMavenUsers
- - Issue tracker: https://jira.jboss.org/jira/browse/WELDRAD
- - Source code: http://anonsvn.jboss.org/repos/weld/archetypes
- - Forums: http://seamframework.org/Community/WeldUsers
- JSR-299 overview: http://seamframework.org/Weld
- JSF community site: http://www.javaserverfaces.org
+ - Weld archetypes
+ - Quickstart: http://seamframework.org/Documentation/WeldQuickstartForMavenUsers
+ - Issue tracker: https://jira.jboss.org/jira/browse/WELDRAD
+ - Source code: http://anonsvn.jboss.org/repos/weld/archetypes
+ - Forums: http://seamframework.org/Community/WeldUsers
+ - JSR-299 overview: http://seamframework.org/Weld
+ - JSF community site: http://www.javaserverfaces.org
Modified: archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java 2010-07-31 01:07:01 UTC (rev 6863)
+++ archetypes/javaee6-webapp/trunk/src/main/java/com/mycompany/MemberRegistration.java 2010-07-31 17:51:15 UTC (rev 6864)
@@ -8,9 +8,10 @@
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.transaction.UserTransaction;
+import javax.ejb.Stateful;
import org.slf4j.Logger;
-//@Stateful // enable when JBoss AS M4 is out
+// @Stateful // Adding this annotation eliminates need for manual transaction demarcation
@Model
public class MemberRegistration
{
@@ -21,8 +22,11 @@
@MemberRepository
private EntityManager em;
+ //@Inject
+ //private UserTransaction utx;
+
@Inject
- private UserTransaction utx;
+ private Event<Member> memberEventSrc;
private Member newMember;
@@ -32,12 +36,11 @@
{
return newMember;
}
- @Inject
- private Event<Member> memberEventSrc;
public void register() throws Exception
{
log.info("Registering " + newMember.getName());
+ // UserTransaction only needed when bean is not an EJB
utx.begin();
em.joinTransaction();
em.persist(newMember);
14 years, 3 months
Weld SVN: r6863 - java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-07-30 21:07:01 -0400 (Fri, 30 Jul 2010)
New Revision: 6863
Modified:
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
Log:
improve comment on optional dep changes
Modified: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-07-31 01:01:13 UTC (rev 6862)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-07-31 01:07:01 UTC (rev 6863)
@@ -55,7 +55,11 @@
// then a CNFE can be thrown later in the deployment process when the
// Introspector is inspecting the class. We call getMethods, getFields
// and getConstructors now over the whole type heirachey to force
- // these errors to occur early
+ // these errors to occur early.
+ // NOTE it is still possible for a CNFE to be thrown at runtime if
+ // a class has methods that refer to classes that are not present in
+ // their bytecode, this only checks for classes that form part of the
+ // class schema that are not present
Class<?> obj = clazz;
while (obj != null && obj != Object.class)
{
14 years, 3 months
Weld SVN: r6862 - java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-07-30 21:01:13 -0400 (Fri, 30 Jul 2010)
New Revision: 6862
Modified:
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
Log:
improve the way weld-se handles optional dependencies
Modified: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-07-30 23:53:22 UTC (rev 6861)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/WeldSEResourceLoader.java 2010-07-31 01:01:13 UTC (rev 6862)
@@ -23,6 +23,7 @@
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.resources.spi.ResourceLoadingException;
import org.jboss.weld.util.collections.EnumerationList;
+import org.jboss.weld.util.reflection.Reflections;
/**
* A simple resource loader.
@@ -41,14 +42,29 @@
try
{
+ Class<?> clazz = null;
if (Thread.currentThread().getContextClassLoader() != null)
{
- return Thread.currentThread().getContextClassLoader().loadClass(name);
+ clazz = Thread.currentThread().getContextClassLoader().loadClass(name);
}
else
{
- return Class.forName(name);
+ clazz = Class.forName(name);
}
+ // if the class relies on optional dependencies that are not present
+ // then a CNFE can be thrown later in the deployment process when the
+ // Introspector is inspecting the class. We call getMethods, getFields
+ // and getConstructors now over the whole type heirachey to force
+ // these errors to occur early
+ Class<?> obj = clazz;
+ while (obj != null && obj != Object.class)
+ {
+ obj.getDeclaredConstructors();
+ obj.getDeclaredFields();
+ obj.getDeclaredMethods();
+ obj = obj.getSuperclass();
+ }
+ return clazz;
}
catch (ClassNotFoundException e)
{
14 years, 3 months
Weld SVN: r6861 - java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url.
by weld-commits@lists.jboss.org
Author: swd847
Date: 2010-07-30 19:53:22 -0400 (Fri, 30 Jul 2010)
New Revision: 6861
Modified:
java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java
Log:
catch ResourceLoadingException so weld-se can start up if scanning causes a NCDFE
Modified: java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java
===================================================================
--- java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java 2010-07-30 19:10:01 UTC (rev 6860)
+++ java-se/trunk/src/main/java/org/jboss/weld/environment/se/discovery/url/FileSystemURLHandler.java 2010-07-30 23:53:22 UTC (rev 6861)
@@ -28,6 +28,7 @@
import org.jboss.weld.environment.se.discovery.MutableBeanDeploymentArchive;
import org.jboss.weld.resources.spi.ResourceLoader;
+import org.jboss.weld.resources.spi.ResourceLoadingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -159,6 +160,10 @@
{
log.error("Error loading " + name, e);
}
+ catch(ResourceLoadingException e)
+ {
+ log.error("Error loading " + name, e);
+ }
}
else if (name.endsWith("beans.xml"))
{
14 years, 3 months
Weld SVN: r6860 - in core/trunk: tests/src/test/java/org/jboss/weld/tests/interceptors and 1 other directories.
by weld-commits@lists.jboss.org
Author: marius.bogoevici
Date: 2010-07-30 15:10:01 -0400 (Fri, 30 Jul 2010)
New Revision: 6860
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBinding.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBindingTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/NaiveClass.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java
Log:
WELD-563: throw a DefinitionException if the InterceptorBinding has the wrong Target. initial take on unwrapping the ComputationException
Modified: core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2010-07-29 22:21:09 UTC (rev 6859)
+++ core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2010-07-30 19:10:01 UTC (rev 6860)
@@ -57,6 +57,7 @@
super(type, transformer);
if (isValid())
{
+ checkTargetType();
initNonBindingTypes();
initInterceptionBindingTypes();
checkArrayAndAnnotationValuedMembers();
@@ -86,27 +87,29 @@
inheritedInterceptionBindingTypes = getAnnotatedAnnotation().getMetaAnnotations(InterceptorBinding.class);
}
- @Override
- protected void initValid()
+ private void checkTargetType()
{
- super.initValid();
if (!getAnnotatedAnnotation().isAnnotationPresent(Target.class))
{
this.valid = false;
- log.debug(MISSING_TARGET, getAnnotatedAnnotation());
+ throw new DefinitionException(MISSING_TARGET, getAnnotatedAnnotation());
}
else
{
- ElementType[] targetElementTypes = getAnnotatedAnnotation().getAnnotation(Target.class).value();
- if (!Arrays2.unorderedEquals(targetElementTypes, ElementType.TYPE, ElementType.METHOD)
- && !Arrays2.unorderedEquals(targetElementTypes, ElementType.TYPE))
+ if (!isValidTargetType())
{
this.valid = false;
- log.debug(MISSING_TARGET_TYPE_METHOD_OR_TARGET_TYPE, getAnnotatedAnnotation());
+ throw new DefinitionException(MISSING_TARGET_TYPE_METHOD_OR_TARGET_TYPE, getAnnotatedAnnotation());
}
}
}
+ private boolean isValidTargetType()
+ {
+ return Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), ElementType.TYPE, ElementType.METHOD)
+ || Arrays2.unorderedEquals(getAnnotatedAnnotation().getAnnotation(Target.class).value(), ElementType.TYPE);
+ }
+
private void checkMetaAnnotations()
{
if (Arrays2.containsAll(getAnnotatedAnnotation().getAnnotation(Target.class).value(), ElementType.METHOD))
@@ -116,8 +119,7 @@
if (!Arrays2.containsAll(inheritedBinding.annotationType().getAnnotation(Target.class).value(), ElementType.METHOD))
{
this.valid = false;
- log.debug(TARGET_TYPE_METHOD_INHERITS_FROM_TARGET_TYPE,
- getAnnotatedAnnotation(), inheritedBinding);
+ log.debug(TARGET_TYPE_METHOD_INHERITS_FROM_TARGET_TYPE, getAnnotatedAnnotation(), inheritedBinding);
}
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java 2010-07-29 22:21:09 UTC (rev 6859)
+++ core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MetaAnnotationStore.java 2010-07-30 19:10:01 UTC (rev 6860)
@@ -19,12 +19,15 @@
import java.lang.annotation.Annotation;
import java.util.concurrent.ConcurrentMap;
+import com.google.common.base.Function;
+import com.google.common.collect.ComputationException;
+import com.google.common.collect.MapMaker;
import org.jboss.weld.bootstrap.api.Service;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.resources.ClassTransformer;
-import com.google.common.base.Function;
-import com.google.common.collect.MapMaker;
-
/**
* Metadata singleton for holding EJB metadata, scope models etc.
*
@@ -202,6 +205,22 @@
public <T extends Annotation> InterceptorBindingModel<T> getInterceptorBindingModel(final Class<T> interceptorBinding)
{
- return (InterceptorBindingModel<T>) interceptorBindings.get(interceptorBinding);
+ // Unwrap Definition/Deployment exceptions wrapped in a ComputationException
+ // TODO: generalize this and move to a higher level (MBG)
+ try
+ {
+ return (InterceptorBindingModel<T>) interceptorBindings.get(interceptorBinding);
+ }
+ catch (ComputationException e)
+ {
+ if (e.getCause() instanceof DeploymentException || e.getCause() instanceof DefinitionException)
+ {
+ throw (WeldException)e.getCause();
+ }
+ else
+ {
+ throw e;
+ }
+ }
}
}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBinding.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBinding.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBinding.java 2010-07-30 19:10:01 UTC (rev 6860)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, 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.weld.tests.interceptors.interceptorBinding;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * @author Marius Bogoevici
+ */
+@InterceptorBinding
+@Retention(RUNTIME)
+(a)Target({ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR})
+@Documented
+public @interface BadInterceptorBinding
+{
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBindingTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBindingTest.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/BadInterceptorBindingTest.java 2010-07-30 19:10:01 UTC (rev 6860)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, 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.weld.tests.interceptors.interceptorBinding;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+/**
+ * @author Marius Bogoevici
+ */
+@Artifact
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class BadInterceptorBindingTest extends AbstractWeldTest
+{
+
+ @Test
+ public void testBadInterceptorBinding()
+ {
+
+ }
+
+}
Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/NaiveClass.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/NaiveClass.java (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/interceptorBinding/NaiveClass.java 2010-07-30 19:10:01 UTC (rev 6860)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates, 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.weld.tests.interceptors.interceptorBinding;
+
+/**
+ * @author Marius Bogoevici
+ */
+@BadInterceptorBinding
+public class NaiveClass
+{
+ public void doSomething()
+ {
+ }
+}
14 years, 3 months
Weld SVN: r6859 - core/trunk/jboss-tck-runner/src/test/resources.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-29 18:21:09 -0400 (Thu, 29 Jul 2010)
New Revision: 6859
Modified:
core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
Log:
exclude known bad tck tests
Modified: core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml
===================================================================
--- core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-07-29 21:29:36 UTC (rev 6858)
+++ core/trunk/jboss-tck-runner/src/test/resources/tck-tests.xml 2010-07-29 22:21:09 UTC (rev 6859)
@@ -17,22 +17,44 @@
<!-- Issues in the TCK -->
- <!-- CDITCK-162 -->
- <class name="org.jboss.jsr299.tck.tests.implementation.simple.resource.resource.InjectionOfResourceTest">
+ <!-- CDITCK-169 -->
+ <class name="org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext.PersistenceContextInjectionTest">
<methods>
- <exclude name="testInjectionOfResource" />
- <exclude name="testProduceResourceProxy" />
+ <exclude name="testInjectionOfPersistenceContext" />
+ <exclude name="testPassivationOfPersistenceContext" />
</methods>
</class>
- <!-- CDITCK-163 -->
- <class name="org.jboss.jsr299.tck.tests.context.session.SessionContextTest">
+ <!-- CDITCK-170 -->
+ <class name="org.jboss.jsr299.tck.tests.event.observer.transactional.TransactionalObserversTest">
<methods>
- <exclude name="testSessionContextDestroyedWhenHttpSessionInvalidated" />
- <exclude name="testSessionContextDestroyedWhenHttpSessionTimesOut" />
+ <exclude name="testObserverCanSetRollbackOnlyOnTransaction" />
</methods>
</class>
-
+
+ <!-- CDITCK-171 -->
+ <class name="org.jboss.jsr299.tck.tests.implementation.simple.definition.SimpleBeanDefinitionTest">
+ <methods>
+ <exclude name="testAbstractClassDeclaredInJavaNotDiscovered" />
+ <exclude name="testDependentScopedBeanCanHavePublicField" />
+ <exclude name="testInitializerAnnotatedConstructor" />
+ <exclude name="testInitializerAnnotatedConstructorUsedOverEmptyConstuctor" />
+ <exclude name="testInterfaceNotDiscoveredAsSimpleBean" />
+ <exclude name="testNonStaticInnerClassDeclaredInJavaNotDiscovered" />
+ <exclude name="testSimpleBeanOnlyIfConstructorIsInitializer" />
+ <exclude name="testSimpleBeanOnlyIfConstructorParameterless" />
+ <exclude name="testStaticInnerClassDeclaredInJavaAllowed" />
+ <exclude name="testEmptyConstructorUsed" />
+ </methods>
+ </class>
+ <class name="org.jboss.jsr299.tck.tests.implementation.simple.definition.EnterpriseBeanNotDiscoveredAsManagedBeanTest">
+ <methods>
+ <exclude name="testClassesImplementingEnterpriseBeanInterfaceNotDiscoveredAsSimpleBean" />
+ </methods>
+ </class>
+
+
+
<!-- Issues in Weld (the RI) -->
<!-- WELD-401 -->
14 years, 4 months
Weld SVN: r6858 - core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/injectionTarget.
by weld-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-29 17:29:36 -0400 (Thu, 29 Jul 2010)
New Revision: 6858
Modified:
core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/injectionTarget/InjectionTargetTest.java
Log:
disable test properly
Modified: core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/injectionTarget/InjectionTargetTest.java
===================================================================
--- core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/injectionTarget/InjectionTargetTest.java 2010-07-29 20:57:08 UTC (rev 6857)
+++ core/trunk/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/injectionTarget/InjectionTargetTest.java 2010-07-29 21:29:36 UTC (rev 6858)
@@ -29,12 +29,14 @@
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.Utils;
-import org.jboss.weld.tests.category.Integration;
+import org.jboss.weld.tests.category.Broken;
import org.junit.Assert;
+import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
-(a)Category(Integration.class)
+//(a)Category(Integration.class)
+(a)Category(Broken.class)
@RunWith(Arquillian.class)
public class InjectionTargetTest
{
@@ -58,7 +60,7 @@
/*
* description = "WELD-557"
*/
- //@Test
+ @Test
public void testActualInstanceAndNotProxyPassedToInject()
{
InjectionTargetWrapper.clear();
@@ -70,7 +72,7 @@
/*
* description = "WELD-557"
*/
- //@Test
+ @Test
public void testActualInstanceAndNotProxyPassedToPostConstruct()
{
InjectionTargetWrapper.clear();
@@ -82,7 +84,8 @@
/*
* description = "WELD-557"
*/
- //@Test
+ //
+ @Test
public void testActualInstanceAndNotProxyPassedToPreDestroy()
{
// prepare instance
14 years, 4 months