HHH-11019 - Extend DelayedPostInsertIdentifier support to include checks for FlushMode (EXTENDED PC) - support for testing inside WildFly leveraging Arquilian and hibernate-orm-modules
This commit is contained in:
parent
0de0ff0322
commit
1378708088
|
@ -59,6 +59,11 @@ ext {
|
||||||
baselineJavaVersion = '1.8'
|
baselineJavaVersion = '1.8'
|
||||||
|
|
||||||
osgiExportVersion = hibernateTargetVersion.replaceAll( '-SNAPSHOT', '.SNAPSHOT' )
|
osgiExportVersion = hibernateTargetVersion.replaceAll( '-SNAPSHOT', '.SNAPSHOT' )
|
||||||
|
|
||||||
|
final String[] versionComponents = hibernateTargetVersion.split( '\\.' );
|
||||||
|
hibernateFullVersion = hibernateTargetVersion
|
||||||
|
hibernateMajorMinorVersion = versionComponents[0] + '.' + versionComponents[1]
|
||||||
|
hibernateMajorVersion = versionComponents[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
|
|
|
@ -290,9 +290,6 @@ task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String[] versionComponents = version.split( '\\.' );
|
|
||||||
final String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
|
|
||||||
|
|
||||||
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
|
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
|
||||||
|
@ -302,7 +299,7 @@ task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
|
||||||
backends "html5"
|
backends "html5"
|
||||||
separateOutputDirs false
|
separateOutputDirs false
|
||||||
options logDocuments: true
|
options logDocuments: true
|
||||||
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true, stylesheet: "css/hibernate.css", majorMinorVersion: majorMinorVersion
|
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true, stylesheet: "css/hibernate.css", majorMinorVersion: rootProject.hibernateMajorMinorVersion
|
||||||
resources {
|
resources {
|
||||||
from('src/main/asciidoc/userguide/') {
|
from('src/main/asciidoc/userguide/') {
|
||||||
include 'images/**'
|
include 'images/**'
|
||||||
|
@ -325,7 +322,7 @@ task renderIntegrationGuide(type: AsciidoctorTask, group: 'Documentation') {
|
||||||
backends "html5"
|
backends "html5"
|
||||||
separateOutputDirs false
|
separateOutputDirs false
|
||||||
options logDocuments: true
|
options logDocuments: true
|
||||||
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true, stylesheet: "css/hibernate.css", majorMinorVersion: majorMinorVersion
|
attributes icons: 'font', experimental: true, 'source-highlighter': 'prettify', linkcss: true, stylesheet: "css/hibernate.css", majorMinorVersion: rootProject.hibernateMajorMinorVersion
|
||||||
resources {
|
resources {
|
||||||
from('src/main/asciidoc/integrationguide/') {
|
from('src/main/asciidoc/integrationguide/') {
|
||||||
include 'images/**'
|
include 'images/**'
|
||||||
|
|
|
@ -16,15 +16,25 @@ buildDir = "target"
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
// Exact ORM version, e.g. "5.1.1.Final"
|
// Exact ORM version, e.g. "5.1.1.Final"
|
||||||
slot = rootProject.hibernateTargetVersion
|
slot = rootProject.hibernateFullVersion
|
||||||
|
|
||||||
// Just the minor ORM version, e.g. "5.1"; Is used as an alias for the exact version
|
// Just the minor ORM version, e.g. "5.1"; Is used as an alias for the exact version
|
||||||
minorSlot = slot.substring( 0, slot.indexOf( ".", slot.indexOf( "." ) + 1) )
|
minorSlot = rootProject.hibernateMajorMinorVersion
|
||||||
majorWildflyVersion = wildflyVersion.substring( 0, wildflyVersion.indexOf( "." ) )
|
|
||||||
artifactClassifier = "wildfly-${majorWildflyVersion}-dist"
|
|
||||||
|
|
||||||
modulesXmlDir = "$buildDir/tmp/modules"
|
final String[] wildFlyVersionComponents = wildflyVersion.split( '\\.' );
|
||||||
|
|
||||||
|
// e.g. "10" for WildFly 10.x
|
||||||
|
wildFlyMajorVersion = wildFlyVersionComponents[0];
|
||||||
|
|
||||||
|
artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist"
|
||||||
|
|
||||||
|
moduleXmlStagingDir = file( "$buildDir/tmp/modules" )
|
||||||
|
|
||||||
|
wildFlyInstallDir = file( "${rootProject.buildDir}/" )
|
||||||
|
}
|
||||||
|
|
||||||
|
mavenPom {
|
||||||
|
name = "Hibernate ORM modules for WildFly ${wildFlyMajorVersion}"
|
||||||
|
description = "Hibernate ORM modules for WildFly ${wildFlyMajorVersion}"
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
@ -48,10 +58,14 @@ dependencies {
|
||||||
testCompile libraries.wildfly_arquillian_container_managed
|
testCompile libraries.wildfly_arquillian_container_managed
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyModulesXml(type: Copy) {
|
|
||||||
// NOTE : we do a separate Copy task for the modules XML files to apply token-replacements
|
|
||||||
|
|
||||||
into modulesXmlDir
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// tasks related to creating and publishing the module zip
|
||||||
|
|
||||||
|
task copyAndExpandModuleXml(type: Copy) {
|
||||||
|
description 'Performs a copy of the XML files defining the module into a staging directory for the purpose of performing token-replacement'
|
||||||
|
|
||||||
|
into moduleXmlStagingDir
|
||||||
expand( slot: slot, minorSlot: minorSlot, version: rootProject.hibernateTargetVersion, wildflyVersion: wildflyVersion )
|
expand( slot: slot, minorSlot: minorSlot, version: rootProject.hibernateTargetVersion, wildflyVersion: wildflyVersion )
|
||||||
|
|
||||||
into( 'org/hibernate/' + slot ) {
|
into( 'org/hibernate/' + slot ) {
|
||||||
|
@ -80,11 +94,11 @@ task copyModulesXml(type: Copy) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task createModulesZip(type: Zip, dependsOn: [copyModulesXml]) {
|
task createModulesZip(type: Zip, dependsOn: [copyAndExpandModuleXml]) {
|
||||||
baseName = 'hibernate-orm-modules'
|
baseName 'hibernate-orm-modules'
|
||||||
classifier = artifactClassifier
|
classifier artifactClassifier
|
||||||
|
|
||||||
from modulesXmlDir
|
from moduleXmlStagingDir
|
||||||
|
|
||||||
into( 'org/hibernate/' + slot ) {
|
into( 'org/hibernate/' + slot ) {
|
||||||
from parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
from parent.project( 'hibernate-core' ).configurations.archives.allArtifacts.files
|
||||||
|
@ -100,11 +114,6 @@ task createModulesZip(type: Zip, dependsOn: [copyModulesXml]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mavenPom {
|
|
||||||
name = "Hibernate ORM modules for WildFly ${majorWildflyVersion}"
|
|
||||||
description = "Hibernate ORM modules for WildFly ${majorWildflyVersion}"
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenZip( MavenPublication ) {
|
mavenZip( MavenPublication ) {
|
||||||
|
@ -118,9 +127,9 @@ publishing {
|
||||||
build.dependsOn createModulesZip
|
build.dependsOn createModulesZip
|
||||||
|
|
||||||
|
|
||||||
/*************************/
|
|
||||||
/* Testing */
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
/*************************/
|
// tasks related to in-container (Arquillian + WF) testing
|
||||||
|
|
||||||
if ( JavaVersion.current().isJava9Compatible() ) {
|
if ( JavaVersion.current().isJava9Compatible() ) {
|
||||||
logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" )
|
logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" )
|
||||||
|
@ -128,28 +137,27 @@ if ( JavaVersion.current().isJava9Compatible() ) {
|
||||||
test.enabled = false
|
test.enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
task installWildFly(type: Copy) {
|
||||||
systemProperties['jboss.socket.binding.port-offset'] = 137
|
description = 'Downloads the WildFly distribution and installs it into a local directory (if needed)'
|
||||||
}
|
|
||||||
|
|
||||||
// Unzip Wildfly Dist
|
|
||||||
task extractWildFly(type: Copy) {
|
|
||||||
from {
|
from {
|
||||||
configurations.wildflyDist.collect { zipTree(it) }
|
configurations.wildflyDist.collect { zipTree(it) }
|
||||||
}
|
}
|
||||||
into "$buildDir/"
|
into wildFlyInstallDir
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unzip Hibernate ORM Modules ZIP into the server's "modules" dir
|
task installHibernateModule( type:Copy, dependsOn: [createModulesZip, installWildFly]) {
|
||||||
task extractModules(dependsOn: [extractWildFly, createModulesZip], type: Copy) {
|
|
||||||
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
||||||
from zipTree( createModulesZip.archivePath )
|
from zipTree( createModulesZip.archivePath )
|
||||||
into "$buildDir/wildfly-${wildflyVersion}/modules"
|
into "${wildFlyInstallDir}/wildfly-${wildflyVersion}/modules"
|
||||||
}
|
}
|
||||||
|
|
||||||
test.dependsOn extractModules
|
task prepareWildFlyForTests( dependsOn: [installWildFly, installHibernateModule])
|
||||||
|
|
||||||
|
test.dependsOn prepareWildFlyForTests
|
||||||
|
|
||||||
processTestResources {
|
processTestResources {
|
||||||
expand( buildDir: buildDir.getName(), wildflyVersion: wildflyVersion )
|
expand( buildDir: wildFlyInstallDir, wildflyVersion: wildflyVersion )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,16 @@
|
||||||
<container qualifier="container.active-1" mode="suite" default="true">
|
<container qualifier="container.active-1" mode="suite" default="true">
|
||||||
<configuration>
|
<configuration>
|
||||||
<property name="jbossHome">${buildDir}/wildfly-${wildflyVersion}</property>
|
<property name="jbossHome">${buildDir}/wildfly-${wildflyVersion}</property>
|
||||||
<property name="javaVmArguments">-Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1 -Djboss.socket.binding.port-offset=137</property>
|
<property name="javaVmArguments">
|
||||||
|
-Djava.net.preferIPv4Stack=true
|
||||||
|
-Djgroups.bind_addr=127.0.0.1
|
||||||
|
-Djboss.socket.binding.port-offset=137
|
||||||
|
|
||||||
<!-- Uncomment for Remote debugging Wildfly -->
|
<!-- Uncomment for Remote debugging Wildfly -->
|
||||||
<!--
|
<!--
|
||||||
<property name="javaVmArguments">-Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1 -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y</property>
|
-Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y
|
||||||
-->
|
-->
|
||||||
|
</property>
|
||||||
</configuration>
|
</configuration>
|
||||||
</container>
|
</container>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -17,10 +17,6 @@ buildDir = "target"
|
||||||
idea.module {
|
idea.module {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final String[] versionComponents = version.split( '\\.' );
|
|
||||||
final String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
|
|
||||||
|
|
||||||
final File documentationDir = mkdir( "${project.buildDir}/documentation" );
|
final File documentationDir = mkdir( "${project.buildDir}/documentation" );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +70,7 @@ task assembleDocumentation(type: Task, dependsOn: [rootProject.project( 'documen
|
||||||
task uploadDocumentation(type:Exec, dependsOn: assembleDocumentation) {
|
task uploadDocumentation(type:Exec, dependsOn: assembleDocumentation) {
|
||||||
description = "Uploads documentation to the JBoss doc server"
|
description = "Uploads documentation to the JBoss doc server"
|
||||||
|
|
||||||
final String url = "filemgmt.jboss.org:/docs_htdocs/hibernate/orm/${majorMinorVersion}";
|
final String url = "filemgmt.jboss.org:/docs_htdocs/hibernate/orm/${rootProject.hibernateMajorMinorVersion}";
|
||||||
|
|
||||||
executable 'rsync'
|
executable 'rsync'
|
||||||
args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url
|
args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url
|
||||||
|
|
Loading…
Reference in New Issue