Seam SVN: r13660 - in modules/xml/trunk: impl and 8 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-08-27 20:25:27 -0400 (Fri, 27 Aug 2010)
New Revision: 13660
Removed:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/annotations/internal/
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlProcessAnnotatedType.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/GenericBeanResult.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/generic/
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/generic/
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
modules/xml/trunk/impl/pom.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/XmlResult.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java
Log:
remove generic beans, they are being replaced by weld-extensions generic beans instead
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-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-08-28 00:25:27 UTC (rev 13660)
@@ -520,37 +520,7 @@
</programlisting>
</section>
-
<section>
- <title>Generic Beans</title>
- <para>Gereric beans allow for multiple beans to be created from a single bean definition. They are
- designed for use by framework writers. From the users perspective there is no
- special configuration required, if you configure a bean that a framework writer has marked as a generic
- bean then you will end up with multiple beans instead.</para>
- <para>Generic beans are configured using the syntax described above. For every bean that the user
- configures, a corresponding bean from the generic bean declaration is created. For example in the
- framework xml configuration:</para>
-<programlisting role="XML" >
- <![CDATA[
-<s:genericBean class="org.jboss.seam.xml.test.generic.GenericMain" >
- <test:GenericDependant>
- <s:ApplyQualifiers/>
- <s:modifies/>
- <test:instance>
- <s:ApplyQualifiers/>
- </test:instance>
- </test:GenericDependant>
-</s:genericBean>
-]]>
- </programlisting>
- <para>The declaration above means that for every <literal>GenericMain</literal> that a user configures via xml
- a corresponding <literal>GenericDependant</literal> is created as well. The
- <literal><s:ApplyQualifiers /></literal> is replaced with the qualifiers that are present on the user
- configured bean.</para>
- </section>
-
-
- <section>
<title>More Information</title>
<para>For further information look at the units tests in the seam-xml distribution, also the
JSR-299 Public Review Draft section on XML Configuration was the base for this extension,
Modified: modules/xml/trunk/impl/pom.xml
===================================================================
--- modules/xml/trunk/impl/pom.xml 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/pom.xml 2010-08-28 00:25:27 UTC (rev 13660)
@@ -20,6 +20,7 @@
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
+ <version>1.0-SP2</version>
</dependency>
<dependency>
@@ -30,13 +31,14 @@
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-se</artifactId>
- <version>1.0.1-Final</version>
+ <groupId>org.jboss.weld.se</groupId>
+ <artifactId>weld-se-core</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
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-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -22,7 +22,6 @@
package org.jboss.seam.xml.bootstrap;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -50,10 +49,7 @@
import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Named;
-import org.jboss.seam.xml.annotations.internal.ApplyQualifiers;
import org.jboss.seam.xml.core.BeanResult;
-import org.jboss.seam.xml.core.BeanResultType;
-import org.jboss.seam.xml.core.GenericBeanResult;
import org.jboss.seam.xml.core.XmlConfiguredBean;
import org.jboss.seam.xml.core.XmlId;
import org.jboss.seam.xml.core.XmlResult;
@@ -65,8 +61,6 @@
import org.jboss.seam.xml.util.FileDataReader;
import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
import org.jboss.weld.extensions.core.Exact;
-import org.jboss.weld.extensions.core.Veto;
-import org.jboss.weld.extensions.literal.DefaultLiteral;
import org.jboss.weld.extensions.util.AnnotationInstanceProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -93,8 +87,6 @@
List<Exception> errors = new ArrayList<Exception>();
- Map<Class<?>, GenericBeanResult> genericBeans = new HashMap<Class<?>, GenericBeanResult>();
-
/**
* This is the entry point for the extension
*/
@@ -128,11 +120,6 @@
// build the generic bean data
for (XmlResult r : results)
{
- for (GenericBeanResult b : r.getGenericBeans())
- {
- genericBeans.put(b.getGenericBean(), b);
- }
-
// add the qualifiers as we need them before we process the generic
// bean info
for (Class<? extends Annotation> b : r.getQualifiers())
@@ -176,24 +163,6 @@
}
for (BeanResult<?> bb : r.getFlattenedBeans())
{
- GenericBeanResult found = null;
- for (Class<?> g : genericBeans.keySet())
- {
- if (g.isAssignableFrom(bb.getType()))
- {
- found = genericBeans.get(g);
- break;
- }
- }
- if (found != null)
- {
- List<AnnotatedType<?>> types = processGenericBeans(bb, found, beanManager);
- for (AnnotatedType<?> i : types)
- {
- event.addAnnotatedType(i);
- }
- }
-
bb.getBuilder().addToClass(new AnnotationLiteral<XmlConfiguredBean>()
{
});
@@ -282,134 +251,6 @@
return ret;
}
- /**
- * installs a set of secondary beans for a given generic bean, the secondary
- * beans have the same qualifiers added to them as the generic bean, in
- * addition the generic beans qualifiers are added whereever the
- * ApplyQualiers annotation is found
- *
- */
- public List<AnnotatedType<?>> processGenericBeans(BeanResult<?> bean, GenericBeanResult genericBeans, BeanManager beanManager)
- {
- List<AnnotatedType<?>> ret = new ArrayList<AnnotatedType<?>>();
- AnnotatedType<?> rootType = bean.getBuilder().create();
- // ret.add(rootType);
- Set<Annotation> qualifiers = new HashSet<Annotation>();
-
- for (Annotation i : rootType.getAnnotations())
- {
- if (beanManager.isQualifier(i.annotationType()))
- {
- qualifiers.add(i);
- }
- }
- for (BeanResult<?> c : genericBeans.getSecondaryBeans())
- {
-
- AnnotatedType<?> type = c.getBuilder().create();
- AnnotatedTypeBuilder<?> gb = new AnnotatedTypeBuilder().setJavaClass(type.getJavaClass());
- if (c.getBeanType() == BeanResultType.MODIFIES)
- {
- gb.readFromType((Class) type.getJavaClass());
- // we don't want to keep the veto annotation on the class
- gb.removeFromClass(Veto.class);
- }
- // if the original type was qualified @Default we add that as well
- if (!isQualifierPresent(type, beanManager))
- {
- gb.addToClass(DefaultLiteral.INSTANCE);
- }
- // we always apply qualifiers to the actual type
- for (Annotation q : qualifiers)
- {
- gb.addToClass(q);
- }
- for (AnnotatedField<?> f : type.getFields())
- {
- if (f.isAnnotationPresent(ApplyQualifiers.class))
- {
- // we need to manually add @default as it stops being applied
- // when
- // we add our qualifiers, however if we are deling with the main
- // type we do not
- // bother, as it should not be qualified @Default
- if (!isQualifierPresent(f, beanManager) && f.getJavaMember().getType() != rootType.getJavaClass())
- {
- gb.addToField(f.getJavaMember(), DefaultLiteral.INSTANCE);
- }
- for (Annotation q : qualifiers)
- {
- gb.addToField(f.getJavaMember(), q);
- }
- }
- }
- for (AnnotatedMethod<?> m : type.getMethods())
- {
-
- if (m.isAnnotationPresent(ApplyQualifiers.class))
- {
- if (!isQualifierPresent(m, beanManager))
- {
- gb.addToMethod(m.getJavaMember(), DefaultLiteral.INSTANCE);
- }
- for (Annotation q : qualifiers)
- {
- gb.addToMethod(m.getJavaMember(), q);
- }
- }
-
- for (AnnotatedParameter<?> p : m.getParameters())
- {
-
- if (p.isAnnotationPresent(ApplyQualifiers.class))
- {
- if (!isQualifierPresent(p, beanManager) && p.getBaseType() != rootType.getJavaClass())
- {
- gb.addToMethodParameter(m.getJavaMember(), p.getPosition(), DefaultLiteral.INSTANCE);
- }
- for (Annotation q : qualifiers)
- {
- gb.addToMethodParameter(m.getJavaMember(), p.getPosition(), q);
- }
- }
- }
- }
-
- for (AnnotatedConstructor<?> con : type.getConstructors())
- {
- if (con.isAnnotationPresent(ApplyQualifiers.class))
- {
- if (!isQualifierPresent(con, beanManager))
- {
- gb.addToConstructor((Constructor) con.getJavaMember(), DefaultLiteral.INSTANCE);
- }
- for (Annotation q : qualifiers)
- {
- gb.addToConstructor((Constructor) con.getJavaMember(), q);
- }
- }
-
- for (AnnotatedParameter<?> p : con.getParameters())
- {
- if (p.isAnnotationPresent(ApplyQualifiers.class) && p.getBaseType() != rootType.getJavaClass())
- {
- if (!isQualifierPresent(p, beanManager))
- {
- gb.addToConstructorParameter((Constructor) con.getJavaMember(), p.getPosition(), DefaultLiteral.INSTANCE);
- }
- for (Annotation q : qualifiers)
- {
- gb.addToConstructorParameter((Constructor) con.getJavaMember(), p.getPosition(), q);
- }
- }
- }
- }
-
- ret.add(fixExactSupport(gb).create());
- }
- return ret;
- }
-
public boolean isQualifierPresent(Annotated f, BeanManager beanManager)
{
for (Annotation a : f.getAnnotations())
Deleted: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlProcessAnnotatedType.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlProcessAnnotatedType.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlProcessAnnotatedType.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -1,50 +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.xml.bootstrap;
-
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
-
-public class XmlProcessAnnotatedType implements ProcessAnnotatedType
-{
- final AnnotatedType annotatedType;
-
- XmlProcessAnnotatedType(AnnotatedType annotatedType)
- {
- this.annotatedType = annotatedType;
- }
-
- public AnnotatedType getAnnotatedType()
- {
- return annotatedType;
- }
-
- public void setAnnotatedType(AnnotatedType type)
- {
- // nop for now
- }
-
- public void veto()
- {
- // nop for now
- }
-}
Deleted: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/GenericBeanResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/GenericBeanResult.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/GenericBeanResult.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -1,49 +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.xml.core;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class GenericBeanResult
-{
- final Class<?> genericBean;
-
- final Set<BeanResult<?>> secondaryBeans;
-
- public GenericBeanResult(Class<?> genericBean, Set<BeanResult<?>> secondaryBeans)
- {
- this.genericBean = genericBean;
- this.secondaryBeans = new HashSet<BeanResult<?>>(secondaryBeans);
- }
-
- public Class<?> getGenericBean()
- {
- return genericBean;
- }
-
- public Set<BeanResult<?>> getSecondaryBeans()
- {
- return secondaryBeans;
- }
-
-}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -48,8 +48,6 @@
private final List<BeanResult<?>> beans = new ArrayList<BeanResult<?>>();
- private final List<GenericBeanResult> genericBeans = new ArrayList<GenericBeanResult>();
-
private final String sortKey;
public XmlResult(String fileUrl)
@@ -146,16 +144,6 @@
return veto;
}
- public void addGenericBean(GenericBeanResult result)
- {
- genericBeans.add(result);
- }
-
- public List<GenericBeanResult> getGenericBeans()
- {
- return genericBeans;
- }
-
public int compareTo(XmlResult o)
{
return sortKey.compareTo(o.sortKey);
Deleted: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -1,83 +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.xml.model;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.seam.xml.util.TypeOccuranceInformation;
-import org.jboss.seam.xml.util.XmlConfigurationException;
-
-public class GenericBeanXmlItem extends AbstractXmlItem
-{
-
- Class<?> javaClass;
-
- public GenericBeanXmlItem(XmlItem parent, Map<String, String> attributes, String document, int lineno)
- {
- super(XmlItemType.GENERIC_BEAN, parent, null, null, attributes, document, lineno);
- if (attributes.containsKey("class"))
- {
- javaClass = getClass(attributes.get("class"), document, lineno);
- }
- else
- {
- throw new XmlConfigurationException("<genericBean> element must have a class attribute", document, lineno);
- }
- }
-
- public Set<TypeOccuranceInformation> getAllowedItem()
- {
- return Collections.singleton(TypeOccuranceInformation.of(XmlItemType.CLASS, 1, null));
- }
-
- public Class<?> getClass(String className, String document, int lineno)
- {
- try
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return Thread.currentThread().getContextClassLoader().loadClass(className);
- }
- }
- catch (ClassNotFoundException e)
- {
-
- }
- try
- {
- return getClass().getClassLoader().loadClass(className);
- }
- catch (ClassNotFoundException e1)
- {
- throw new XmlConfigurationException("could not find class <genericBean>", document, lineno);
- }
- }
-
- @Override
- public Class<?> getJavaClass()
- {
- return javaClass;
- }
-
-}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -23,7 +23,6 @@
import java.lang.annotation.Annotation;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -35,7 +34,6 @@
import org.jboss.seam.xml.core.BeanResult;
import org.jboss.seam.xml.core.BeanResultType;
-import org.jboss.seam.xml.core.GenericBeanResult;
import org.jboss.seam.xml.core.XmlResult;
import org.jboss.seam.xml.parser.SaxNode;
import org.jboss.seam.xml.parser.namespace.CompositeNamespaceElementResolver;
@@ -150,22 +148,6 @@
addStereotypeToResult(ret, xmlItem);
}
}
- else if (xmlItem.getType() == XmlItemType.GENERIC_BEAN)
- {
-
- GenericBeanXmlItem item = (GenericBeanXmlItem) xmlItem;
- Set<BeanResult<?>> classes = new HashSet<BeanResult<?>>();
- for (ClassXmlItem c : xmlItem.getChildrenOfType(ClassXmlItem.class))
- {
- BeanResult<?> br = c.createBeanResult(manager);
- if (br.getBeanType() != BeanResultType.ADD)
- {
- ret.addVeto(br.getType());
- }
- classes.add(br);
- }
- ret.addGenericBean(new GenericBeanResult(item.getJavaClass(), classes));
- }
}
/**
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -23,5 +23,5 @@
public enum XmlItemType
{
- CLASS, METHOD, FIELD, ANNOTATION, VALUE, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, REPLACE, MODIFIES, GENERIC_BEAN;
+ CLASS, METHOD, FIELD, ANNOTATION, VALUE, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, REPLACE, MODIFIES;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -24,12 +24,11 @@
import org.jboss.seam.xml.model.ArrayXmlItem;
import org.jboss.seam.xml.model.ClassXmlItem;
import org.jboss.seam.xml.model.EntryXmlItem;
-import org.jboss.seam.xml.model.GenericBeanXmlItem;
import org.jboss.seam.xml.model.KeyXmlItem;
import org.jboss.seam.xml.model.ModifiesXmlItem;
-import org.jboss.seam.xml.model.ReplacesXmlItem;
import org.jboss.seam.xml.model.ParameterXmlItem;
import org.jboss.seam.xml.model.ParametersXmlItem;
+import org.jboss.seam.xml.model.ReplacesXmlItem;
import org.jboss.seam.xml.model.ValueXmlItem;
import org.jboss.seam.xml.model.XmlItem;
import org.jboss.seam.xml.model.XmlItemType;
@@ -86,10 +85,6 @@
{
return new ParametersXmlItem(parent, node.getDocument(), node.getLineNo());
}
- else if (item.equals("genericBean"))
- {
- return new GenericBeanXmlItem(parent, node.getAttributes(), node.getDocument(), node.getLineNo());
- }
// now deal with primitive types
Class<?> primType = null;
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java 2010-08-28 00:21:50 UTC (rev 13659)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java 2010-08-28 00:25:27 UTC (rev 13660)
@@ -33,6 +33,13 @@
this.lineno = lineno;
}
+ public XmlConfigurationException(String message, String document, int lineno, Throwable cause)
+ {
+ super(message, cause);
+ this.document = document;
+ this.lineno = lineno;
+ }
+
@Override
public String getMessage()
{
14 years, 3 months
Seam SVN: r13659 - in modules/xml/trunk/impl/src/test: resources/org/jboss/seam/xml/test/method and 1 other directory.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-08-27 20:21:50 -0400 (Fri, 27 Aug 2010)
New Revision: 13659
Added:
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/Qualifier3.java
Modified:
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
Log:
fix tests
Added: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/Qualifier3.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/Qualifier3.java (rev 0)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/Qualifier3.java 2010-08-28 00:21:50 UTC (rev 13659)
@@ -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.test.method;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface Qualifier3
+{
+
+}
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-08-28 00:00:46 UTC (rev 13658)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-08-28 00:21:50 UTC (rev 13659)
@@ -10,7 +10,11 @@
<test:Qualifier2>
<Qualifier />
</test:Qualifier2>
-
+
+ <test:Qualifier3>
+ <Qualifier />
+ </test:Qualifier3>
+
<test:MethodBean>
<test:method>
<Produces />
@@ -48,7 +52,7 @@
</test:method>
<test:method>
<Produces />
- <test:Qualifier2 />
+ <test:Qualifier3 />
<parameters>
<Instance>
<test:Qualifier2 />
14 years, 3 months
Seam SVN: r13658 - 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-08-27 20:00:46 -0400 (Fri, 27 Aug 2010)
New Revision: 13658
Modified:
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/MethodBean.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ExtendedBean.java
modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/SimpleBeanTest.java
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
Log:
changes to tests
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/MethodBean.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/MethodBean.java 2010-08-27 23:22:54 UTC (rev 13657)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/method/MethodBean.java 2010-08-28 00:00:46 UTC (rev 13658)
@@ -40,10 +40,15 @@
{
return beans.length;
}
-
+
public int method(Instance<MethodValueBean> bean)
{
- return bean.get().getValue() + 1;
+ return bean.get().getValue() + 1;
}
+ public int method(Instance<MethodValueBean> bean, Instance<MethodValueBean> bean1)
+ {
+ return bean.get().getValue() + 1;
+ }
+
}
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ExtendedBean.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ExtendedBean.java 2010-08-27 23:22:54 UTC (rev 13657)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/ExtendedBean.java 2010-08-28 00:00:46 UTC (rev 13658)
@@ -21,8 +21,16 @@
*/
package org.jboss.seam.xml.test.simple;
+import java.util.List;
+
+import javax.enterprise.context.ApplicationScoped;
+
@ExtendedQualifier1
+@ApplicationScoped
public class ExtendedBean
{
-
+ public List<String> getData()
+ {
+ return null;
+ }
}
Modified: modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/SimpleBeanTest.java
===================================================================
--- modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/SimpleBeanTest.java 2010-08-27 23:22:54 UTC (rev 13657)
+++ modules/xml/trunk/impl/src/test/java/org/jboss/seam/xml/test/simple/SimpleBeanTest.java 2010-08-28 00:00:46 UTC (rev 13658)
@@ -21,6 +21,7 @@
*/
package org.jboss.seam.xml.test.simple;
+import java.lang.reflect.Method;
import java.util.Set;
import javax.enterprise.inject.spi.Bean;
@@ -65,7 +66,7 @@
}
@Test
- public void testExtends()
+ public void testExtends() throws SecurityException, NoSuchMethodException
{
AnnotationLiteral<ExtendedQualifier1> e1 = new AnnotationLiteral<ExtendedQualifier1>()
{
@@ -76,6 +77,7 @@
ExtendedBean ext = getReference(ExtendedBean.class, e1, e2);
Assert.assertTrue(ext != null);
-
+ Method method = ext.getClass().getDeclaredMethod("getData");
+ method.getGenericReturnType();
}
}
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-08-27 23:22:54 UTC (rev 13657)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-08-28 00:00:46 UTC (rev 13658)
@@ -46,6 +46,18 @@
</Instance>
</parameters>
</test:method>
+ <test:method>
+ <Produces />
+ <test:Qualifier2 />
+ <parameters>
+ <Instance>
+ <test:Qualifier2 />
+ </Instance>
+ <Instance>
+ <test:Qualifier2 />
+ </Instance>
+ </parameters>
+ </test:method>
</test:MethodBean>
<test:MethodTarget>
14 years, 3 months
Seam SVN: r13657 - in examples/trunk/javaee-booking: src/main/java/org/jboss/seam/examples/booking/booking and 6 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 19:22:54 -0400 (Fri, 27 Aug 2010)
New Revision: 13657
Added:
examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/
examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/test-persistence.xml
examples/trunk/javaee-booking/src/test/resources-jbossas/test-persistence.xml
Removed:
examples/trunk/javaee-booking/src/test/resources-glassfish/
Modified:
examples/trunk/javaee-booking/pom.xml
examples/trunk/javaee-booking/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java
examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/sun-resources.xml
examples/trunk/javaee-booking/src/test/resources/arquillian.xml
Log:
fix arquillian tests
Modified: examples/trunk/javaee-booking/pom.xml
===================================================================
--- examples/trunk/javaee-booking/pom.xml 2010-08-27 21:40:16 UTC (rev 13656)
+++ examples/trunk/javaee-booking/pom.xml 2010-08-27 23:22:54 UTC (rev 13657)
@@ -25,10 +25,10 @@
<jboss.home>${env.JBOSS_HOME}</jboss.home>
<jboss.domain>default</jboss.domain>
<arquillian.version>1.0.0.Alpha3</arquillian.version>
- <glassfish.version>3.0.1-b19</glassfish.version>
+ <glassfish.version>3.0.1-b20</glassfish.version>
<jpamodelgen.version>1.0.0.Final</jpamodelgen.version>
- <jboss-as-client.version>6.0.0.20100216-M2</jboss-as-client.version>
- <jboss-javaee6-spec.version>1.0.0.Beta4</jboss-javaee6-spec.version>
+ <jboss-as-client.version>6.0.0.20100721-M4</jboss-as-client.version>
+ <jboss-javaee6-spec.version>1.0.0.Beta7</jboss-javaee6-spec.version>
<jboss-server-manager.version>1.0.3.GA</jboss-server-manager.version>
<seam-faces.version>3.0.0.Alpha3</seam-faces.version>
</properties>
@@ -273,11 +273,11 @@
</profile>
<profile>
- <id>jbossas-remote-60</id>
+ <id>jbossas-remote-6</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-jbossas-remote-60</artifactId>
+ <artifactId>arquillian-jbossas-remote-6</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
@@ -310,11 +310,11 @@
</profile>
<profile>
- <id>glassfish-embedded-30</id>
+ <id>glassfish-embedded-3</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-glassfish-embedded-30</artifactId>
+ <artifactId>arquillian-glassfish-embedded-3</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
@@ -331,18 +331,36 @@
<directory>src/test/resources</directory>
</testResource>
<testResource>
- <directory>src/test/resources-glassfish</directory>
+ <directory>src/test/resources-glassfish-embedded</directory>
</testResource>
</testResources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!-- don't use version 2.5 as it creates seperate test suites per class -->
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <!-- This optional property fixes an annoyance with Glassfish that puts derby.log in the project root -->
+ <property>
+ <name>derby.stream.error.file</name>
+ <!-- If you save the log in target it is less likely to get committed in your project -->
+ <value>target/derby.log</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
</build>
</profile>
+ <!--
<profile>
- <id>glassfish-remote-30</id>
+ <id>glassfish-remote-3</id>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-glassfish-remote-30</artifactId>
+ <artifactId>arquillian-glassfish-remote-3</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
@@ -359,11 +377,12 @@
<directory>src/test/resources</directory>
</testResource>
<testResource>
- <directory>src/test/resources-glassfish</directory>
+ <directory>src/test/resources-glassfish-remote</directory>
</testResource>
</testResources>
</build>
</profile>
+ -->
</profiles>
<scm>
Modified: examples/trunk/javaee-booking/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java
===================================================================
--- examples/trunk/javaee-booking/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java 2010-08-27 21:40:16 UTC (rev 13656)
+++ examples/trunk/javaee-booking/src/main/java/org/jboss/seam/examples/booking/booking/BookingAgent.java 2010-08-27 23:22:54 UTC (rev 13657)
@@ -90,8 +90,7 @@
@Begin
public void selectHotel(final Long id)
{
- // NOTE get a fresh reference that's managed by the extended persistence
- // context
+ // NOTE get a fresh reference that's managed by the extended persistence context
hotelSelection = em.find(Hotel.class, id);
if (hotelSelection != null)
{
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 21:40:16 UTC (rev 13656)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 23:22:54 UTC (rev 13657)
@@ -6,6 +6,7 @@
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@@ -22,10 +23,12 @@
import org.jboss.seam.examples.booking.support.NoOpLogger;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.weld.context.ConversationContext;
import org.jboss.weld.context.api.ContextualInstance;
import org.jboss.weld.context.api.helpers.AbstractMapBackedBeanStore;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +39,7 @@
@Deployment
public static Archive<?> createTestArchive()
{
- WebArchive war = ShrinkWrap.create(WebArchive.class, "test")
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addPackage(Hotel.class.getPackage())
.addClasses(BookingAgent.class, BookingAgent.class, Confirmed.class,
Authenticated.class, NoOpLogger.class)
@@ -44,12 +47,15 @@
MavenArtifactResolver.resolve("joda-time:joda-time:1.6"),
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international-api:3.0.0.Alpha1"),
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international:3.0.0.Alpha1"))
- .addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
- .addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ .addWebResource("test-persistence.xml", "classes/META-INF/persistence.xml")
+ .addWebResource(new StringAsset(""), "beans.xml");
return war;
}
@Inject
+ BeanManager beanManager;
+
+ @Inject
UserTransaction utx;
@PersistenceContext
@@ -69,7 +75,7 @@
em.createQuery("delete from Hotel").executeUpdate();
em.persist(new Hotel("Doubletree Atlanta-Buckhead", "3342 Peachtree Road NE", "Atlanta", "GA", "30326", "USA"));
em.createQuery("delete from User").executeUpdate();
- em.persist(new User("Ike", "ike", "incontainer"));
+ em.persist(new User("Ike", "ike", "ike(a)mailinator.com", "secret"));
utx.commit();
}
@@ -77,10 +83,12 @@
public void testBookHotel() throws Exception
{
prepareSeedData();
- // ConversationContext cc =
- // Container.instance().services().get(ContextLifecycle.class).getConversationContext();
- // cc.setBeanStore(new HashMapBeanStore());
- // cc.setActive(true);
+
+ // we have to depend on the Weld API to setup the conversation scope
+ ConversationContext cc = new ConversationContext();
+ cc.setBeanStore(new HashMapBeanStore());
+ cc.setActive(true);
+ ((BeanManagerImpl) beanManager).addContext(cc);
bookingAgent.selectHotel(1l);
bookingAgent.bookHotel();
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java 2010-08-27 21:40:16 UTC (rev 13656)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java 2010-08-27 23:22:54 UTC (rev 13657)
@@ -15,7 +15,7 @@
import org.jboss.seam.examples.booking.support.NoOpLogger;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
@@ -26,15 +26,15 @@
{
@Deployment
public static Archive<?> createTestArchive() {
- // JavaArchive doesn't work on GlassFish (would work on JBoss AS, but it breaks because of the EJBs)
-// JavaArchive jar = ShrinkWrap.create("test.jar", JavaArchive.class)
+ // JavaArchive doesn't work on GlassFish
+// JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test.jar")
// .addPackage(HotelSearch.class.getPackage())
// .addPackage(Hotel.class.getPackage())
// .addManifestResource("META-INF/persistence.xml", "persistence.xml")
// .addManifestResource(new ByteArrayAsset(new byte[0]), "beans.xml");
// return jar;
- // WebArchive does work in all cases (except JBoss AS still breaks with EJBs)
- WebArchive war = ShrinkWrap.create(WebArchive.class, "test")
+ // WebArchive works in all cases
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war")
.addPackage(HotelSearch.class.getPackage())
.addPackage(Hotel.class.getPackage())
.addClasses(NoOpLogger.class)
@@ -43,8 +43,8 @@
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international-api:3.0.0.Alpha1"),
MavenArtifactResolver.resolve("org.jboss.seam.international:seam-international:3.0.0.Alpha1")
)
- .addWebResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
- .addWebResource(new ByteArrayAsset(new byte[0]), "beans.xml");
+ .addWebResource("test-persistence.xml", "classes/META-INF/persistence.xml")
+ .addWebResource(new StringAsset(""), "beans.xml");
return war;
}
Modified: examples/trunk/javaee-booking/src/test/resources/arquillian.xml
===================================================================
--- examples/trunk/javaee-booking/src/test/resources/arquillian.xml 2010-08-27 21:40:16 UTC (rev 13656)
+++ examples/trunk/javaee-booking/src/test/resources/arquillian.xml 2010-08-27 23:22:54 UTC (rev 13657)
@@ -1,19 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.com/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gfembedded="urn:arq:org.jboss.arquillian.glassfish.embedded30"
- xmlns:gfremote="urn:arq:org.jboss.arquillian.container.glassfish.remote30">
+ xmlns:jbossas-remote="urn:arq:org.jboss.arquillian.container.jbossas.remote_6"
+ xmlns:glassfish-remote="urn:arq:org.jboss.arquillian.container.glassfish.remote_3"
+ xmlns:glassfish-embedded="urn:arq:org.jboss.arquillian.container.glassfish.embedded_3">
<engine>
<deploymentExportPath>/tmp/</deploymentExportPath>
</engine>
+
+ <jbossas-remote:container>
+ <jbossas-remote:remoteServerHttpPort>8080</jbossas-remote:remoteServerHttpPort>
+ </jbossas-remote:container>
- <gfremote:container>
- <gfremote:remoteServerHttpPort>7070</gfremote:remoteServerHttpPort>
- </gfremote:container>
+ <glassfish-remote:container>
+ <glassfish-remote:remoteServerHttpPort>7070</glassfish-remote:remoteServerHttpPort>
+ </glassfish-remote:container>
- <gfembedded:container>
- <gfembedded:sunResourcesXml>src/test/resources-glassfish/sun-resources.xml</gfembedded:sunResourcesXml>
- </gfembedded:container>
+ <glassfish-embedded:container>
+ <glassfish-embedded:bindHttpPort>7070</glassfish-embedded:bindHttpPort>
+ <glassfish-embedded:sunResourcesXml>src/test/resources-glassfish-embedded/sun-resources.xml</glassfish-embedded:sunResourcesXml>
+ </glassfish-embedded:container>
</arquillian>
Copied: examples/trunk/javaee-booking/src/test/resources-glassfish-embedded (from rev 13635, examples/trunk/javaee-booking/src/test/resources-glassfish)
Modified: examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/sun-resources.xml
===================================================================
--- examples/trunk/javaee-booking/src/test/resources-glassfish/sun-resources.xml 2010-08-25 19:15:25 UTC (rev 13635)
+++ examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/sun-resources.xml 2010-08-27 23:22:54 UTC (rev 13657)
@@ -3,7 +3,7 @@
"http://www.sun.com/software/appserver/dtds/sun-resources_1_4.dtd">
<resources>
<jdbc-resource pool-name="ArquillianEmbeddedDerbyPool"
- jndi-name="jdbc/__arquillian"/>
+ jndi-name="jdbc/arquillian"/>
<jdbc-connection-pool name="ArquillianEmbeddedDerbyPool"
res-type="javax.sql.DataSource"
datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource"
@@ -13,7 +13,7 @@
</jdbc-connection-pool>
<!--
<jdbc-resource pool-name="ArquillianEmbeddedH2Pool"
- jndi-name="jdbc/__arquillian"/>
+ jndi-name="jdbc/arquillian"/>
<jdbc-connection-pool name="ArquillianEmbeddedH2Pool"
res-type="javax.sql.DataSource"
datasource-classname="org.h2.jdbcx.JdbcDataSource">
Added: examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/test-persistence.xml
===================================================================
--- examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/test-persistence.xml (rev 0)
+++ examples/trunk/javaee-booking/src/test/resources-glassfish-embedded/test-persistence.xml 2010-08-27 23:22:54 UTC (rev 13657)
@@ -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="booking">
+ <!-- DataSource configured in adjacent sun-resources.xml -->
+ <jta-data-source>jdbc/arquillian</jta-data-source>
+ <class>org.jboss.seam.examples.booking.model.User</class>
+ <class>org.jboss.seam.examples.booking.model.Hotel</class>
+ <class>org.jboss.seam.examples.booking.model.Booking</class>
+ <exclude-unlisted-classes/>
+ <properties>
+ <!-- Properties for EclipseLink (default provider for GlassFish) -->
+ <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
+ <property name="eclipselink.logging.level" value="FINE"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: examples/trunk/javaee-booking/src/test/resources-jbossas/test-persistence.xml
===================================================================
--- examples/trunk/javaee-booking/src/test/resources-jbossas/test-persistence.xml (rev 0)
+++ examples/trunk/javaee-booking/src/test/resources-jbossas/test-persistence.xml 2010-08-27 23:22:54 UTC (rev 13657)
@@ -0,0 +1,16 @@
+<?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="booking">
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ <!-- Properties for Hibernate (default provider for JBoss AS) -->
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <!-- Only format when you need to debug, because it slows things down -->
+ <property name="hibernate.format_sql" value="false"/>
+ </properties>
+ </persistence-unit>
+</persistence>
14 years, 3 months
Seam SVN: r13656 - examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/support.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:40:16 -0400 (Fri, 27 Aug 2010)
New Revision: 13656
Modified:
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java
Log:
add support for custom local repo configuration
add comments
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java 2010-08-27 21:39:42 UTC (rev 13655)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/support/MavenArtifactResolver.java 2010-08-27 21:40:16 UTC (rev 13656)
@@ -2,11 +2,48 @@
import java.io.File;
+/**
+ * A temporary resolver that converts a Maven artifact reference
+ * into a {@link java.io.File} object.
+ *
+ * <p>This approach is an interim solution for Maven projects
+ * until the open feature request to add formally add artifacts
+ * to a test (<a href="https://jira.jboss.org/browse/ARQ-66">ARQ-66</a>) is implementated.</p>
+ *
+ * <p>The testCompile goal will resolve any test dependencies and
+ * put them in your local Maven repository. By the time the test
+ * executes, you can be sure that the JAR files you need will be
+ * in your local repository.</p>
+ *
+ * <p>Example usage:</p>
+ *
+ * <pre>
+ * WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ * .addLibrary(MavenArtifactResolver.resolve("commons-lang:commons-lang:2.5"));
+ * </pre>
+
+ * <p>If you are using an alternate local Maven repository, you need to pass it
+ * to the Maven surefire plugin using the following stanza in the plugin
+ * configuration element:</p>
+ *
+ * <pre>
+ * <systemProperties>
+ * <property>
+ * <name>maven.repo.local</name>
+ * <value>${maven.repo.local}</value>
+ * </property>
+ * </systemProperties>
+ * </pre>
+ *
+ * <p>Another approach to pull in a library is to add packages recursively from the
+ * root library package.</p>
+ */
public class MavenArtifactResolver
{
private static final String LOCAL_MAVEN_REPO =
- System.getProperty("user.home") + File.separatorChar +
- ".m2" + File.separatorChar + "repository";
+ System.getProperty("maven.repo.local") != null ? System.getProperty("maven.repo.local") :
+ (System.getProperty("user.home") + File.separatorChar +
+ ".m2" + File.separatorChar + "repository");
public static File resolve(String groupId, String artifactId, String version)
{
14 years, 3 months
Seam SVN: r13655 - examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:39:42 -0400 (Fri, 27 Aug 2010)
New Revision: 13655
Modified:
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
Log:
whitespace
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 21:12:36 UTC (rev 13654)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 21:39:42 UTC (rev 13655)
@@ -51,10 +51,13 @@
@Inject
UserTransaction utx;
+
@PersistenceContext
EntityManager em;
+
@Inject
BookingAgent bookingAgent;
+
@Inject
Instance<Booking> bookingInstance;
14 years, 3 months
Seam SVN: r13654 - examples/trunk/javaee-booking.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:12:36 -0400 (Fri, 27 Aug 2010)
New Revision: 13654
Modified:
examples/trunk/javaee-booking/pom.xml
Log:
switch to final version of jboss maven plugin
update description
Modified: examples/trunk/javaee-booking/pom.xml
===================================================================
--- examples/trunk/javaee-booking/pom.xml 2010-08-27 21:10:50 UTC (rev 13653)
+++ examples/trunk/javaee-booking/pom.xml 2010-08-27 21:12:36 UTC (rev 13654)
@@ -16,8 +16,8 @@
<artifactId>seam-javaee-booking</artifactId>
<version>3.0.0-SNAPSHOT</version>
<packaging>war</packaging>
- <name>Seam Booking Example (Simplified packaging)</name>
- <description>The Seam booking example packaged using the simplified Java EE packaging</description>
+ <name>Seam Java EE Booking Example</name>
+ <description>The Seam booking example using the simplified Java EE 6 programming model and packaging structure (i.e., web archive)</description>
<url>http://seamframework.org/Seam3</url>
<properties>
@@ -258,7 +258,7 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<!-- only version 1.4.1 supports hard deploying multiple files -->
- <version>1.4.1-SNAPSHOT</version>
+ <version>1.4.1</version>
<configuration>
<jbossHome>${jboss.home}</jbossHome>
<serverName>${jboss.domain}</serverName>
14 years, 3 months
Seam SVN: r13653 - examples/trunk/javaee-booking/src/main/resources/META-INF.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:10:50 -0400 (Fri, 27 Aug 2010)
New Revision: 13653
Modified:
examples/trunk/javaee-booking/src/main/resources/META-INF/persistence.xml
Log:
use default persistence provider by default
Modified: examples/trunk/javaee-booking/src/main/resources/META-INF/persistence.xml
===================================================================
--- examples/trunk/javaee-booking/src/main/resources/META-INF/persistence.xml 2010-08-27 21:10:29 UTC (rev 13652)
+++ examples/trunk/javaee-booking/src/main/resources/META-INF/persistence.xml 2010-08-27 21:10:50 UTC (rev 13653)
@@ -6,8 +6,8 @@
<persistence-unit name="booking">
<!--
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
-->
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/__default</jta-data-source>
<class>org.jboss.seam.examples.booking.model.User</class>
<class>org.jboss.seam.examples.booking.model.Hotel</class>
14 years, 3 months
Seam SVN: r13652 - in examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking: inventory and 1 other directory.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:10:29 -0400 (Fri, 27 Aug 2010)
New Revision: 13652
Modified:
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java
Log:
migrate to latest ShrinkWrap API
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 21:09:46 UTC (rev 13651)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/booking/BookingAgentTest.java 2010-08-27 21:10:29 UTC (rev 13652)
@@ -22,8 +22,8 @@
import org.jboss.seam.examples.booking.support.NoOpLogger;
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.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
import org.jboss.weld.context.api.ContextualInstance;
import org.jboss.weld.context.api.helpers.AbstractMapBackedBeanStore;
import org.junit.Assert;
@@ -36,7 +36,7 @@
@Deployment
public static Archive<?> createTestArchive()
{
- WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test")
.addPackage(Hotel.class.getPackage())
.addClasses(BookingAgent.class, BookingAgent.class, Confirmed.class,
Authenticated.class, NoOpLogger.class)
Modified: examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java
===================================================================
--- examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java 2010-08-27 21:09:46 UTC (rev 13651)
+++ examples/trunk/javaee-booking/src/test/java/org/jboss/seam/examples/booking/inventory/HotelSearchTest.java 2010-08-27 21:10:29 UTC (rev 13652)
@@ -1,21 +1,22 @@
package org.jboss.seam.examples.booking.inventory;
import java.util.List;
+
import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
+
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.examples.booking.model.Hotel;
import org.jboss.seam.examples.booking.support.MavenArtifactResolver;
-import org.jboss.seam.examples.booking.model.Hotel;
import org.jboss.seam.examples.booking.support.NoOpLogger;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +34,7 @@
// .addManifestResource(new ByteArrayAsset(new byte[0]), "beans.xml");
// return jar;
// WebArchive does work in all cases (except JBoss AS still breaks with EJBs)
- WebArchive war = ShrinkWrap.create("test.war", WebArchive.class)
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test")
.addPackage(HotelSearch.class.getPackage())
.addPackage(Hotel.class.getPackage())
.addClasses(NoOpLogger.class)
14 years, 3 months
Seam SVN: r13651 - examples/trunk/javaee-booking/src/main/webapp.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2010-08-27 17:09:46 -0400 (Fri, 27 Aug 2010)
New Revision: 13651
Modified:
examples/trunk/javaee-booking/src/main/webapp/book.xhtml
Log:
fix x-form validator mapping
Modified: examples/trunk/javaee-booking/src/main/webapp/book.xhtml
===================================================================
--- examples/trunk/javaee-booking/src/main/webapp/book.xhtml 2010-08-27 21:09:22 UTC (rev 13650)
+++ examples/trunk/javaee-booking/src/main/webapp/book.xhtml 2010-08-27 21:09:46 UTC (rev 13651)
@@ -84,7 +84,7 @@
</fieldset>
<s:validateForm validatorId="reservationDateRange"
- fields="beginDate=checkInDate:input endDate=checkOutDate:input"/>
+ fields="startDate=checkInDate:input endDate=checkOutDate:input"/>
</h:form>
</div>
14 years, 3 months