Seam SVN: r15383 - in branches/enterprise/WFK-2_1: jboss-seam-gen/dist and 2 other directories.
by seam-commits@lists.jboss.org
Author: vdedik
Date: 2013-01-08 04:44:43 -0500 (Tue, 08 Jan 2013)
New Revision: 15383
Added:
branches/enterprise/WFK-2_1/build/lib/ant-contrib-0.6.jar
Removed:
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/Deployments.java
Modified:
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build-war.xml
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build.xml
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java
branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java
Log:
JBSEAM-5034
Added: branches/enterprise/WFK-2_1/build/lib/ant-contrib-0.6.jar
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/build/lib/ant-contrib-0.6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/zip
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build-war.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build-war.xml 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build-war.xml 2013-01-08 09:44:43 UTC (rev 15383)
@@ -402,48 +402,60 @@
</fileset>
<fileset dir="${basedir}/view"/>
</copy>
- <copy tofile="${test.dir}/META-INF/persistence.xml"
- file="${basedir}/resources/META-INF/persistence-test.xml"/>
- <copy tofile="${test.dir}/import.sql"
- file="${basedir}/resources/import-test.sql"/>
- <copy tofile="${test.dir}/components.properties"
- file="${basedir}/resources/components-test.properties"/>
-<!-- <copy todir="${test.dir}" flatten="true">
+ <copy tofile="${test.dir}/META-INF/persistence.xml"
+ file="${basedir}/resources/META-INF/persistence-test.xml"/>
+ <copy tofile="${test.dir}/import.sql"
+ file="${basedir}/resources/import-test.sql"/>
+ <copy tofile="${test.dir}/components.properties"
+ file="${basedir}/resources/components-test.properties"/>
+ <copy todir="${test.dir}" flatten="true">
<fileset dir="${src.test.dir}">
- <include name="**/*Test.xml" />
+ <include name="**/*Test.xml"/>
</fileset>
</copy>
- -->
+ <copy tofile="${test.dir}/components.properties"
+ file="${basedir}/resources/components-test.properties"/>
</target>
<target name="test" depends="buildtest" description="Run the tests">
- <fail message="Test target is currently not supported"/>
+ <!-- <fail message="Test target is currently not supported"/> -->
<fail message="Cannot run tests because path to project contains spaces.">
<condition>
<contains string="${basedir}" substring=" "/>
</condition>
</fail>
- <condition property="incompatible.jdk" value="true">
+ <!-- <condition property="incompatible.jdk" value="true">
<and>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<not><available classname="javax.xml.bind.JAXB"/></not>
</and>
- </condition>
- <!-- <fail if="incompatible.jdk">You are using an incompatible JDK 6. Please use Sun JDK 6 Update 4 (1.6.0_04) or newer or use Open JDK 6.</fail>
- <taskdef resource="testngtasks" classpath="${testng.jar}" />-->
+ </condition>
+ <fail if="incompatible.jdk">You are using an incompatible JDK 6. Please use Sun JDK 6 Update 4 (1.6.0_04) or newer or use Open JDK 6.</fail>
+ -->
+ <!--<taskdef resource="testngtasks" classpath="${testng.jar}"/>-->
<path id="test.path">
- <path path="${test.dir}" />
+ <path path="${test.dir}"/>
<fileset dir="${lib.dir}/test">
<include name="*.jar"/>
</fileset>
-<!-- <path path="${bootstrap.dir}" />-->
- <path refid="build.classpath" />
+ <path refid="build.classpath"/>
</path>
- <!-- <testng outputdir="${basedir}/test-report">
- <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
- <classpath refid="test.path" />
- <xmlfileset dir="${test.dir}" includes="*Test.xml" />
- </testng>-->
+ <mkdir dir="${basedir}/test-report"/>
+ <junit printsummary="yes">
+ <!--outputdir="${basedir}/test-report">-->
+ <!--<jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>-->
+ <formatter type="xml"/>
+ <classpath refid="test.path"/>
+ <batchtest todir="${basedir}/test-report">
+ <fileset dir="${test.dir}">
+ <include name="**/*Test.class"/>
+ </fileset>
+ </batchtest>
+ </junit>
+ <junitreport todir="${basedir}/test-report">
+ <fileset dir="${basedir}/test-report"/>
+ <report todir="${basedir}/test-report"/>
+ </junitreport>
</target>
<target name="javadoc" depends="compile">
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build.xml 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build-scripts/build.xml 2013-01-08 09:44:43 UTC (rev 15383)
@@ -442,7 +442,7 @@
</target>
<target name="test" depends="buildtest" description="Run the tests">
- <fail message="Test target is currently not supported"/>
+ <!-- <fail message="Test target is currently not supported"/> -->
<fail message="Cannot run tests because path to project contains spaces.">
<condition>
<contains string="${basedir}" substring=" "/>
@@ -464,9 +464,11 @@
</fileset>
<path refid="build.classpath"/>
</path>
+ <mkdir dir="${basedir}/test-report"/>
<junit printsummary="yes">
<!--outputdir="${basedir}/test-report">-->
<!--<jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>-->
+ <formatter type="xml"/>
<classpath refid="test.path"/>
<batchtest todir="${basedir}/test-report">
<fileset dir="${test.dir}">
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/build.xml 2013-01-08 09:44:43 UTC (rev 15383)
@@ -78,6 +78,12 @@
<taskdef name="randomUUID"
classname="org.jboss.seam.tool.RandomUUIDTask"
classpathref="seam-gen.lib.path"/>
+
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties">
+ <classpath>
+ <pathelement location="${seam.dir}/build/lib/ant-contrib-0.6.jar"/>
+ </classpath>
+ </taskdef>
</target>
<target name="init-properties" depends="init">
@@ -184,8 +190,47 @@
</target>
- <target name="setup-filters">
+ <target name="setup-librarylist-war" if="project.war">
+ <path id="library.fileset">
+ <fileset dir="${project.home}/lib">
+ <includesfile name="${project.home}/deployed-jars.list"/>
+ <include name="jboss-seam.jar"/>
+ <include name="javassist.jar"/>
+ </fileset>
+ </path>
+ </target>
+ <target name="setup-librarylist-ear" if="project.ear">
+ <path id="library.fileset">
+ <fileset dir="${project.home}/lib">
+ <includesfile name="${project.home}/deployed-jars-ear.list"/>
+ <includesfile name="${project.home}/deployed-jars-war.list"/>
+ <include name="jboss-seam.jar"/>
+ <include name="javassist.jar"/>
+ </fileset>
+ </path>
+ </target>
+
+ <target name="setup-librarylist"
+ depends="setup-librarylist-ear,setup-librarylist-war">
+ <property name="library.list.inner" refid="library.fileset"/>
+ <property name="indent" value=" "/>
+ <propertyregex property="library.list.inner"
+ override="true"
+ regexp=":"
+ replace='"), ${line.separator} ${indent} new File(PROJECT_HOME + "'
+ input="${library.list.inner}"
+ global="true"/>
+ <propertyregex property="library.list.inner"
+ override="true"
+ regexp="${project.home}/"
+ replace=""
+ input="${library.list.inner}"
+ global="true"/>
+ <property name="library.list" value='new File(PROJECT_HOME + "${library.list.inner}")'/>
+ </target>
+
+ <target name="setup-filters" depends="setup-librarylist">
<filterset id="filters">
<filter token="interfaceName" value="${interface.name}"/>
<filter token="beanName" value="${bean.name}"/>
@@ -200,9 +245,10 @@
<filter token="listName" value="${component.name}List"/>
<filter token="homeName" value="${component.name}Home"/>
<filter token="query" value="${query.text}"/>
- <filter token="projectName" value="${project.name}"/>
- <filter token="projectType" value="${project.type}"/>
- <filter token="workspaceHome" value="${workspace.home}"/>
+ <filter token="projectName" value="${project.name}"/>
+ <filter token="projectType" value="${project.type}"/>
+ <filter token="workspaceHome" value="${workspace.home}"/>
+ <filter token="libraryList" value="${library.list}"/>
</filterset>
</target>
@@ -706,7 +752,6 @@
<property name="list.file" value="${project.home}/src/${action.dir}/${entity.name}List.java"/>
<property name="page.file" value="${project.home}/view/${page.name}.xhtml"/>
<property name="masterPage.file" value="${project.home}/view/${masterPage.name}.xhtml"/>
-
</target>
<target name="query-input">
@@ -1246,10 +1291,7 @@
</copy>
<copy file="${templates.dir}/src/Action.java" tofile="${interface.file}">
<filterset refid="filters"/>
- </copy>
- <copy file="${templates.dir}/test/Deployments.java" tofile="${project.home}/src/${test.dir}/Deployments.java">
- <filterset refid="filters"/>
- </copy>
+ </copy>
<copy file="${templates.dir}/test/ActionTest.java" tofile="${test.file}">
<filterset refid="filters"/>
</copy>
@@ -1270,10 +1312,7 @@
</copy>
<copy file="${templates.dir}/test/ActionTest.java" tofile="${test.file}">
<filterset refid="filters"/>
- </copy>
- <copy file="${templates.dir}/test/Deployments.java" tofile="${project.home}/src/${test.dir}/Deployments.java">
- <filterset refid="filters"/>
- </copy>
+ </copy>
<mkdir dir="${project.home}/resources-test"/>
<copy file="${templates.dir}/test/arquillian.xml" tofile="${project.home}/resources-test/arquillian.xml">
<filterset refid="filters"/>
@@ -1291,10 +1330,7 @@
</copy>
<copy file="${templates.dir}/test/FormTest.java" tofile="${test.file}">
<filterset refid="filters"/>
- </copy>
- <copy file="${templates.dir}/test/Deployments.java" tofile="${project.home}/src/${test.dir}/Deployments.java">
- <filterset refid="filters"/>
- </copy>
+ </copy>
<copy file="${templates.dir}/view/form.xhtml" tofile="${page.file}">
<filterset refid="filters"/>
</copy>
@@ -1318,10 +1354,7 @@
</copy>
<copy file="${templates.dir}/view/form.xhtml" tofile="${page.file}">
<filterset refid="filters"/>
- </copy>
- <copy file="${templates.dir}/test/Deployments.java" tofile="${project.home}/src/${test.dir}/Deployments.java">
- <filterset refid="filters"/>
- </copy>
+ </copy>
<mkdir dir="${project.home}/resources-test"/>
<copy file="${templates.dir}/test/arquillian.xml" tofile="${project.home}/resources-test/arquillian.xml">
<filterset refid="filters"/>
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/ActionTest.java 2013-01-08 09:44:43 UTC (rev 15383)
@@ -4,23 +4,35 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Filters;
+import org.jboss.shrinkwrap.api.GenericArchive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.seam.mock.JUnitSeamTest;
-import @testPackage@.Deployments;
import @actionPackage@.@interfaceName@;
-//import @actionPackage@.@beanName@;
+import @actionPackage@.@beanName@;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;
+import java.io.File;
@RunWith(Arquillian.class)
public class @interfaceName@Test extends JUnitSeamTest {
+ public static final String WEBAPP_SRC = "@workspaceHome@/@projectName@/test-build";
+ public static final String PROJECT_HOME = "@workspaceHome@/@projectName@/";
+
@Deployment(name="@interfaceName@Test")
@OverProtocol("Servlet 3.0")
public static WebArchive createDeployment()
{
-// return Deployments.defaultDeployment()
-// .addClasses(@interfaceName@.class, @beanName@.class)
-// .addAsResource("seam.properties");
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
+ war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
+ .importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.includeAll())
+ .addClasses(@interfaceName@.class, @beanName@.class)
+ .addAsLibraries(@libraryList@)
+ .addAsResource("seam.properties");
+ return war;
}
Deleted: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/Deployments.java 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/Deployments.java 2013-01-08 09:44:43 UTC (rev 15383)
@@ -1,33 +0,0 @@
-package @testPackage@;
-
-import java.io.File;
-
-import org.jboss.shrinkwrap.api.Filters;
-import org.jboss.shrinkwrap.api.GenericArchive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-
-public class Deployments {
-
- public static final String WEBAPP_SRC = "@workspaceHome@/@projectName@/test-build";
-
- public static WebArchive defaultDeployment() {
-
- WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
- war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
- .importDirectory(WEBAPP_SRC).as(GenericArchive.class),
- "/", Filters.includeAll());
- for (File f : new File("@workspaceHome@/@projectName@/lib/").listFiles())
- {
- if (f.isFile())
- {
- war.addAsLibrary(f);
- }
- }
-
- return war;
-
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java 2013-01-08 09:21:58 UTC (rev 15382)
+++ branches/enterprise/WFK-2_1/jboss-seam-gen/dist/test/FormTest.java 2013-01-08 09:44:43 UTC (rev 15383)
@@ -6,22 +6,35 @@
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OverProtocol;
import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.Filters;
+import org.jboss.shrinkwrap.api.GenericArchive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;
import @actionPackage@.@interfaceName@;
-//import @actionPackage@.@beanName@;
+import @actionPackage@.@beanName@;
+import java.io.File;
@RunWith(Arquillian.class)
public class @interfaceName@Test extends JUnitSeamTest {
+ public static final String WEBAPP_SRC = "@workspaceHome@/@projectName@/test-build";
+ public static final String PROJECT_HOME = "@workspaceHome@/@projectName@/";
+
@Deployment(name="@interfaceName@Test")
@OverProtocol("Servlet 3.0")
public static WebArchive createDeployment()
{
-// return Deployments.defaultDeployment()
-// .addClasses(@interfaceName@.class, @beanName@.class)
-// .addAsResource("seam.properties");
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
+ war.merge(ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class)
+ .importDirectory(WEBAPP_SRC).as(GenericArchive.class), "/", Filters.includeAll())
+ .addClasses(@interfaceName@.class, @beanName@.class)
+ .addAsLibraries(@libraryList@)
+ .addAsResource("seam.properties");
+ return war;
}
@Test