Seam SVN: r13822 - in modules/security/trunk: examples/openid-op/src/main/webapp/WEB-INF and 8 other directories.
by seam-commits@lists.jboss.org
Author: marcelkolsteren
Date: 2010-10-10 12:49:49 -0400 (Sun, 10 Oct 2010)
New Revision: 13822
Modified:
modules/security/trunk/examples/openid-op/src/main/java/org/jboss/seam/security/examples/openid/Configuration.java
modules/security/trunk/examples/openid-op/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdProviderBean.java
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdRpBean.java
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/idp/SamlIdpBean.java
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/sp/SamlSpBean.java
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplication.java
modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplicationScoped.java
modules/security/trunk/external/src/test/resources/WEB-INF/idp-beans.xml
modules/security/trunk/external/src/test/resources/WEB-INF/op-beans.xml
modules/security/trunk/external/src/test/resources/WEB-INF/rp-beans.xml
modules/security/trunk/external/src/test/resources/WEB-INF/sp-beans.xml
modules/security/trunk/external/src/test/resources/WEB-INF/web.xml
Log:
Fixed some problems that popped up when trying to run the external authentication tests and sample applications on JBoss AS 6.0.0.M5.
Modified: modules/security/trunk/examples/openid-op/src/main/java/org/jboss/seam/security/examples/openid/Configuration.java
===================================================================
--- modules/security/trunk/examples/openid-op/src/main/java/org/jboss/seam/security/examples/openid/Configuration.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/examples/openid-op/src/main/java/org/jboss/seam/security/examples/openid/Configuration.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -24,19 +24,14 @@
import javax.enterprise.inject.Model;
import javax.inject.Inject;
-import org.jboss.seam.security.external.openid.api.OpenIdRelyingPartyConfigurationApi;
+import org.jboss.seam.security.external.openid.api.OpenIdProviderConfigurationApi;
@Model
public class Configuration
{
@Inject
- private OpenIdRelyingPartyConfigurationApi confApi;
+ private OpenIdProviderConfigurationApi confApi;
- public String getRealm()
- {
- return confApi.getRealm();
- }
-
public String getXrdsURL()
{
return confApi.getXrdsURL();
Modified: modules/security/trunk/examples/openid-op/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/openid-op/src/main/webapp/WEB-INF/beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/examples/openid-op/src/main/webapp/WEB-INF/beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -2,6 +2,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.openid.OpenIdProviderInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.openid.OpenIdProviderInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/examples/openid-rp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -2,6 +2,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.openid.OpenIdRpInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.openid.OpenIdRpInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/examples/saml-idp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -2,6 +2,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.saml.idp.SamlIdpInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.saml.idp.SamlIdpInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/examples/saml-sp/src/main/webapp/WEB-INF/beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -2,6 +2,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.saml.sp.SamlSpInVirtualApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.saml.sp.SamlSpInVirtualApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdProviderBean.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdProviderBean.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdProviderBean.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -29,6 +29,7 @@
import java.util.Map;
import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.Typed;
import javax.inject.Inject;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
@@ -56,6 +57,7 @@
* @author Marcel Kolsteren
*
*/
+(a)Typed(OpenIdProviderBean.class)
public class OpenIdProviderBean extends EntityBean implements OpenIdProviderApi, OpenIdProviderConfigurationApi
{
@Inject
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdRpBean.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdRpBean.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/openid/OpenIdRpBean.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -24,6 +24,7 @@
import java.io.Writer;
import java.util.List;
+import javax.enterprise.inject.Typed;
import javax.inject.Inject;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
@@ -50,6 +51,7 @@
* @author Marcel Kolsteren
*
*/
+(a)Typed(OpenIdRpBean.class)
public class OpenIdRpBean extends EntityBean implements OpenIdRelyingPartyApi, OpenIdRelyingPartyConfigurationApi
{
@Inject
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/idp/SamlIdpBean.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/idp/SamlIdpBean.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/idp/SamlIdpBean.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -30,6 +30,7 @@
import java.util.Set;
import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.Typed;
import javax.inject.Inject;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBException;
@@ -60,6 +61,7 @@
* @author Marcel Kolsteren
*
*/
+(a)Typed(SamlIdpBean.class)
public class SamlIdpBean extends SamlEntityBean implements SamlMultiUserIdentityProviderApi, SamlIdentityProviderConfigurationApi
{
@Inject
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/sp/SamlSpBean.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/sp/SamlSpBean.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/saml/sp/SamlSpBean.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Set;
+import javax.enterprise.inject.Typed;
import javax.inject.Inject;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBException;
@@ -52,6 +53,7 @@
* @author Marcel Kolsteren
*
*/
+(a)Typed(SamlSpBean.class)
public class SamlSpBean extends SamlEntityBean implements SamlMultiUserServiceProviderApi, SamlServiceProviderConfigurationApi
{
private List<SamlExternalIdentityProvider> identityProviders = new LinkedList<SamlExternalIdentityProvider>();
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplication.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplication.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplication.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -25,7 +25,7 @@
* This virtual application scoped bean is automatically created in the virtual
* application scope as soon as the virtual application is created. It can be
* used to get virtual application properties. For background about the virtual
- * application scope, see {@link VirtualApplication}.
+ * application scope, see {@link VirtualApplicationScoped}.
*
* @author Marcel Kolsteren
*
Modified: modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplicationScoped.java
===================================================================
--- modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplicationScoped.java 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/main/java/org/jboss/seam/security/external/virtualapplications/api/VirtualApplicationScoped.java 2010-10-10 16:49:49 UTC (rev 13822)
@@ -34,12 +34,23 @@
* The virtual application scope corresponds to a part of the application that
* serves a certain host name. It can be used for situations where a single
* application is used by different companies, each accessing the application
- * using a host name that is part of the company's internet domain name. It is
- * comparable to virtual hosting mechanisms that can be used to share one
- * webserver with one IP-address by multiple companies.
+ * using a host name that is part of the company's internet domain name.
* </p>
*
* <p>
+ * The virtual application scope is intented to be used in a multi-tenant
+ * software architecture. Wikipedia describes this architecture as follows:
+ * "Multi-tenancy refers to a principle in software architecture where a single
+ * instance of the software runs on a server, serving multiple client
+ * organizations (tenants). Multi-tenancy is contrasted with a multi-instance
+ * architecture where separate software instances (or hardware systems) are set
+ * up for different client organizations. With a multi-tenant architecture, a
+ * software application is designed to virtually partition its data and
+ * configuration thus each client organization works with a customized virtual
+ * application instance."
+ * </p>
+ *
+ * <p>
* In the application context, one stores the configuration or data that is
* specific for one company using the application. In the context of Seam
* security, the virtual application context can be used to store the
Modified: modules/security/trunk/external/src/test/resources/WEB-INF/idp-beans.xml
===================================================================
--- modules/security/trunk/external/src/test/resources/WEB-INF/idp-beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/test/resources/WEB-INF/idp-beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -1,6 +1,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.saml.idp.SamlIdpInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.saml.idp.SamlIdpInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/external/src/test/resources/WEB-INF/op-beans.xml
===================================================================
--- modules/security/trunk/external/src/test/resources/WEB-INF/op-beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/test/resources/WEB-INF/op-beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -1,6 +1,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.openid.OpenIdProviderInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.openid.OpenIdProviderInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/external/src/test/resources/WEB-INF/rp-beans.xml
===================================================================
--- modules/security/trunk/external/src/test/resources/WEB-INF/rp-beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/test/resources/WEB-INF/rp-beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -1,6 +1,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.openid.OpenIdRpInApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.openid.OpenIdRpInApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/external/src/test/resources/WEB-INF/sp-beans.xml
===================================================================
--- modules/security/trunk/external/src/test/resources/WEB-INF/sp-beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/test/resources/WEB-INF/sp-beans.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -1,6 +1,6 @@
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
- <classes>org.jboss.seam.security.external.saml.sp.SamlSpInVirtualApplicationScopeProducer</classes>
+ <class>org.jboss.seam.security.external.saml.sp.SamlSpInVirtualApplicationScopeProducer</class>
</alternatives>
</beans>
Modified: modules/security/trunk/external/src/test/resources/WEB-INF/web.xml
===================================================================
--- modules/security/trunk/external/src/test/resources/WEB-INF/web.xml 2010-10-10 00:28:38 UTC (rev 13821)
+++ modules/security/trunk/external/src/test/resources/WEB-INF/web.xml 2010-10-10 16:49:49 UTC (rev 13822)
@@ -4,5 +4,4 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
-
</web-app>
14 years, 2 months
Seam SVN: r13821 - in modules/xml/trunk/impl/src: test/java/org/jboss/seam/xml/test/simple and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 20:28:38 -0400 (Sat, 09 Oct 2010)
New Revision: 13821
Added:
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideBean.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideTest.java
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
Log:
SEAMXML-17 add ability to override the scope of a bean
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-10-10 00:27:40 UTC (rev 13820)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-10-10 00:28:38 UTC (rev 13821)
@@ -27,9 +27,7 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import javax.enterprise.context.NormalScope;
import javax.enterprise.inject.spi.AnnotatedType;
@@ -50,10 +48,6 @@
private final BeanManager beanManager;
- private final Map<Method, Annotation> methodScopeOverrides;
- private final Map<Field, Annotation> fieldScopeOverrides;
- private Annotation beanScopeOverride = null;
-
public BeanResult(Class<X> type, boolean readAnnotations, BeanResultType beanType, List<FieldValueObject> fieldValues, List<BeanResult<?>> inlineBeans, BeanManager beanManager)
{
this.beanManager = beanManager;
@@ -69,8 +63,6 @@
this.beanType = beanType;
this.fieldValues = new ArrayList<FieldValueObject>(fieldValues);
this.inlineBeans = new ArrayList<BeanResult<?>>(inlineBeans);
- methodScopeOverrides = new HashMap<Method, Annotation>();
- fieldScopeOverrides = new HashMap<Field, Annotation>();
}
public List<BeanResult<?>> getInlineBeans()
@@ -98,7 +90,15 @@
// TODO: this should be done with the BeanManager one WELD-721 is resolved
if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
{
- beanScopeOverride = annotation;
+ // if the user is adding a new scope we need to remove any existing
+ // ones
+ for (Annotation typeAnnotation : type.getAnnotations())
+ {
+ if (typeAnnotation.annotationType().isAnnotationPresent(Scope.class) || typeAnnotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ builder.removeFromClass(typeAnnotation.annotationType());
+ }
+ }
}
builder.addToClass(annotation);
}
@@ -107,7 +107,13 @@
{
if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
{
- fieldScopeOverrides.put(field, annotation);
+ for (Annotation typeAnnotation : field.getAnnotations())
+ {
+ if (typeAnnotation.annotationType().isAnnotationPresent(Scope.class) || typeAnnotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ builder.removeFromField(field, typeAnnotation.annotationType());
+ }
+ }
}
builder.addToField(field, annotation);
}
@@ -116,7 +122,13 @@
{
if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
{
- methodScopeOverrides.put(method, annotation);
+ for (Annotation typeAnnotation : method.getAnnotations())
+ {
+ if (typeAnnotation.annotationType().isAnnotationPresent(Scope.class) || typeAnnotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ builder.removeFromMethod(method, typeAnnotation.annotationType());
+ }
+ }
}
builder.addToMethod(method, annotation);
}
Added: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideBean.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideBean.java (rev 0)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideBean.java 2010-10-10 00:28:38 UTC (rev 13821)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.xml.test.simple;
+
+import javax.enterprise.context.Dependent;
+
+@Dependent
+public class ScopeOverrideBean
+{
+ public ScopeOverrideBean()
+ {
+ value = 1;
+ }
+
+ private int value;
+
+ public int getValue()
+ {
+ return value;
+ }
+
+ public void setValue(int value)
+ {
+ this.value = value;
+ }
+
+}
Added: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideTest.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideTest.java (rev 0)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ScopeOverrideTest.java 2010-10-10 00:28:38 UTC (rev 13821)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.xml.test.simple;
+
+import junit.framework.Assert;
+
+import org.jboss.seam.xml.test.AbstractXMLTest;
+import org.junit.Test;
+
+public class ScopeOverrideTest extends AbstractXMLTest
+{
+
+ @Override
+ protected String getXmlFileName()
+ {
+ return "simple-beans.xml";
+ }
+
+ @Test
+ public void scopeOverrideTest()
+ {
+ ScopeOverrideBean x = getReference(ScopeOverrideBean.class);
+ x.setValue(10);
+ x = getReference(ScopeOverrideBean.class);
+ Assert.assertEquals(10, x.getValue());
+ }
+
+}
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-10-10 00:27:40 UTC (rev 13820)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-10-10 00:28:38 UTC (rev 13821)
@@ -33,4 +33,8 @@
<test:ExtendedQualifier2/>
</test:ExtendedBean>
+ <test:ScopeOverrideBean>
+ <modifies/>
+ <ApplicationScoped/>
+ </test:ScopeOverrideBean>
</beans>
\ No newline at end of file
14 years, 2 months
Seam SVN: r13820 - modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 20:27:40 -0400 (Sat, 09 Oct 2010)
New Revision: 13820
Added:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlConfiguredBeanLiteral.java
Log:
oops
Added: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlConfiguredBeanLiteral.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlConfiguredBeanLiteral.java (rev 0)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlConfiguredBeanLiteral.java 2010-10-10 00:27:40 UTC (rev 13820)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.xml.core;
+
+import javax.enterprise.util.AnnotationLiteral;
+
+public class XmlConfiguredBeanLiteral extends AnnotationLiteral<XmlConfiguredBean> implements XmlConfiguredBean
+{
+ private static final long serialVersionUID = 2812698113865428827L;
+
+ public static XmlConfiguredBeanLiteral INSTANCE = new XmlConfiguredBeanLiteral();
+}
14 years, 2 months
Seam SVN: r13819 - modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 20:27:11 -0400 (Sat, 09 Oct 2010)
New Revision: 13819
Modified:
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/AbstractXMLTest.java
Log:
fix minor tests bug
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/AbstractXMLTest.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/AbstractXMLTest.java 2010-10-09 22:47:06 UTC (rev 13818)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/AbstractXMLTest.java 2010-10-10 00:27:11 UTC (rev 13819)
@@ -73,8 +73,8 @@
bs.append("]");
throw new RuntimeException("More than one bean found with class: " + clazz + " and bindings " + bs);
}
- Bean bean = beans.iterator().next();
- return (T) bean.create(manager.createCreationalContext(bean));
+ Bean<?> bean = beans.iterator().next();
+ return (T) manager.getReference(bean, clazz, manager.createCreationalContext(bean));
}
}
14 years, 2 months
Seam SVN: r13818 - in modules/xml/trunk: impl/src/main/java/org/jboss/seam/xml and 3 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 18:47:06 -0400 (Sat, 09 Oct 2010)
New Revision: 13818
Removed:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/annotations/
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java
Log:
minor refactoring
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-10-09 12:33:10 UTC (rev 13817)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-10-09 22:47:06 UTC (rev 13818)
@@ -429,8 +429,7 @@
<s:array>
<test:MethodValueBean/>
</s:array>
-</test:method>
- ]]>
+</test:method>]]>
</programlisting>
</section>
<section>
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-10-09 12:33:10 UTC (rev 13817)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-10-09 22:47:06 UTC (rev 13818)
@@ -30,8 +30,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
+import java.util.Map.Entry;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
@@ -42,7 +42,6 @@
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.ProcessAnnotatedType;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Named;
import org.jboss.seam.xml.core.BeanResult;
@@ -62,24 +61,24 @@
public class XmlExtension implements Extension
{
- AnnotationInstanceProvider ac = new AnnotationInstanceProvider();
+ private AnnotationInstanceProvider annotationInstanceProvider = new AnnotationInstanceProvider();
static final String PROVIDERS_FILE = "META-INF/services/org.jboss.seam.xml.XmlExtension";
- List<XmlResult> results = new ArrayList<XmlResult>();
+ private List<XmlResult> results = new ArrayList<XmlResult>();
- Set<Class<?>> veto = new HashSet<Class<?>>();
+ private Set<Class<?>> veto = new HashSet<Class<?>>();
- int count = 0;
+ private int count = 0;
private static final Logger log = LoggerFactory.getLogger(XmlExtension.class);
/**
* map of syntetic bean id to a list of field value objects
*/
- Map<Integer, List<FieldValueObject>> fieldValues = new HashMap<Integer, List<FieldValueObject>>();
+ private Map<Integer, List<FieldValueObject>> fieldValues = new HashMap<Integer, List<FieldValueObject>>();
- List<Exception> errors = new ArrayList<Exception>();
+ private List<Exception> errors = new ArrayList<Exception>();
/**
* This is the entry point for the extension
@@ -114,13 +113,22 @@
// build the generic bean data
for (XmlResult r : results)
{
- // add the qualifiers as we need them before we process the generic
- // bean info
+ // add the qualifiers etc first
for (Class<? extends Annotation> b : r.getQualifiers())
{
log.info("Adding XML Defined Qualifier: " + b.getName());
event.addQualifier(b);
}
+ for (Class<? extends Annotation> b : r.getInterceptorBindings())
+ {
+ log.info("Adding XML Defined Interceptor Binding: " + b.getName());
+ event.addInterceptorBinding(b);
+ }
+ for (Entry<Class<? extends Annotation>, Annotation[]> b : r.getStereotypes().entrySet())
+ {
+ log.info("Adding XML Defined Stereotype: " + b.getKey().getName());
+ event.addStereotype(b.getKey(), b.getValue());
+ }
}
for (XmlResult r : results)
@@ -140,27 +148,14 @@
fieldValues.put(val, b.getFieldValues());
Map<String, Object> am = new HashMap<String, Object>();
am.put("value", val);
- Annotation a = ac.get(XmlId.class, am);
- b.getBuilder().addToClass(a);
+ Annotation a = annotationInstanceProvider.get(XmlId.class, am);
+ b.addToClass(a);
}
}
- for (Class<? extends Annotation> b : r.getInterceptorBindings())
- {
- log.info("Adding XML Defined Interceptor Binding: " + b.getName());
- event.addInterceptorBinding(b);
- }
- for (Entry<Class<? extends Annotation>, Annotation[]> b : r.getStereotypes().entrySet())
- {
- log.info("Adding XML Defined Stereotype: " + b.getKey().getName());
- event.addStereotype(b.getKey(), b.getValue());
- }
for (BeanResult<?> bb : r.getFlattenedBeans())
{
- bb.getBuilder().addToClass(new AnnotationLiteral<XmlConfiguredBean>()
- {
- });
- AnnotatedType<?> tp = bb.getBuilder().create();
+ AnnotatedType<?> tp = bb.getAnnotatedType();
log.info("Adding XML Defined Bean: " + tp.getJavaClass().getName());
event.addAnnotatedType(tp);
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-10-09 12:33:10 UTC (rev 13817)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-10-09 22:47:06 UTC (rev 13818)
@@ -21,10 +21,21 @@
*/
package org.jboss.seam.xml.core;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import javax.enterprise.context.NormalScope;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Scope;
+
import org.jboss.seam.xml.fieldset.FieldValueObject;
import org.jboss.weld.extensions.core.Veto;
import org.jboss.weld.extensions.reflection.annotated.AnnotatedTypeBuilder;
@@ -37,10 +48,18 @@
private final List<FieldValueObject> fieldValues;
private final List<BeanResult<?>> inlineBeans;
- public BeanResult(Class<X> type, boolean readAnnotations, BeanResultType beanType, List<FieldValueObject> fieldValues, List<BeanResult<?>> inlineBeans)
+ private final BeanManager beanManager;
+
+ private final Map<Method, Annotation> methodScopeOverrides;
+ private final Map<Field, Annotation> fieldScopeOverrides;
+ private Annotation beanScopeOverride = null;
+
+ public BeanResult(Class<X> type, boolean readAnnotations, BeanResultType beanType, List<FieldValueObject> fieldValues, List<BeanResult<?>> inlineBeans, BeanManager beanManager)
{
+ this.beanManager = beanManager;
this.type = type;
- builder = new AnnotatedTypeBuilder().setJavaClass(type);
+ builder = new AnnotatedTypeBuilder<X>().setJavaClass(type);
+ builder.addToClass(XmlConfiguredBeanLiteral.INSTANCE);
if (readAnnotations)
{
builder.readFromType(type);
@@ -50,6 +69,8 @@
this.beanType = beanType;
this.fieldValues = new ArrayList<FieldValueObject>(fieldValues);
this.inlineBeans = new ArrayList<BeanResult<?>>(inlineBeans);
+ methodScopeOverrides = new HashMap<Method, Annotation>();
+ fieldScopeOverrides = new HashMap<Field, Annotation>();
}
public List<BeanResult<?>> getInlineBeans()
@@ -57,11 +78,6 @@
return inlineBeans;
}
- public AnnotatedTypeBuilder<X> getBuilder()
- {
- return builder;
- }
-
public Class<X> getType()
{
return type;
@@ -77,4 +93,57 @@
return Collections.unmodifiableList(fieldValues);
}
+ public void addToClass(Annotation annotation)
+ {
+ // TODO: this should be done with the BeanManager one WELD-721 is resolved
+ if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ beanScopeOverride = annotation;
+ }
+ builder.addToClass(annotation);
+ }
+
+ public void addToField(Field field, Annotation annotation)
+ {
+ if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ fieldScopeOverrides.put(field, annotation);
+ }
+ builder.addToField(field, annotation);
+ }
+
+ public void addToMethod(Method method, Annotation annotation)
+ {
+ if (annotation.annotationType().isAnnotationPresent(Scope.class) || annotation.annotationType().isAnnotationPresent(NormalScope.class))
+ {
+ methodScopeOverrides.put(method, annotation);
+ }
+ builder.addToMethod(method, annotation);
+ }
+
+ public void addToMethodParameter(Method method, int param, Annotation annotation)
+ {
+ builder.addToMethodParameter(method, param, annotation);
+ }
+
+ public void addToConstructor(Constructor<?> constructor, Annotation annotation)
+ {
+ builder.addToConstructor((Constructor) constructor, annotation);
+ }
+
+ public void addToConstructorParameter(Constructor<?> constructor, int param, Annotation annotation)
+ {
+ builder.addToConstructorParameter((Constructor) constructor, param, annotation);
+ }
+
+ public void overrideFieldType(Field field, Class<?> javaClass)
+ {
+ builder.overrideFieldType(field, javaClass);
+ }
+
+ public AnnotatedType<?> getAnnotatedType()
+ {
+ return builder.create();
+ }
+
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-09 12:33:10 UTC (rev 13817)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-10-09 22:47:06 UTC (rev 13818)
@@ -29,12 +29,10 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
+import java.util.Map.Entry;
import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
import org.jboss.seam.xml.core.BeanResult;
import org.jboss.seam.xml.core.BeanResultType;
@@ -42,18 +40,18 @@
import org.jboss.seam.xml.fieldset.FieldValueObject;
import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
+import org.jboss.weld.extensions.literal.InjectLiteral;
import org.jboss.weld.extensions.properties.Properties;
import org.jboss.weld.extensions.properties.Property;
import org.jboss.weld.extensions.properties.query.NamedPropertyCriteria;
import org.jboss.weld.extensions.properties.query.PropertyQueries;
import org.jboss.weld.extensions.properties.query.PropertyQuery;
import org.jboss.weld.extensions.reflection.Reflections;
-import org.jboss.weld.extensions.reflection.annotated.AnnotatedTypeBuilder;
public class ClassXmlItem extends AbstractXmlItem
{
- HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
+ private HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public ClassXmlItem(XmlItem parent, Class<?> c, Map<String, String> attributes, String document, int lineno)
{
@@ -97,20 +95,12 @@
{
boolean override = !getChildrenOfType(ReplacesXmlItem.class).isEmpty();
boolean extend = !getChildrenOfType(ModifiesXmlItem.class).isEmpty();
- BeanResultType beanType = BeanResultType.ADD;
if (override && extend)
{
throw new XmlConfigurationException("A bean may not both <override> and <extend> an existing bean", getDocument(), getLineno());
}
- if (override)
- {
- beanType = BeanResultType.REPLACES;
- }
- else if (extend)
- {
- beanType = BeanResultType.MODIFIES;
- }
- List<BeanResult> inlineBeans = new ArrayList<BeanResult>();
+ BeanResultType beanType = override ? BeanResultType.REPLACES : (extend ? BeanResultType.MODIFIES : BeanResultType.ADD);
+ List<BeanResult<?>> inlineBeans = new ArrayList<BeanResult<?>>();
// get all the field values from the bean
Set<String> configuredFields = new HashSet<String>();
List<FieldValueObject> fields = new ArrayList<FieldValueObject>();
@@ -136,16 +126,16 @@
// if it is an extend we want to read the annotations from the underlying
// class
- BeanResult<?> result = new BeanResult(getJavaClass(), extend, beanType, fields, inlineBeans);
- AnnotatedTypeBuilder<?> type = result.getBuilder();
- // list of constructor arguments
+ BeanResult<?> result = new BeanResult(getJavaClass(), extend, beanType, fields, inlineBeans, manager);
+
List<ParameterXmlItem> constList = new ArrayList<ParameterXmlItem>();
for (AnnotationXmlItem item : getChildrenOfType(AnnotationXmlItem.class))
{
Annotation a = AnnotationUtils.createAnnotation(item);
- type.addToClass(a);
+ result.addToClass(a);
}
+ // list of constructor arguments
List<ParametersXmlItem> constructorParameters = getChildrenOfType(ParametersXmlItem.class);
if (constructorParameters.size() > 1)
{
@@ -165,7 +155,7 @@
for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
{
Annotation a = AnnotationUtils.createAnnotation(fi);
- type.addToField(item.getField(), a);
+ result.addToField(item.getField(), a);
}
}
else if (!item.getChildrenOfType(AnnotationXmlItem.class).isEmpty())
@@ -180,7 +170,7 @@
for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
{
Annotation a = AnnotationUtils.createAnnotation(fi);
- type.addToMethod(item.getMethod(), a);
+ result.addToMethod(item.getMethod(), a);
}
List<ParametersXmlItem> parameters = item.getChildrenOfType(ParametersXmlItem.class);
if (parameters.size() > 1)
@@ -195,7 +185,7 @@
for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
{
Annotation a = AnnotationUtils.createAnnotation(pan);
- type.addToMethodParameter(item.getMethod(), param, a);
+ result.addToMethodParameter(item.getMethod(), param, a);
}
}
}
@@ -205,18 +195,16 @@
if (!constList.isEmpty())
{
int paramCount = 0;
- Constructor<?> c = resolveConstructor(constList);
+ Constructor<?> constructor = resolveConstructor(constList);
// we automatically add inject to the constructor
- type.addToConstructor((Constructor) c, new AnnotationLiteral<Inject>()
- {
- });
+ result.addToConstructor(constructor, InjectLiteral.INSTANCE);
for (ParameterXmlItem fi : constList)
{
int param = paramCount++;
for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
{
Annotation a = AnnotationUtils.createAnnotation(pan);
- type.addToConstructorParameter((Constructor) c, param, a);
+ result.addToConstructorParameter(constructor, param, a);
}
}
}
@@ -238,7 +226,7 @@
throw new XmlConfigurationException("A virtual producer field may not containe <override> or <extend> tags", getDocument(), getLineno());
}
Field member = org.jboss.seam.xml.util.Reflections.getField(VirtualProducerField.class, "field");
- ClassXmlItem vclass = new ClassXmlItem(null, VirtualProducerField.class, Collections.EMPTY_MAP, document, lineno);
+ ClassXmlItem vclass = new ClassXmlItem(null, VirtualProducerField.class, Collections.<String, String> emptyMap(), document, lineno);
PropertyXmlItem field = new PropertyXmlItem(vclass, Properties.createProperty(member), null, getJavaClass(), document, lineno);
vclass.addChild(field);
for (XmlItem i : this.getChildren())
@@ -247,8 +235,7 @@
}
field.resolveChildren(manager);
BeanResult<?> result = vclass.createBeanResult(manager);
- AnnotatedTypeBuilder<?> builder = result.getBuilder();
- builder.overrideFieldType(member, this.getJavaClass());
+ result.overrideFieldType(member, this.getJavaClass());
return result;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java 2010-10-09 12:33:10 UTC (rev 13817)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java 2010-10-09 22:47:06 UTC (rev 13818)
@@ -202,7 +202,7 @@
return allowed;
}
- public Collection<? extends BeanResult> getInlineBeans()
+ public Collection<? extends BeanResult<?>> getInlineBeans()
{
return inlineBeans;
}
14 years, 2 months
Seam SVN: r13817 - in modules/persistence/trunk: tests and 4 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 08:33:10 -0400 (Sat, 09 Oct 2010)
New Revision: 13817
Added:
modules/persistence/trunk/tests/
modules/persistence/trunk/tests/base/
modules/persistence/trunk/tests/jboss/
modules/persistence/trunk/tests/jetty/
modules/persistence/trunk/tests/openjpa/
Removed:
modules/persistence/trunk/tests-base/
modules/persistence/trunk/tests-jboss/
modules/persistence/trunk/tests-jetty-openjpa/
modules/persistence/trunk/tests-jetty/
Modified:
modules/persistence/trunk/pom.xml
modules/persistence/trunk/tests/base/pom.xml
modules/persistence/trunk/tests/jboss/pom.xml
modules/persistence/trunk/tests/jetty/pom.xml
modules/persistence/trunk/tests/openjpa/pom.xml
Log:
change module structure to move tests to their own directory
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-10-09 10:39:37 UTC (rev 13816)
+++ modules/persistence/trunk/pom.xml 2010-10-09 12:33:10 UTC (rev 13817)
@@ -28,9 +28,9 @@
<modules>
<module>api</module>
<module>impl</module>
- <module>tests-base</module>
- <module>tests-jetty</module>
- <module>tests-jetty-openjpa</module>
+ <module>tests/base</module>
+ <module>tests/jetty</module>
+ <module>tests/openjpa</module>
</modules>
<properties>
@@ -308,21 +308,21 @@
<!-- all tests using managed containers -->
<id>all</id>
<modules>
- <module>tests-jboss</module>
+ <module>tests/jboss</module>
</modules>
</profile>
<profile>
<!-- jboss remote profile-->
<id>jbossas-remote-6</id>
<modules>
- <module>tests-jboss</module>
+ <module>tests/jboss</module>
</modules>
</profile>
<profile>
<!-- jboss managed profile-->
<id>jbossas-managed-6</id>
<modules>
- <module>tests-jboss</module>
+ <module>tests/jboss</module>
</modules>
</profile>
</profiles>
Copied: modules/persistence/trunk/tests/base (from rev 13815, modules/persistence/trunk/tests-base)
Modified: modules/persistence/trunk/tests/base/pom.xml
===================================================================
--- modules/persistence/trunk/tests-base/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
+++ modules/persistence/trunk/tests/base/pom.xml 2010-10-09 12:33:10 UTC (rev 13817)
@@ -4,7 +4,7 @@
<artifactId>seam-persistence-parent</artifactId>
<groupId>org.jboss.seam.persistence</groupId>
<version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Copied: modules/persistence/trunk/tests/jboss (from rev 13815, modules/persistence/trunk/tests-jboss)
Modified: modules/persistence/trunk/tests/jboss/pom.xml
===================================================================
--- modules/persistence/trunk/tests-jboss/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
+++ modules/persistence/trunk/tests/jboss/pom.xml 2010-10-09 12:33:10 UTC (rev 13817)
@@ -4,7 +4,7 @@
<artifactId>seam-persistence-parent</artifactId>
<groupId>org.jboss.seam.persistence</groupId>
<version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Copied: modules/persistence/trunk/tests/jetty (from rev 13815, modules/persistence/trunk/tests-jetty)
Modified: modules/persistence/trunk/tests/jetty/pom.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
+++ modules/persistence/trunk/tests/jetty/pom.xml 2010-10-09 12:33:10 UTC (rev 13817)
@@ -4,7 +4,7 @@
<artifactId>seam-persistence-parent</artifactId>
<groupId>org.jboss.seam.persistence</groupId>
<version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Copied: modules/persistence/trunk/tests/openjpa (from rev 13815, modules/persistence/trunk/tests-jetty-openjpa)
Modified: modules/persistence/trunk/tests/openjpa/pom.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
+++ modules/persistence/trunk/tests/openjpa/pom.xml 2010-10-09 12:33:10 UTC (rev 13817)
@@ -4,7 +4,7 @@
<artifactId>seam-persistence-parent</artifactId>
<groupId>org.jboss.seam.persistence</groupId>
<version>3.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
14 years, 2 months
Seam SVN: r13816 - modules/xml/trunk/docs/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 06:39:37 -0400 (Sat, 09 Oct 2010)
New Revision: 13816
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
Log:
add configuring bean constructors to the docs
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-10-09 09:58:41 UTC (rev 13815)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-10-09 10:39:37 UTC (rev 13816)
@@ -424,8 +424,7 @@
int method(MethodValueBean[] param);
</programlisting>
<para>could be configured via xml using the following:</para>
- <programlisting role="XML">
- <![CDATA[
+ <programlisting role="XML"><![CDATA[
<test:method>
<s:array>
<test:MethodValueBean/>
@@ -434,7 +433,33 @@
]]>
</programlisting>
</section>
-
+ <section>
+ <title>Configuring the bean constructor</title>
+ <para>
+ It is also possible to configure the bean constructor in a similar manner. This is done with a
+ <code><s:parameters></code> element directly on the bean element. The constructor is
+ resolved in the same way methods are resolved. This constructor will automatically have the
+ <code>@Inject</code> annotation applied to it. Annotations can be applied to the constructor
+ parameters in the same manner as method parameters.
+ </para>
+ <programlisting role="XML"><![CDATA[<test:MyBean>
+ <s:parameters>
+ <s:Integer>
+ <test:MyQualifier/>
+ </s:Integer>
+ </s:parameters>
+</test:MyBean>]]></programlisting>
+ <para>
+ The example above is equivilent to the following java:
+ </para>
+ <programlisting role="JAVA">class MyBean {
+ @Inject
+ MyBean(@MyQualifier Integer count)
+ {
+ ...
+ }
+} </programlisting>
+ </section>
<section>
<title>Overriding the type of an injection point</title>
14 years, 2 months
Seam SVN: r13815 - in modules/persistence/trunk: impl/src/main/java/org/jboss/seam/persistence and 24 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-09 05:58:41 -0400 (Sat, 09 Oct 2010)
New Revision: 13815
Added:
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java
modules/persistence/trunk/tests-jetty-openjpa/
modules/persistence/trunk/tests-jetty-openjpa/pom.xml
modules/persistence/trunk/tests-jetty-openjpa/src/
modules/persistence/trunk/tests-jetty-openjpa/src/main/
modules/persistence/trunk/tests-jetty-openjpa/src/main/java/
modules/persistence/trunk/tests-jetty-openjpa/src/main/resources/
modules/persistence/trunk/tests-jetty-openjpa/src/test/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextCreatedEventTest.java
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextELTest.java
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextTest.java
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/JettyTestUtils.java
modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/SeamMetaDataFactory.java
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/orm.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-orm.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-std.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/seam-beans.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans-transaction-interceptor.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/jetty-env.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/web.xml
modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/arquillian.xml
Removed:
modules/persistence/trunk/impl/src/main/resources/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ArtifactNames.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/DontRollBackException.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/HelloService.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/Hotel.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/IndexedHotel.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextObserver.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextFlushModeTest.java
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
modules/persistence/trunk/pom.xml
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/EntityInjectionTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/HibernateSearchTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextCreatedEventTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ArtifactNames.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/DontRollBackException.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/HelloService.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/Hotel.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/IndexedHotel.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextObserver.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/MavenArtifactResolver.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeManagedBean.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionManagedBean.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTestBase.java
modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/UserTransactionTestBase.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JbossHibernateSearchTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionAttributeInterceptorTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionInterceptorTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionScopedTest.java
modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/UserTransactionTest.java
modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-orm.xml
modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-search.xml
modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml
modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml
Log:
Refactor tests and add openjpa tests
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -176,7 +176,7 @@
{
return super.getName(bean, entityManager);
}
- catch (TransientObjectException e)
+ catch (Exception e) // TODO: what should we actually do here
{
return super.getName(bean, entityManager);
}
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -56,6 +56,7 @@
import org.jboss.weld.extensions.literal.AnyLiteral;
import org.jboss.weld.extensions.literal.ApplicationScopedLiteral;
import org.jboss.weld.extensions.literal.DefaultLiteral;
+import org.jboss.weld.extensions.reflection.Reflections;
import org.jboss.weld.extensions.reflection.annotated.AnnotatedTypeBuilder;
import org.jboss.weld.extensions.util.service.ServiceLoader;
import org.slf4j.Logger;
@@ -80,6 +81,32 @@
public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event)
{
+ // we manually add Hibernate first.
+ // we do not use the ServiceLoader approach for this, because it will blow
+ // up if Hibernate is not on the classpath
+ try
+ {
+ Class<?> hibernateProviderClass = Reflections.classForName("org.jboss.seam.persistence.HibernatePersistenceProvider", this.getClass().getClassLoader());
+ SeamPersistenceProvider provider = (SeamPersistenceProvider) hibernateProviderClass.newInstance();
+ persistenceProviders.add(provider);
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.debug("Hibernate not found on class path, HibernatePersistenceProvider not loaded.");
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.debug("Hibernate not found on class path, HibernatePersistenceProvider not loaded.");
+ }
+ catch (InstantiationException e)
+ {
+ log.debug("InstantiationException creating HibernatePersistenceProvider: HibernatePersistenceProvider not loaded.");
+ }
+ catch (IllegalAccessException e)
+ {
+ log.error("IllegalAccessException creating HibernatePersistenceProvider: HibernatePersistenceProvider not loaded.");
+ }
+
ServiceLoader<SeamPersistenceProvider> providers = ServiceLoader.load(SeamPersistenceProvider.class);
for (SeamPersistenceProvider i : providers)
{
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/PersistenceContextsImpl.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -26,7 +26,9 @@
public class PersistenceContextsImpl implements Serializable, PersistenceContexts
{
private static final long serialVersionUID = -4897350516435283182L;
+
private static final Logger log = LoggerFactory.getLogger(PersistenceContextsImpl.class);
+
/**
* persistences contexts are referenced by their qualifiers
*/
Deleted: modules/persistence/trunk/impl/src/main/resources/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider
===================================================================
--- modules/persistence/trunk/impl/src/main/resources/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/impl/src/main/resources/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1 +0,0 @@
-org.jboss.seam.persistence.HibernatePersistenceProvider
\ No newline at end of file
Modified: modules/persistence/trunk/pom.xml
===================================================================
--- modules/persistence/trunk/pom.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -30,6 +30,7 @@
<module>impl</module>
<module>tests-base</module>
<module>tests-jetty</module>
+ <module>tests-jetty-openjpa</module>
</modules>
<properties>
@@ -46,6 +47,7 @@
<jsp.version>2.2</jsp.version>
<weld.version>1.1.0.Beta1</weld.version>
<hsqldb.version>1.8.0.10</hsqldb.version>
+ <openjpa.version>2.0.0</openjpa.version>
</properties>
<dependencyManagement>
@@ -229,6 +231,14 @@
<version>1.0-SP2</version>
</dependency>
+ <!-- Openjpa -->
+
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-all</artifactId>
+ <version>${openjpa.version}</version>
+ </dependency>
+
</dependencies>
</dependencyManagement>
@@ -323,7 +333,7 @@
<email>stuart.w.douglas(a)gmail.com</email>
</developer>
</developers>
-
+
<scm>
<connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/persistence/trunk </connection>
<developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/persistence/trunk </developerConnection>
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/EntityInjectionTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/EntityInjectionTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/EntityInjectionTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -30,11 +30,11 @@
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
import org.junit.Assert;
import org.junit.Test;
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/HibernateSearchTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/HibernateSearchTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/HibernateSearchTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -32,11 +32,11 @@
import org.apache.lucene.queryParser.MultiFieldQueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.hibernate.search.jpa.FullTextEntityManager;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.IndexedHotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.IndexedHotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
import org.junit.Assert;
import org.junit.Test;
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextCreatedEventTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextCreatedEventTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextCreatedEventTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -32,12 +32,12 @@
import junit.framework.Assert;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextObserver;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextObserver;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
import org.junit.Test;
public class ManagedPersistenceContextCreatedEventTestBase
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextELTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -30,11 +30,11 @@
import javax.transaction.SystemException;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextFlushModeTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -38,9 +38,9 @@
import org.jboss.seam.persistence.FlushModeType;
import org.jboss.seam.persistence.ManagedPersistenceContext;
import org.jboss.seam.persistence.PersistenceContexts;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.junit.Test;
public class ManagedPersistenceContextFlushModeTestBase
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/ManagedPersistenceContextTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -33,11 +33,11 @@
import junit.framework.Assert;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.ManagedPersistenceContextProvider;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.ManagedPersistenceContextProvider;
import org.junit.Test;
public class ManagedPersistenceContextTestBase
@@ -72,7 +72,7 @@
transaction.begin();
List<Hotel> hotels = em.createQuery("select h from Hotel h").getResultList();
- Assert.assertTrue(hotels.size() == 1);
+ Assert.assertEquals(1, hotels.size());
transaction.rollback();
}
Copied: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util (from rev 13790, modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util)
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ArtifactNames.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ArtifactNames.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ArtifactNames.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,4 +1,4 @@
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
public class ArtifactNames
{
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/DontRollBackException.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/DontRollBackException.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/DontRollBackException.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,4 +1,4 @@
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
import javax.ejb.ApplicationException;
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import javax.enterprise.inject.Produces;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-public class EntityManagerProvider
-{
- @PersistenceContext
- @Produces
- EntityManager em;
-}
Copied: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java (from rev 13793, modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java)
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java (rev 0)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/EntityManagerProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.util;
+
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+public class EntityManagerProvider
+{
+ @PersistenceContext(unitName = "seamPersistencePu")
+ @Produces
+ EntityManager em;
+}
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/HelloService.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/HelloService.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/HelloService.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
public class HelloService
{
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/Hotel.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/Hotel.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/Hotel.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -51,7 +51,7 @@
@Veto
public class Hotel implements Serializable
{
- private Long id;
+ private int id;
private String name;
private String address;
private String city;
@@ -105,12 +105,12 @@
@Id
@GeneratedValue
- public Long getId()
+ public int getId()
{
return id;
}
- public void setId(final Long id)
+ public void setId(int id)
{
this.id = id;
}
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/IndexedHotel.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/IndexedHotel.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/IndexedHotel.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
import java.io.Serializable;
import java.math.BigDecimal;
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextObserver.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextObserver.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextObserver.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Produces;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnit;
-
-import org.jboss.seam.persistence.SeamManaged;
-
-public class ManagedPersistenceContextProvider
-{
- @PersistenceUnit
- @RequestScoped
- @Produces
- @SeamManaged
- EntityManagerFactory emf;
-}
Copied: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java (from rev 13793, modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java)
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java (rev 0)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/ManagedPersistenceContextProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.util;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+
+import org.jboss.seam.persistence.SeamManaged;
+
+public class ManagedPersistenceContextProvider
+{
+ @PersistenceUnit(unitName = "seamPersistencePu")
+ @RequestScoped
+ @Produces
+ @SeamManaged
+ EntityManagerFactory emf;
+}
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/MavenArtifactResolver.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java 2010-10-04 20:03:56 UTC (rev 13790)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/test/util/MavenArtifactResolver.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,4 +1,4 @@
-package org.jboss.seam.transactions.test.util;
+package org.jboss.seam.persistence.test.util;
import java.io.File;
import java.util.ArrayList;
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeInterceptorTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -35,12 +35,12 @@
import junit.framework.Assert;
+import org.jboss.seam.persistence.test.util.DontRollBackException;
+import org.jboss.seam.persistence.test.util.EntityManagerProvider;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.DontRollBackException;
-import org.jboss.seam.transactions.test.util.EntityManagerProvider;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
import org.junit.Test;
/**
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeManagedBean.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeManagedBean.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionAttributeManagedBean.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -26,8 +26,8 @@
import javax.inject.Inject;
import javax.persistence.EntityManager;
-import org.jboss.seam.transactions.test.util.DontRollBackException;
-import org.jboss.seam.transactions.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.DontRollBackException;
+import org.jboss.seam.persistence.test.util.Hotel;
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class TransactionAttributeManagedBean
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionInterceptorTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -35,12 +35,12 @@
import junit.framework.Assert;
+import org.jboss.seam.persistence.test.util.DontRollBackException;
+import org.jboss.seam.persistence.test.util.EntityManagerProvider;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.DontRollBackException;
-import org.jboss.seam.transactions.test.util.EntityManagerProvider;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
import org.junit.Test;
/**
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionManagedBean.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionManagedBean.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionManagedBean.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,10 +24,10 @@
import javax.inject.Inject;
import javax.persistence.EntityManager;
+import org.jboss.seam.persistence.test.util.DontRollBackException;
+import org.jboss.seam.persistence.test.util.Hotel;
import org.jboss.seam.persistence.transaction.TransactionPropagation;
import org.jboss.seam.persistence.transaction.Transactional;
-import org.jboss.seam.transactions.test.util.DontRollBackException;
-import org.jboss.seam.transactions.test.util.Hotel;
@Transactional(TransactionPropagation.REQUIRED)
public class TransactionManagedBean
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/TransactionScopedTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -32,10 +32,10 @@
import junit.framework.Assert;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
import org.junit.Test;
public class TransactionScopedTestBase
Modified: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/UserTransactionTestBase.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/UserTransactionTestBase.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/persistence/transactions/test/UserTransactionTestBase.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -35,10 +35,10 @@
import junit.framework.Assert;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
import org.jboss.seam.persistence.transaction.DefaultTransaction;
import org.jboss.seam.persistence.transaction.SeamTransaction;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
import org.junit.Test;
import org.junit.runner.RunWith;
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ArtifactNames.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ArtifactNames.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ArtifactNames.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,12 +0,0 @@
-package org.jboss.seam.transactions.test.util;
-
-public class ArtifactNames
-{
- public static final String WELD_EXTENSIONS = "org.jboss.weld:weld-extensions";
- public static final String SEAM_PERSISTENCE_API = "org.jboss.seam.persistence:seam-persistence-api";
- public static final String SEAM_PERSISTENCE_IMPL = "org.jboss.seam.persistence:seam-persistence-impl";
- public static final String HIBERNATE_SEARCH = "org.hibernate:hibernate-search";
- public static final String LUCENE_CORE = "org.apache.lucene:lucene-core";
- public static final String LUCENE_ANALYZERS = "org.apache.lucene:lucene-analyzers";
-
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/DontRollBackException.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/DontRollBackException.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/DontRollBackException.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,9 +0,0 @@
-package org.jboss.seam.transactions.test.util;
-
-import javax.ejb.ApplicationException;
-
-@ApplicationException(rollback = false)
-public class DontRollBackException extends Exception
-{
-
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/EntityManagerProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import javax.enterprise.inject.Produces;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-
-public class EntityManagerProvider
-{
- @PersistenceContext(unitName = "seamPersistencePu")
- @Produces
- EntityManager em;
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/HelloService.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/HelloService.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/HelloService.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-public class HelloService
-{
- public String sayHello()
- {
- return "Hello";
- }
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/Hotel.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/Hotel.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/Hotel.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-import javax.inject.Inject;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-import org.jboss.weld.extensions.core.Veto;
-
-/**
- * <p>
- * <strong>Hotel</strong> is the model/entity class that represents a hotel.
- * </p>
- *
- * @author Gavin King
- * @author Dan Allen
- */
-@Entity
-@Table(name = "hotel")
-@Veto
-public class Hotel implements Serializable
-{
- private Long id;
- private String name;
- private String address;
- private String city;
- private String state;
- private String zip;
- private String country;
- private Integer stars;
- private BigDecimal price;
-
- @Inject
- private HelloService helloService;
-
- private boolean initalizerCalled = false;
-
- public Hotel()
- {
- }
-
- @Inject
- public void create()
- {
- initalizerCalled = true;
- }
-
- public String sayHello()
- {
- return helloService.sayHello();
- }
-
- public Hotel(final String name, final String address, final String city, final String state, final String zip, final String country)
- {
- this.name = name;
- this.address = address;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- }
-
- public Hotel(final int price, final int stars, final String name, final String address, final String city, final String state, final String zip, final String country)
- {
- this.price = new BigDecimal(price);
- this.stars = stars;
- this.name = name;
- this.address = address;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- }
-
- @Id
- @GeneratedValue
- public Long getId()
- {
- return id;
- }
-
- public void setId(final Long id)
- {
- this.id = id;
- }
-
- @Size(max = 50)
- @NotNull
- public String getName()
- {
- return name;
- }
-
- public void setName(final String name)
- {
- this.name = name;
- }
-
- @Size(max = 100)
- @NotNull
- public String getAddress()
- {
- return address;
- }
-
- public void setAddress(final String address)
- {
- this.address = address;
- }
-
- @Size(max = 40)
- @NotNull
- public String getCity()
- {
- return city;
- }
-
- public void setCity(final String city)
- {
- this.city = city;
- }
-
- @Size(min = 3, max = 6)
- @NotNull
- public String getZip()
- {
- return zip;
- }
-
- public void setZip(final String zip)
- {
- this.zip = zip;
- }
-
- @Size(min = 2, max = 10)
- public String getState()
- {
- return state;
- }
-
- public void setState(final String state)
- {
- this.state = state;
- }
-
- @Size(min = 2, max = 40)
- @NotNull
- public String getCountry()
- {
- return country;
- }
-
- public void setCountry(final String country)
- {
- this.country = country;
- }
-
- @Min(1)
- @Max(5)
- public Integer getStars()
- {
- return stars;
- }
-
- public void setStars(final Integer stars)
- {
- this.stars = stars;
- }
-
- @Column(precision = 6, scale = 2)
- public BigDecimal getPrice()
- {
- return price;
- }
-
- public void setPrice(final BigDecimal price)
- {
- this.price = price;
- }
-
- @Transient
- public String getLocation()
- {
- return city + ", " + state + ", " + country;
- }
-
- @Override
- public String toString()
- {
- return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
- }
-
- @Transient
- public boolean isInitalizerCalled()
- {
- return initalizerCalled;
- }
-
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/IndexedHotel.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/IndexedHotel.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/IndexedHotel.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-import javax.inject.Inject;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-import org.hibernate.search.annotations.Field;
-import org.hibernate.search.annotations.Index;
-import org.hibernate.search.annotations.Indexed;
-import org.hibernate.search.annotations.Store;
-import org.jboss.weld.extensions.core.Veto;
-
-/**
- * <p>
- * <strong>Hotel</strong> is the model/entity class that represents a hotel.
- * </p>
- *
- * @author Gavin King
- * @author Dan Allen
- */
-@Entity
-@Table(name = "hotel")
-@Indexed
-@Veto
-public class IndexedHotel implements Serializable
-{
- private Long id;
- private String name;
- private String address;
- private String city;
- private String state;
- private String zip;
- private String country;
- private Integer stars;
- private BigDecimal price;
-
- @Inject
- private HelloService helloService;
-
- private boolean initalizerCalled = false;
-
- public IndexedHotel()
- {
- }
-
- @Inject
- public void create()
- {
- initalizerCalled = true;
- }
-
- public String sayHello()
- {
- return helloService.sayHello();
- }
-
- public IndexedHotel(final String name, final String address, final String city, final String state, final String zip, final String country)
- {
- this.name = name;
- this.address = address;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- }
-
- public IndexedHotel(final int price, final int stars, final String name, final String address, final String city, final String state, final String zip, final String country)
- {
- this.price = new BigDecimal(price);
- this.stars = stars;
- this.name = name;
- this.address = address;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- }
-
- @Id
- @GeneratedValue
- public Long getId()
- {
- return id;
- }
-
- public void setId(final Long id)
- {
- this.id = id;
- }
-
- @Size(max = 50)
- @NotNull
- @Field(index = Index.TOKENIZED, store = Store.NO)
- public String getName()
- {
- return name;
- }
-
- public void setName(final String name)
- {
- this.name = name;
- }
-
- @Size(max = 100)
- @NotNull
- public String getAddress()
- {
- return address;
- }
-
- public void setAddress(final String address)
- {
- this.address = address;
- }
-
- @Size(max = 40)
- @NotNull
- public String getCity()
- {
- return city;
- }
-
- public void setCity(final String city)
- {
- this.city = city;
- }
-
- @Size(min = 3, max = 6)
- @NotNull
- public String getZip()
- {
- return zip;
- }
-
- public void setZip(final String zip)
- {
- this.zip = zip;
- }
-
- @Size(min = 2, max = 10)
- public String getState()
- {
- return state;
- }
-
- public void setState(final String state)
- {
- this.state = state;
- }
-
- @Size(min = 2, max = 40)
- @NotNull
- public String getCountry()
- {
- return country;
- }
-
- public void setCountry(final String country)
- {
- this.country = country;
- }
-
- @Min(1)
- @Max(5)
- public Integer getStars()
- {
- return stars;
- }
-
- public void setStars(final Integer stars)
- {
- this.stars = stars;
- }
-
- @Column(precision = 6, scale = 2)
- public BigDecimal getPrice()
- {
- return price;
- }
-
- public void setPrice(final BigDecimal price)
- {
- this.price = price;
- }
-
- @Transient
- public String getLocation()
- {
- return city + ", " + state + ", " + country;
- }
-
- @Override
- public String toString()
- {
- return "Hotel(" + name + "," + address + "," + city + "," + zip + ")";
- }
-
- @Transient
- public boolean isInitalizerCalled()
- {
- return initalizerCalled;
- }
-
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextObserver.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextObserver.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextObserver.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Default;
-import javax.persistence.FlushModeType;
-
-import org.jboss.seam.persistence.SeamManagedPersistenceContextCreated;
-
-@ApplicationScoped
-public class ManagedPersistenceContextObserver
-{
- private boolean observerRun = false;
-
- public void observe(@Observes @Default SeamManagedPersistenceContextCreated event)
- {
- observerRun = true;
- event.getEntityManager().setFlushMode(FlushModeType.COMMIT);
- }
-
- public boolean isObserverRun()
- {
- return observerRun;
- }
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/ManagedPersistenceContextProvider.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.transactions.test.util;
-
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Produces;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnit;
-
-import org.jboss.seam.persistence.SeamManaged;
-
-public class ManagedPersistenceContextProvider
-{
- @PersistenceUnit(unitName = "seamPersistencePu")
- @RequestScoped
- @Produces
- @SeamManaged
- EntityManagerFactory emf;
-}
Deleted: modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java
===================================================================
--- modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-base/src/main/java/org/jboss/seam/transactions/test/util/MavenArtifactResolver.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,164 +0,0 @@
-package org.jboss.seam.transactions.test.util;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resolves a maven artifact present on the test classpath.
- *
- * @author Stuart Douglas
- *
- */
-public class MavenArtifactResolver
-{
-
- public static File resolve(String groupId, String artifactId)
- {
- if (groupId == null)
- {
- throw new IllegalArgumentException("groupId cannot be null");
- }
- if (artifactId == null)
- {
- throw new IllegalArgumentException("artifactId cannot be null");
- }
- String path = new MavenArtifactResolver(groupId.trim(), artifactId.trim(), System.getProperty("java.class.path"), File.pathSeparatorChar, File.separatorChar).resolve();
- if (path == null)
- {
- throw new IllegalArgumentException("Cannot locate artifact for " + groupId + ":" + artifactId);
- }
- return new File(path);
- }
-
- public static File resolve(String qualifiedArtifactId)
- {
- String[] segments = qualifiedArtifactId.split(":");
- if (segments.length == 2)
- {
- return resolve(segments[0], segments[1]);
- }
- else
- {
- throw new IllegalArgumentException("Unable to parse " + qualifiedArtifactId + " as a groupId:artifactId");
- }
- }
-
- private final String classPathSeparatorRegex;
- private final char fileSeparator;
- private final String groupId;
- private final String artifactId;
- private final String classPath;
-
- MavenArtifactResolver(String groupId, String artifactId, String classPath, char pathSeparator, char fileSeparator)
- {
- this.groupId = groupId;
- this.artifactId = artifactId;
- this.classPath = classPath;
- this.classPathSeparatorRegex = "[^" + pathSeparator + "]*";
- this.fileSeparator = fileSeparator;
- }
-
- String resolve()
- {
- Matcher matches = createFullyQualifiedMatcher();
- if (!matches.find())
- {
- matches = createUnqualifiedMatcher();
- if (!matches.find())
- {
- matches = createTargetClassesMatcher();
- if (!matches.find())
- {
- return null;
- }
- else
- {
- String fileName = scanForArtifact(matches);
- if (fileName == null)
- {
- return null;
- }
- else
- {
- return fileName;
- }
- }
- }
- }
- return matches.group(0);
- }
-
- private String scanForArtifact(Matcher targetClassesMatcher)
- {
- // Locate all target/classes in classpath and store the path to all files target/
- List<String> paths = new ArrayList<String>();
- do
- {
- String path = targetClassesMatcher.group();
- File target = new File(path.substring(0, path.length() - 8));
- if (target.exists())
- {
- if (!target.isDirectory())
- {
- throw new IllegalStateException("Found ${project.dir}/target/ but it is not a directory!");
- }
- for (File file : target.listFiles())
- {
- paths.add(file.getPath());
- }
- }
- }
- while (targetClassesMatcher.find());
- return scanForArtifact(paths);
- }
-
- String scanForArtifact(List<String> paths)
- {
- Pattern pattern = Pattern.compile(artifactId + "-[\\d+\\.]+(?:[\\-\\.]\\p{Alpha}*)?.jar$");
- for (String path : paths)
- {
- if (pattern.matcher(path).find())
- {
- return path;
- }
- }
- return null;
- }
-
- /**
- * Creates a matcher that returns any fully qualified matches of the form
- * <code>com/acme/acme-core/1.0/acme-core-1.0.jar</code>. This will match
- * artifacts on the classpath from the Maven repo.
- */
- private Matcher createFullyQualifiedMatcher()
- {
- String pathString = groupId.replace('.', fileSeparator) + fileSeparator + artifactId;
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote(pathString) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-
- /**
- * Creates a matcher that returns any unqualified matches of the form
- * <code>target/acme-foo-1.0.jar</code>. This will match artifacts on the
- * classpath from the reactor.
- */
- private Matcher createUnqualifiedMatcher()
- {
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + artifactId) + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-
- /**
- * Creates a matcher that returns any unqualified matches of the form
- * <code>target/acme-foo-1.0.jar</code>. This locates all
- *
- */
- private Matcher createTargetClassesMatcher()
- {
- Pattern p = Pattern.compile(classPathSeparatorRegex + Pattern.quote("target" + fileSeparator + "classes") + classPathSeparatorRegex, Pattern.CASE_INSENSITIVE);
- return p.matcher(classPath);
- }
-}
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/EntityInjectionTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,8 +24,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.EntityInjectionTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JNDIManagedPersistenceContextTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,11 +24,11 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.HelloService;
+import org.jboss.seam.persistence.test.util.Hotel;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.transaction.test.util.JNDIManagedPersistenceContextProvider;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.HelloService;
-import org.jboss.seam.transactions.test.util.Hotel;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JbossHibernateSearchTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JbossHibernateSearchTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/JbossHibernateSearchTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,8 +24,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.HibernateSearchTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
@@ -49,7 +49,6 @@
war.addWebResource("META-INF/persistence-search.xml", "classes/META-INF/persistence.xml");
war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
war.addWebResource("META-INF/services/javax.enterprise.inject.spi.Extension", "classes/META-INF/services/javax.enterprise.inject.spi.Extension");
- war.addWebResource("META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider", "classes/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider");
return war;
}
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextCreatedEventTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,8 +24,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextCreatedEventTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextELTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,8 +24,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextELTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Deleted: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextFlushModeTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextFlushModeTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextFlushModeTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.persistence.test.jboss;
-
-import org.jboss.arquillian.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.persistence.test.ManagedPersistenceContextFlushModeTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.runner.RunWith;
-
-(a)RunWith(Arquillian.class)
-public class ManagedPersistenceContextFlushModeTest extends ManagedPersistenceContextFlushModeTestBase
-{
- @Deployment
- public static Archive<?> createTestArchive()
- {
- WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
- war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.WELD_EXTENSIONS));
- war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_API));
- war.addLibraries(MavenArtifactResolver.resolve(ArtifactNames.SEAM_PERSISTENCE_IMPL));
- war.addClasses(getTestClasses());
- war.addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
- war.addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
- war.addWebResource("META-INF/services/javax.enterprise.inject.spi.Extension", "classes/META-INF/services/javax.enterprise.inject.spi.Extension");
- war.addWebResource("META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider", "classes/META-INF/services/org.jboss.seam.persistence.SeamPersistenceProvider");
- return war;
- }
-}
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/test/jboss/ManagedPersistenceContextTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -24,8 +24,8 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionAttributeInterceptorTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionAttributeInterceptorTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionAttributeInterceptorTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -23,10 +23,10 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.transaction.TransactionInterceptor;
import org.jboss.seam.persistence.transactions.test.TransactionAttributeInterceptorTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionInterceptorTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionInterceptorTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionInterceptorTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -23,10 +23,10 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.transaction.TransactionInterceptor;
import org.jboss.seam.persistence.transactions.test.TransactionInterceptorTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionScopedTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionScopedTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/TransactionScopedTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -2,9 +2,9 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.transactions.test.TransactionScopedTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/UserTransactionTest.java
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/UserTransactionTest.java 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/java/org/jboss/seam/persistence/transaction/test/jboss/UserTransactionTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -2,9 +2,9 @@
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.util.ArtifactNames;
+import org.jboss.seam.persistence.test.util.MavenArtifactResolver;
import org.jboss.seam.persistence.transactions.test.UserTransactionTestBase;
-import org.jboss.seam.transactions.test.util.ArtifactNames;
-import org.jboss.seam.transactions.test.util.MavenArtifactResolver;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
Modified: modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-orm.xml
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-orm.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-orm.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -10,7 +10,7 @@
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<mapping-file>META-INF/orm.xml</mapping-file>
- <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes/>
<properties>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
Modified: modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-search.xml
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-search.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence-search.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -6,7 +6,7 @@
<persistence-unit name="seamPersistencePu">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
- <class>org.jboss.seam.transactions.test.util.IndexedHotel</class>
+ <class>org.jboss.seam.persistence.test.util.IndexedHotel</class>
<exclude-unlisted-classes/>
<properties>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
Modified: modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence.xml
===================================================================
--- modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jboss/src/test/resources/META-INF/persistence.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -9,7 +9,7 @@
-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
- <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes/>
<properties>
<!-- Properties for Hibernate (default provider for JBoss AS) -->
Modified: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-orm.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -6,7 +6,7 @@
<persistence-unit name="seamPersistencePu" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>META-INF/orm.xml</mapping-file>
- <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes />
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
Modified: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-search.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -5,7 +5,7 @@
version="2.0">
<persistence-unit name="seamPersistencePu" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>org.jboss.seam.transactions.test.util.IndexedHotel</class>
+ <class>org.jboss.seam.persistence.test.util.IndexedHotel</class>
<exclude-unlisted-classes />
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
Modified: modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml
===================================================================
--- modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml 2010-10-08 11:02:31 UTC (rev 13814)
+++ modules/persistence/trunk/tests-jetty/src/test/resources/META-INF/persistence-std.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -10,7 +10,7 @@
-->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <class>org.jboss.seam.persistence.test.util.Hotel</class>
<exclude-unlisted-classes />
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
@@ -18,7 +18,7 @@
<property name="javax.persistence.jdbc.password" value="" />
<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
-
+ <property name="hibernate.show_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
Property changes on: modules/persistence/trunk/tests-jetty-openjpa
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
.classpath
Added: modules/persistence/trunk/tests-jetty-openjpa/pom.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/pom.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/pom.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,198 @@
+<project 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/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>seam-persistence-parent</artifactId>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-tests-jetty-openjpa</artifactId>
+ <packaging>jar</packaging>
+ <version>3.0.0-SNAPSHOT</version>
+ <name>Seam Persistence Openjpa Jetty Tests</name>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-all</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.interceptor</groupId>
+ <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-config</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-extensions</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.persistence</groupId>
+ <artifactId>seam-persistence-tests-base</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.container</groupId>
+ <artifactId>arquillian-jetty-embedded-7</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- plus and naming requires for using JNDI -->
+
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Weld servlet, EL and JSP required for testing CDI injections -->
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <forkMode>pertest</forkMode>
+ <argLine>-javaagent:${settings.localRepository}/org/apache/openjpa/openjpa-all/2.0.0/openjpa-all-2.0.0.jar=scanDevPath=true</argLine>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/persistence/trunk/tes...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/persistence/trunk/tests-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Seam/modules/persistence/trunk/tests-weld-se</url>
+ </scm>
+
+</project>
+
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextCreatedEventTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextCreatedEventTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextCreatedEventTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.openjpa;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextCreatedEventTestBase;
+import org.jboss.seam.persistence.test.openjpa.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ManagedPersistenceContextCreatedEventTest extends ManagedPersistenceContextCreatedEventTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextELTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextELTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextELTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.openjpa;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextELTestBase;
+import org.jboss.seam.persistence.test.openjpa.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ManagedPersistenceContextELTest extends ManagedPersistenceContextELTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextTest.java
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextTest.java (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/ManagedPersistenceContextTest.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.openjpa;
+
+import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.persistence.test.ManagedPersistenceContextTestBase;
+import org.jboss.seam.persistence.test.openjpa.util.JettyTestUtils;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ManagedPersistenceContextTest extends ManagedPersistenceContextTestBase
+{
+ @Deployment
+ public static Archive<?> createTestArchive()
+ {
+ WebArchive war = JettyTestUtils.createTestArchive();
+ war.addWebResource("WEB-INF/beans.xml", "beans.xml");
+ war.addWebResource("META-INF/persistence-std.xml", "classes/META-INF/persistence.xml");
+ war.addClasses(getTestClasses());
+ return war;
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/JettyTestUtils.java
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/JettyTestUtils.java (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/JettyTestUtils.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.persistence.test.openjpa.util;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+/**
+ *
+ * @author Stuart Douglas
+ *
+ */
+public class JettyTestUtils
+{
+ public static WebArchive createTestArchive()
+ {
+ WebArchive war = ShrinkWrap.createDomain().getArchiveFactory().create(WebArchive.class, "test.war");
+ war.addResource("META-INF/seam-beans.xml", "seam-beans.xml");
+ war.addWebResource("WEB-INF/jetty-env.xml", "jetty-env.xml");
+ war.addWebResource("WEB-INF/web.xml", "web.xml");
+ return war;
+ }
+}
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/SeamMetaDataFactory.java
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/SeamMetaDataFactory.java (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/java/org/jboss/seam/persistence/test/openjpa/util/SeamMetaDataFactory.java 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,16 @@
+package org.jboss.seam.persistence.test.openjpa.util;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.openjpa.persistence.PersistenceMetaDataFactory;
+
+public class SeamMetaDataFactory extends PersistenceMetaDataFactory
+{
+
+ public Set<String> getPersistentTypeNames(boolean arg0, ClassLoader arg1)
+ {
+ return Collections.singleton("org.jboss.seam.persistence.test.util.Hotel");
+ }
+
+}
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/orm.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/orm.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/orm.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0"
+ >
+ <persistence-unit-metadata >
+ <persistence-unit-defaults >
+ <entity-listeners>
+ <entity-listener class="org.jboss.seam.persistence.InjectionEventListener" >
+ <post-load method-name="load" />
+ </entity-listener>
+ </entity-listeners>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+
+</entity-mappings>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-orm.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-orm.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-orm.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="seamPersistencePu" transaction-type="RESOURCE_LOCAL">
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <mapping-file>META-INF/orm.xml</mapping-file>
+ <class>org.jboss.seam.transactions.test.util.Hotel</class>
+ <exclude-unlisted-classes />
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value="" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
+ <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-std.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-std.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/persistence-std.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="seamPersistencePu"
+ transaction-type="RESOURCE_LOCAL">
+
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+
+ <exclude-unlisted-classes />
+ <properties>
+ <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+ <property name="javax.persistence.jdbc.user" value="sa" />
+ <property name="javax.persistence.jdbc.password" value="" />
+ <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:." />
+ <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>
+ <property name="openjpa.MetaDataFactory" value="org.jboss.seam.persistence.test.openjpa.util.SeamMetaDataFactory"/>
+ <property name="openjpa.Sequence" value="org.apache.openjpa.jdbc.kernel.NativeJDBCSeq"/>
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='add,deleteTableContents', ForeignKeys=true)"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/seam-beans.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/seam-beans.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/META-INF/seam-beans.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+
+ <t:EntityTransaction>
+ <s:modifies />
+ </t:EntityTransaction>
+
+ <t:SeSynchronizations>
+ <s:modifies/>
+ </t:SeSynchronizations>
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans-transaction-interceptor.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans-transaction-interceptor.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans-transaction-interceptor.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+ <interceptors>
+ <class>org.jboss.seam.persistence.transaction.TransactionInterceptor</class>
+ </interceptors>
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/beans.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:s="urn:java:ee"
+ xmlns:t="urn:java:org.jboss.seam.persistence.transaction"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://docs.jboss.org/cdi/beans_1_0.xsd">
+
+</beans>
\ No newline at end of file
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/jetty-env.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/jetty-env.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/jetty-env.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,15 @@
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
+ "http://jetty.mortbay.org/configure.dtd">
+<Configure id="webAppCtx" class="org.eclipse.jetty.webapp.WebAppContext">
+ <New id="BeanManager" class="org.eclipse.jetty.plus.jndi.Resource">
+ <Arg><Ref id="webAppCtx"/></Arg>
+ <Arg>BeanManager</Arg>
+ <Arg>
+ <New class="javax.naming.Reference">
+ <Arg>javax.enterprise.inject.spi.BeanManager</Arg>
+ <Arg>org.jboss.weld.resources.ManagerObjectFactory</Arg>
+ <Arg/>
+ </New>
+ </Arg>
+ </New>
+</Configure>
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/web.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/web.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/WEB-INF/web.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <env-entry>
+ <env-entry-name>name</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Jetty</env-entry-value>
+ </env-entry>
+
+ <!-- Should be overridden by jetty-env.xml -->
+ <env-entry>
+ <env-entry-name>type</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>Remote</env-entry-value>
+ </env-entry>
+
+ <listener>
+ <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+
+ <resource-env-ref>
+ <resource-env-ref-name>BeanManager</resource-env-ref-name>
+ <resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
+ </resource-env-ref>
+
+</web-app>
Added: modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/arquillian.xml
===================================================================
--- modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/arquillian.xml (rev 0)
+++ modules/persistence/trunk/tests-jetty-openjpa/src/test/resources/arquillian.xml 2010-10-09 09:58:41 UTC (rev 13815)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns="http://jboss.com/arquillian"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <engine>
+ <deploymentExportPath>/tmp/</deploymentExportPath>
+ </engine>
+
+</arquillian>
14 years, 2 months
Seam SVN: r13814 - branches/enterprise/JBPAPP_5_0/examples/seambay/view.
by seam-commits@lists.jboss.org
Author: mgencur(a)redhat.com
Date: 2010-10-08 07:02:31 -0400 (Fri, 08 Oct 2010)
New Revision: 13814
Modified:
branches/enterprise/JBPAPP_5_0/examples/seambay/view/test.js
Log:
JBPAPP-5056 fixed reading of node name for IE
Modified: branches/enterprise/JBPAPP_5_0/examples/seambay/view/test.js
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/seambay/view/test.js 2010-10-07 20:50:28 UTC (rev 13813)
+++ branches/enterprise/JBPAPP_5_0/examples/seambay/view/test.js 2010-10-08 11:02:31 UTC (rev 13814)
@@ -327,7 +327,7 @@
for (var i = 0; i < doc.documentElement.childNodes.length; i++)
{
var node = doc.documentElement.childNodes.item(i);
- if (node.localName == "Header")
+ if (node.nodeName == "env:Header")
headerNode = node;
}
}
@@ -337,7 +337,7 @@
for (var i = 0; i < headerNode.childNodes.length; i++)
{
var node = headerNode.childNodes.item(i);
- if (node.localName == "conversationId")
+ if (node.nodeName == "seam:conversationId")
{
return node.firstChild.nodeValue;
}
14 years, 2 months
Seam SVN: r13813 - modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-10-07 16:50:28 -0400 (Thu, 07 Oct 2010)
New Revision: 13813
Modified:
modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
Log:
SEAMPERSIST-8 backport hibernate search fixes from seam 2
Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-10-07 15:23:09 UTC (rev 13812)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-10-07 20:50:28 UTC (rev 13813)
@@ -37,18 +37,17 @@
{
try
{
- String version = null;
+ boolean hibernateSearchPresent = false;
try
{
- Class<?> searchVersionClass = Reflections.classForName("org.hibernate.search.Version");
- Method versionMethod = searchVersionClass.getDeclaredMethod("getVersionString");
- version = (String) versionMethod.invoke(null);
+ Reflections.classForName("org.hibernate.search.Version");
+ hibernateSearchPresent = true;
}
catch (Exception e)
{
log.debug("no Hibernate Search", e);
}
- if (version != null)
+ if (hibernateSearchPresent)
{
Class<?> searchClass = Reflections.classForName("org.hibernate.search.Search");
try
@@ -202,12 +201,16 @@
*/
static Session proxySession(Session session)
{
- if (FULL_TEXT_SESSION_CONSTRUCTOR == null)
+ if (FULL_TEXT_SESSION_CONSTRUCTOR == null || FULL_TEXT_SESSION == null)
{
return session;
}
else
{
+ if (FULL_TEXT_SESSION.isAssignableFrom(session.getClass()))
+ {
+ return session;
+ }
try
{
return (Session) FULL_TEXT_SESSION_CONSTRUCTOR.invoke(null, session);
14 years, 2 months