Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 271583 Details for
Bug 527610
support testing on WildFly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
backport to 2.7
0001-Bug-527610-support-for-testing-on-wildfly.patch (text/plain), 29.20 KB, created by
Lukas Jungmann
on 2017-11-22 08:13:27 EST
(
hide
)
Description:
backport to 2.7
Filename:
MIME Type:
Creator:
Lukas Jungmann
Created:
2017-11-22 08:13:27 EST
Size:
29.20 KB
patch
obsolete
>From 82d61b1e0366c1edb551a7628e94b8b75f13ae13 Mon Sep 17 00:00:00 2001 >From: Lukas Jungmann <lukas.jungmann@oracle.com> >Date: Fri, 10 Nov 2017 18:23:06 +0100 >Subject: [PATCH] Bug 527610: support for testing on wildfly > >Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com> >--- > jpa/eclipselink.jpa.test/antbuild.xml | 75 +++---- > .../wildfly/eclipselink-module-template.xsl | 93 ++++++++ > jpa/eclipselink.jpa.test/wildfly.properties | 37 ++++ > jpa/eclipselink.jpa.test/wildfly.xml | 245 +++++++++++++++++++++ > 4 files changed, 408 insertions(+), 42 deletions(-) > create mode 100644 jpa/eclipselink.jpa.test/resource/wildfly/eclipselink-module-template.xsl > create mode 100644 jpa/eclipselink.jpa.test/wildfly.properties > create mode 100644 jpa/eclipselink.jpa.test/wildfly.xml > >diff --git a/jpa/eclipselink.jpa.test/antbuild.xml b/jpa/eclipselink.jpa.test/antbuild.xml >index b7ad8e34aa..664ab7d4d3 100644 >--- a/jpa/eclipselink.jpa.test/antbuild.xml >+++ b/jpa/eclipselink.jpa.test/antbuild.xml >@@ -198,7 +198,10 @@ > </condition> > <!-- This checks if the Application Server is JBoss --> > <condition property="is.jboss"> >- <contains string="${server.name}" substring="jboss"/> >+ <or> >+ <contains string="${server.name}" substring="jboss"/> >+ <contains string="${server.name}" substring="wildfly"/> >+ </or> > </condition> > > <!-- This checks if the Application Server is WebSphere --> >@@ -234,15 +237,15 @@ > <fileset dir="${spring.jlib.dir}" includes="${spring.jlib}"/> > <pathelement path="."/> > </path> >- <!-- This checks if the Apllication Server is applicable to run oracle jpa/customfeatures model on oracle db--> >+ <!-- This checks if the Aplication Server is applicable to run oracle jpa/customfeatures model on oracle db--> > <condition property="run.jpa.customfeatures.model"> > <and> > <contains string="${db.driver}" substring="oracle"/> > <or> >- <contains string="${server.name}" substring="weblogic"/> >- <!--contains string="${server.name}" substring="websphere"/--> >- <contains string="${server.name}" substring="jboss"/> >- <contains string="${server.name}" substring="glassfish"/> >+ <istrue value="${is.weblogic}"/> >+ <!--istrue value="${is.websphere}"/--> >+ <istrue value="${is.jboss}"/> >+ <istrue value="${is.glassfish}"/> > </or> > </and> > </condition> >@@ -269,35 +272,23 @@ > <isset property="is.jboss"/> > </or> > </condition> >- <condition property="SERVER.TESTRUNNER" value="${MODEL_NAME}/${server.testrunner}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner}"> >+ <isset property="is.jboss"/> > </condition> >- <condition property="SERVER.TESTRUNNER1" value="${MODEL_NAME}/${server.testrunner1}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER1" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner1}"> >+ <isset property="is.jboss"/> > </condition> >- <condition property="SERVER.TESTRUNNER2" value="${MODEL_NAME}/${server.testrunner2}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER2" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner2}"> >+ <isset property="is.jboss"/> > </condition> >- <condition property="SERVER.TESTRUNNER3" value="${MODEL_NAME}/${server.testrunner3}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER3" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner3}"> >+ <isset property="is.jboss"/> > </condition> >- <condition property="SERVER.TESTRUNNER4" value="${MODEL_NAME}/${server.testrunner4}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER4" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner4}"> >+ <isset property="is.jboss"/> > </condition> >- <condition property="SERVER.TESTRUNNER5" value="${MODEL_NAME}/${server.testrunner5}"> >- <and> >- <isset property="is.jboss"/> >- </and> >+ <condition property="SERVER.TESTRUNNER5" value="${MODEL_NAME}/${MODEL_NAME}_ejb/${server.testrunner5}"> >+ <isset property="is.jboss"/> > </condition> > <property name="SERVER.URL" value="${server.url}${MODEL_NAME}"/> > <property name="SERVER.TESTRUNNER" value="${server.testrunner}"/> >@@ -308,7 +299,7 @@ > <property name="SERVER.TESTRUNNER5" value="${server.testrunner5}"/> > > <condition property="DS_NAME" value="java:/EclipseLinkDS"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="DS_NAME" value="jdbc/EclipseLinkDS"> > <not> >@@ -317,7 +308,7 @@ > </condition> > > <condition property="DS2_NAME" value="java:/EclipseLinkDS2"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="DS2_NAME" value="jdbc/EclipseLinkDS2"> > <not> >@@ -326,7 +317,7 @@ > </condition> > > <condition property="DS3_NAME" value="java:/EclipseLinkDS3"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="DS3_NAME" value="jdbc/EclipseLinkDS3"> > <not> >@@ -335,7 +326,7 @@ > </condition> > > <condition property="NONJTA_DS_NAME" value="java:/ELNonJTADS"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="NONJTA_DS_NAME" value="jdbc/ELNonJTADS"> > <not> >@@ -344,7 +335,7 @@ > </condition> > > <condition property="NONJTA_DS2_NAME" value="java:/ELNonJTADS2"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="NONJTA_DS2_NAME" value="jdbc/ELNonJTADS2"> > <not> >@@ -353,7 +344,7 @@ > </condition> > > <condition property="NONJTA_DS3_NAME" value="java:/ELNonJTADS3"> >- <contains string="${server.name}" substring="jboss"/> >+ <isset property="is.jboss"/> > </condition> > <condition property="NONJTA_DS3_NAME" value="jdbc/ELNonJTADS3"> > <not> >@@ -917,13 +908,13 @@ > </target> > > <!-- Packages JPA persistent unit test jars. --> >- <target name="package" depends="config-classpath, package-annotation, package-ddl, package-xml-only, package-xml-merge, package-jpa21-model, >- package-jpa22-model, package-xml-extended, package-validation-failed, package-jpa-advanced-field-access, package-jpa-advanced-properties, >- package-jpa-pu_with_spaces, package-partitioned, package-plsql, package-jpa-performance, package-jpa-performance2, package-cascade-deletes, >- package-jpa-metamodel, package-delimited, package-beanvalidation, package-beanvalidation-dynamic, package-composite-advanced, >- package-composite-advanced-member_1, package-composite-advanced-member_2, package-composite-advanced-member_3, package-xml-composite-advanced, >+ <target name="package" depends="config-classpath, package-annotation, package-ddl, package-xml-only, package-xml-merge, package-jpa21-model, >+ package-jpa22-model, package-xml-extended, package-validation-failed, package-jpa-advanced-field-access, package-jpa-advanced-properties, >+ package-jpa-pu_with_spaces, package-partitioned, package-plsql, package-jpa-performance, package-jpa-performance2, package-cascade-deletes, >+ package-jpa-metamodel, package-delimited, package-beanvalidation, package-beanvalidation-dynamic, package-composite-advanced, >+ package-composite-advanced-member_1, package-composite-advanced-member_2, package-composite-advanced-member_3, package-xml-composite-advanced, > package-xml-composite-advanced-member_1, package-xml-composite-advanced-member_2, package-xml-composite-advanced-member_3, >- package-xml-extended-composite-advanced, package-xml-extended-composite-advanced-member_1, package-xml-extended-composite-advanced-member_2, >+ package-xml-extended-composite-advanced, package-xml-extended-composite-advanced-member_1, package-xml-extended-composite-advanced-member_2, > package-xml-extended-composite-advanced-member_3, package-extensibility, package-jpa-remote, package-identity-model, > package-xml-mapping-metadata-complete" description="build EclipseLink jar"> > <jar jarfile="${jpatest.basedir}/${jpatest.framework.jar}"> >diff --git a/jpa/eclipselink.jpa.test/resource/wildfly/eclipselink-module-template.xsl b/jpa/eclipselink.jpa.test/resource/wildfly/eclipselink-module-template.xsl >new file mode 100644 >index 0000000000..244cc28a2d >--- /dev/null >+++ b/jpa/eclipselink.jpa.test/resource/wildfly/eclipselink-module-template.xsl >@@ -0,0 +1,93 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!--/******************************************************************************* >+* Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved. >+* This program and the accompanying materials are made available under the >+* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+* which accompanies this distribution. >+* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+* and the Eclipse Distribution License is available at >+* http://www.eclipse.org/org/documents/edl-v10.php. >+* >+* Contributors: >+* Lukas - initial API and implementation >+#******************************************************************************/--> >+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="urn:jboss:module:1.5"> >+ <xsl:output method="xml" indent="yes" xalan:indent-amount="4" xmlns:xalan="http://xml.apache.org/xalan" /> >+ <xsl:param name="separator" select="':'"/> >+ <!-- '$separator' delimited list of resources/jars --> >+ <xsl:param name="resources" select="''"/> >+ <xsl:param name="dependencies" select="''"/> >+ >+ <xsl:template match="@* | node()"> >+ <xsl:copy> >+ <xsl:apply-templates select="@* | node()"/> >+ </xsl:copy> >+ </xsl:template> >+ >+ <xsl:template match="*[local-name() = 'resources']"> >+ <xsl:element name="resources"> >+ <xsl:for-each select="*[local-name() = 'resource-root']"> >+ <xsl:copy-of select="."/> >+ </xsl:for-each> >+ <xsl:call-template name="tokenize"> >+ <xsl:with-param name="text" select="normalize-space($resources)"/> >+ <xsl:with-param name="elName" select="'resource-root'"/> >+ <xsl:with-param name="attrName" select="'path'"/> >+ </xsl:call-template> >+ </xsl:element> >+ </xsl:template> >+ >+ <xsl:template match="*[local-name() = 'dependencies']"> >+ <xsl:element name="dependencies"> >+ <xsl:for-each select="*[local-name() = 'module']"> >+ <xsl:copy-of select="."/> >+ </xsl:for-each> >+ <xsl:call-template name="tokenize"> >+ <xsl:with-param name="text" select="normalize-space($dependencies)"/> >+ <xsl:with-param name="elName" select="'module'"/> >+ <xsl:with-param name="attrName" select="'name'"/> >+ </xsl:call-template> >+ </xsl:element> >+ </xsl:template> >+ >+ <xsl:template name="tokenize"> >+ <xsl:param name="text"/> >+ <xsl:param name="elName"/> >+ <xsl:param name="attrName"/> >+ <xsl:param name="s" select="$separator"/> >+ <xsl:if test="$text != ''"> >+ <xsl:choose> >+ <xsl:when test="not(contains($text, $s))"> >+ <xsl:if test="not(//*[@path=$text])"> >+ <xsl:element name="{$elName}"> >+ <xsl:attribute name="{$attrName}"> >+ <xsl:value-of select="normalize-space($text)"/> >+ </xsl:attribute> >+ <xsl:if test="$elName = 'module'"> >+ <xsl:attribute name="export">true</xsl:attribute> >+ </xsl:if> >+ </xsl:element> >+ </xsl:if> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:variable name="norm" select="normalize-space(substring-before($text, $s))"/> >+ <xsl:if test="not(//*[@path=$norm])"> >+ <xsl:element name="{$elName}"> >+ <xsl:attribute name="{$attrName}"> >+ <xsl:value-of select="$norm"/> >+ </xsl:attribute> >+ <xsl:if test="$elName = 'module'"> >+ <xsl:attribute name="export">true</xsl:attribute> >+ </xsl:if> >+ </xsl:element> >+ </xsl:if> >+ <xsl:call-template name="tokenize"> >+ <xsl:with-param name="text" select="normalize-space(substring-after($text, $s))"/> >+ <xsl:with-param name="elName" select="$elName"/> >+ <xsl:with-param name="attrName" select="$attrName"/> >+ </xsl:call-template> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:if> >+ </xsl:template> >+</xsl:stylesheet> >\ No newline at end of file >diff --git a/jpa/eclipselink.jpa.test/wildfly.properties b/jpa/eclipselink.jpa.test/wildfly.properties >new file mode 100644 >index 0000000000..2b3c598872 >--- /dev/null >+++ b/jpa/eclipselink.jpa.test/wildfly.properties >@@ -0,0 +1,37 @@ >+## JBoss Server Testing Environment Properties. >+ >+## Standard server properties. >+server.platform=JBoss >+server.platform.class=jboss-platform >+server.factory=org.jboss.naming.remote.client.InitialContextFactory >+java.naming.factory.url.pkgs=org.jboss.ejb.client.naming >+server.depend=jboss-client.jar >+ >+wildfly.server=${wildfly.home} >+server.lib=${wildfly.home}/bin/client >+server.url=http-remoting://localhost:8080/ >+server.user=admin >+server.pwd=admin >+ >+## WildFly specific properties. >+wildfly.home=/Users/lukas/java/wildfly-11.0.0.Final >+wildfly.config=standalone-full.xml >+ >+server.testrunner=TestRunner!org.eclipse.persistence.testing.framework.server.TestRunner >+server.testrunner1=TestRunner1!org.eclipse.persistence.testing.framework.server.TestRunner1 >+server.testrunner2=TestRunner2!org.eclipse.persistence.testing.framework.server.TestRunner2 >+server.testrunner3=TestRunner3!org.eclipse.persistence.testing.framework.server.TestRunner3 >+server.testrunner4=TestRunner4!org.eclipse.persistence.testing.framework.server.TestRunner4 >+server.testrunner5=TestRunner5!org.eclipse.persistence.testing.framework.server.TestRunner5 >+server.testrunner.wdf=ServerTestRunner/remote-org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner >+persistence10.jar=${jboss.home}/common/lib/ejb3-persistence.jar >+ >+# The following only for JBoss-eap 5.0 testing,and it actually point to JPA1.0 unsigned jar (javax.persistence_unsigned_for_testing_1.0.0.jar), >+# and this jar will be added at very beginning of client classpath >+server.persistence20.lib=${jboss.server}/lib >+server.persistence20.jar=${persistence10.jar} >+ >+wildfly.jtaDs.name=EclipseLinkDS >+wildfly.nonJtaDs.name=ELNonJTADS >+wildfly.jtaDs.jndi=java:/${wildfly.jtaDs.name} >+wildfly.nonJtaDs.jndi=java:/${wildfly.nonJtaDs.name} >diff --git a/jpa/eclipselink.jpa.test/wildfly.xml b/jpa/eclipselink.jpa.test/wildfly.xml >new file mode 100644 >index 0000000000..f47d01a08d >--- /dev/null >+++ b/jpa/eclipselink.jpa.test/wildfly.xml >@@ -0,0 +1,245 @@ >+<!--/******************************************************************************* >+* This program and the accompanying materials are made available under the >+* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 >+* which accompanies this distribution. >+* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html >+* and the Eclipse Distribution License is available at >+* http://www.eclipse.org/org/documents/edl-v10.php. >+* >+* Ant naming conventions: >+* - regardless of the actual OS platform,'/' is the directory separator >+* (Ant will convert as appropriate). >+* - multi-word properties use periods '.' >+* - properties ending in .jar define jarfile names only (no path) >+* - properties ending in .lib are fully qualified jars (path and filename) >+* - properties ending in .dir are directory paths >+* - properties ending in .path are path refid names (classpath fragments) >+* - multi-word targets use hyphens '-' >+* - targets beginning with test- are reserved for high level test targets, >+* and are used in test results parsing >+* - targets typically use the form <action>-<object>-<type> (ie. package-bundle-zip) >+* - multi-word macros use underscores '_' >+* - multi-word macro attributes are concatenated >+* e.g. 'runpathref' >+* - multi-word tasks (taskdef) names are concatenated >+* e.g. 'validateconnection' >+* - OS environment variables are in ALLCAPS and have 'env' as a prefix >+* e.g. ${env.XXX}. >+* - Ant properties are lower case. >+* >+* Contributors: >+* Lukas - initial API and implementation >+#******************************************************************************/--> >+ >+<!-- This ant project includes the following tasks: >+ - wildfly-install : install binary and drivers on the server >+ - wildfly-setup : creates connection pools and prepares environment for tests >+ - wildfly-reset : removes connection pool, cleans up installation >+ - wildfly-start : starts server >+ - wildfly-stop : stops server >+ - wildfly-deploy : deploys ear >+ - wildfly-undeploy : undeploys ear >+ >+ It requires some configuration of the wildfly.properties, it should be run through antbuild.xml, not directly. >+ To connect to the wildfly admin console use http://localhost:9990/console/App.html, >+ this may be useful for debugging deployment failures. >+ Sometimes if a test or deployment fails, your server gets screwed up >+ and you need to re-install your domain (ant -f antbuld.xml server-reset server-install server-setup). >+--> >+ >+<project name="Eclipse Persistence Services JPA Wildfly Testing" basedir="."> >+ >+ <property name="env" environment="env" value="env"/> >+ <!-- Allows a user to overide certain user specific properties. --> >+ <property file="${user.home}/wildfly.properties"/> >+ <property file="./wildfly.properties"/> >+ >+ <property name="jdbc.driver.lib" value="${jdbc.driver.jar}"/> >+ <property name="w.jpa.api.jar" value="${persistence22.jar}"/> >+ <path id="eclipselink.lib"> >+ <fileset dir="${jpatest.basedir}/../../plugins/"> >+ <include name="org.eclipse.persistence.*"/> >+ <exclude name="*.source_*"/> >+ </fileset> >+ <pathelement location="${jpatest.2.sdo.plugins.dir}/${commonj.sdo.jar}"/> >+ </path> >+ >+ <!-- Set db name by check db.driver --> >+ <condition property="db.name" value="oracle"> >+ <contains string="${db.driver}" substring="oracle"/> >+ </condition> >+ >+ <condition property="db.name" value="mysql"> >+ <contains string="${db.driver}" substring="mysql"/> >+ </condition> >+ >+ <condition property="db.name" value="mssql"> >+ <contains string="${db.driver}" substring="sqlserver"/> >+ </condition> >+ >+ <condition property="db.name" value="db2"> >+ <contains string="${db.driver}" substring="db2"/> >+ </condition> >+ >+ <condition property="db.name" value="sybase"> >+ <contains string="${db.driver}" substring="sybase"/> >+ </condition> >+ >+ <condition property="is.eap"> >+ <contains string="${server.version}" substring="eap"/> >+ </condition> >+ >+ <!-- JVM used to run tests --> >+ <property name="test.junit.jvm" value="${env.JAVA_HOME}"/> >+ <property name="test.junit.jvm.exec" value="${test.junit.jvm}/bin/java"/> >+ >+ <property name="wildfly.modules.dir" location="${wildfly.home}/modules/system/layers/base"/> >+ >+ <target name="-backup-init"> >+ <condition property="do.backup"> >+ <not> >+ <available file="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml.bak"/> >+ </not> >+ </condition> >+ </target> >+ >+ <target name="-do-backup" description="Backup org.eclipse.persistence module definition." depends="-backup-init" if="do.backup"> >+ <move file="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml" tofile="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml.bak"/> >+ <copy file="${wildfly.modules.dir}/javax/persistence/api/main/module.xml" tofile="${wildfly.modules.dir}/javax/persistence/api/main/module.xml.bak"/> >+ </target> >+ >+ <target name="-wildfly-cli-init" description="Initialize 'cli' macro for jboss-cli."> >+ <condition property="is.windows" value="true"> >+ <os family="windows"/> >+ </condition> >+ <condition property="is.unix" value="true"> >+ <os family="unix"/> >+ </condition> >+ <condition property="suffix" value="bat"> >+ <isset property="is.windows"/> >+ </condition> >+ <condition property="suffix" value="sh"> >+ <isset property="is.unix"/> >+ </condition> >+ >+ <macrodef name="cli" description="Run ${wildfly.home}/bin/jboss-cli.${suffix}"> >+ <attribute name="command"/> >+ <sequential> >+ <echo>Executing command: @{command}</echo> >+ <exec executable="${wildfly.home}/bin/jboss-cli.${suffix}" dir="${basedir}" resultproperty="cli.result"> >+ <env key="JAVA_HOME" value="${test.junit.jvm}"/> >+ <env key="JBOSS_HOME" value="${wildfly.home}"/> >+ <arg value="--connect"/> >+ <arg value="command=@{command}"/> >+ </exec> >+ <echo> ==> Execution result: ${cli.result}</echo> >+ </sequential> >+ </macrodef> >+ </target> >+ >+ <target name="wildfly-install" description="Install binaries on the server." depends="-do-backup,-wildfly-cli-init"> >+ <pathconvert property="eclipselink.jars" refid="eclipselink.lib" pathsep=":"> >+ <flattenmapper/> >+ </pathconvert> >+ <pathconvert property="junit.jars" pathsep=":"> >+ <path path="${junit.lib}"/> >+ <flattenmapper/> >+ </pathconvert> >+ <xslt style="resource/wildfly/eclipselink-module-template.xsl" in="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml.bak" out="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml" force="true"> >+ <param name="resources" expression="${eclipselink.jars}"/> >+ <param name="dependencies" expression="com.${db.name}:junit.junit"/> >+ </xslt> >+ <copy todir="${wildfly.modules.dir}/org/eclipse/persistence/main" flatten="true"> >+ <path refid="eclipselink.lib"/> >+ </copy> >+ <replaceregexp file="${wildfly.modules.dir}/javax/persistence/api/main/module.xml" match="hibernate-.*jar" replace="${w.jpa.api.jar}" byline="true"/> >+ <copy todir="${wildfly.modules.dir}/javax/persistence/api/main" file="${jpatest.2.jpa.plugins.dir}/${w.jpa.api.jar}" verbose="true"/> >+ >+ <antcall target="wildfly-start"/> >+ <!-- JDBC Driver --> >+ <cli command="module add --name=com.${db.name} --resources=${jdbc.driver.lib} --dependencies=javax.api,javax.transaction.api --module-root-dir=${wildfly.modules.dir}"/> >+ <!-- JUnit --> >+ <cli command="module add --name=junit.junit --resources=${junit.lib} --module-root-dir=${wildfly.modules.dir}"/> >+ >+ <cli command=":reload"/> >+ </target> >+ >+ <target name="wildfly-setup" description="Create datasources and JDBC driver definition on the Wildfly server." depends="-wildfly-cli-init"> >+ <cli command="/subsystem=datasources/jdbc-driver=${db.name}Driver:add(driver-name=${db.name}Driver,driver-module-name=com.${db.name},driver-class-name=${db.driver})"/> >+ <cli command=":reload"/> >+ >+ <property name="w.ds.name" value="${wildfly.jtaDs.name}${db.name}Pool"/> >+ <echo>Setting up ${w.ds.name}</echo> >+ <cli command="data-source add --jndi-name=${wildfly.jtaDs.jndi} --name=${w.ds.name} --connection-url=${db.url} --driver-name=${db.name}Driver --user-name=${db.user} â-password=${db.pwd} --jta=true --enabled=true"/> >+ <cli command="/subsystem=datasources/data-source=${w.ds.name}:write-attribute(name=password,value=${db.pwd})"/> >+ >+ <property name="w.nonjtads.name" value="${wildfly.nonJtaDs.name}${db.name}Pool"/> >+ <echo>Setting up ${w.nonjtads.name}</echo> >+ <cli command="data-source add --jndi-name=${wildfly.nonJtaDs.jndi} --name=${w.nonjtads.name} --connection-url=${db.url} --driver-name=${db.name}Driver --user-name=${db.user} â-password=${db.pwd} --jta=true --enabled=true"/> >+ <cli command="/subsystem=datasources/data-source=${w.nonjtads.name}:write-attribute(name=password,value=${db.pwd})"/> >+ <cli command=":reload"/> >+ >+ <cli command="/system-property=eclipselink.archive.factory:add(value=org.jipijapa.eclipselink.JBossArchiveFactoryImpl)"/> >+ <cli command=":reload"/> >+ </target> >+ >+ <target name="wildfly-reset" description="Revert all modifications on the server done by install/setup." depends="-wildfly-cli-init,wildfly-start"> >+ <!-- DataSources --> >+ <cli command="data-source remove --name=${wildfly.jtaDs.name}${db.name}Pool"/> >+ <cli command="data-source remove --name=${wildfly.nonJtaDs.name}${db.name}Pool"/> >+ <cli command=":reload"/> >+ >+ <cli command="/subsystem=datasources/jdbc-driver=${db.name}Driver:remove"/> >+ <cli command="/system-property=eclipselink.archive.factory:remove"/> >+ <cli command=":reload"/> >+ >+ <!-- JDBC Driver --> >+ <cli command="module remove --name=com.${db.name} --module-root-dir=${wildfly.modules.dir}"/> >+ <!-- JUnit --> >+ <cli command="module remove --name=junit.junit --module-root-dir=${wildfly.modules.dir}"/> >+ >+ <move file="${wildfly.modules.dir}/javax/persistence/api/main/module.xml.bak" tofile="${wildfly.modules.dir}/javax/persistence/api/main/module.xml" failonerror="false" verbose="true" overwrite="true"/> >+ <delete file="${wildfly.modules.dir}/javax/persistence/api/main/${w.jpa.api.jar}" failonerror="false"/> >+ >+ <move file="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml.bak" tofile="${wildfly.modules.dir}/org/eclipse/persistence/main/module.xml" failonerror="false" verbose="true" overwrite="true"/> >+ <pathconvert property="delete.eclipselink.jars" refid="eclipselink.lib" pathsep=","> >+ <flattenmapper/> >+ </pathconvert> >+ <delete failonerror="false"> >+ <fileset dir="${wildfly.modules.dir}/org/eclipse/persistence/main" includes="${delete.eclipselink.jars}"/> >+ </delete> >+ <cli command=":reload"/> >+ </target> >+ >+ <target name="wildfly-start" description="Start the server." depends="-wildfly-cli-init"> >+ <property name="additional.server.args" value=""/> >+ <property name="additional.server.jvmOpts" value="-Xms64m -Xmx1g -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=2g -Djava.net.preferIPv4Stack=true"/> >+ <property name="w.jvmOpts" value="-Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"/> >+ <exec executable="${wildfly.home}/bin/standalone.${suffix}" spawn="true"> >+ <env key="JAVA_HOME" value="${test.junit.jvm}"/> >+ <env key="JBOSS_HOME" value="${wildfly.home}"/> >+ <env key="JBOSS_MODULES_SYSTEM_PKGS" value="org.jboss.byteman"/> >+ <env key="JAVA_OPTS" value="${additional.server.jvmOpts} ${w.jvmOpts}"/> >+ <arg value="--server-config=${wildfly.config}"/> >+ <arg line="${additional.server.args}"/> >+ </exec> >+ <waitfor maxwait="3" maxwaitunit="minute" checkevery="500" timeoutproperty="wildfly.not.running"> >+ <http url="http://localhost:8080/index.html"/> >+ </waitfor> >+ <fail if="wildfly.not.running" message="Wildfly did not start within given time"/> >+ <echo>Wildfly is runnig at http://localhost:8080/index.html</echo> >+ </target> >+ >+ <target name="wildfly-stop" description="Stop the server." depends="-wildfly-cli-init"> >+ <cli command=":shutdown"/> >+ </target> >+ >+ <target name="wildfly-deploy" description="Deploy the application ear to the server." depends="-wildfly-cli-init"> >+ <cli command="deploy ${ear.name} --force"/> >+ </target> >+ >+ <target name="wildfly-undeploy" description="Undeploy the application ear frpm the server." depends="-wildfly-cli-init"> >+ <cli command="undeploy ${application.name}.ear"/> >+ </target> >+ >+</project> >-- >2.14.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 527610
:
271583
|
271584