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:
Steve Ebersole 2016-08-05 10:08:35 -05:00
parent 0de0ff0322
commit 1378708088
5 changed files with 57 additions and 47 deletions

View File

@ -59,6 +59,11 @@ ext {
baselineJavaVersion = '1.8'
osgiExportVersion = hibernateTargetVersion.replaceAll( '-SNAPSHOT', '.SNAPSHOT' )
final String[] versionComponents = hibernateTargetVersion.split( '\\.' );
hibernateFullVersion = hibernateTargetVersion
hibernateMajorMinorVersion = versionComponents[0] + '.' + versionComponents[1]
hibernateMajorVersion = versionComponents[0]
}
idea {

View File

@ -290,9 +290,6 @@ task renderMappingGuide(type: AsciidoctorTask, group: 'Documentation') {
}
}
final String[] versionComponents = version.split( '\\.' );
final String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
@ -302,7 +299,7 @@ task renderUserGuide(type: AsciidoctorTask, group: 'Documentation') {
backends "html5"
separateOutputDirs false
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 {
from('src/main/asciidoc/userguide/') {
include 'images/**'
@ -325,7 +322,7 @@ task renderIntegrationGuide(type: AsciidoctorTask, group: 'Documentation') {
backends "html5"
separateOutputDirs false
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 {
from('src/main/asciidoc/integrationguide/') {
include 'images/**'

View File

@ -16,15 +16,25 @@ buildDir = "target"
ext {
// 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
minorSlot = slot.substring( 0, slot.indexOf( ".", slot.indexOf( "." ) + 1) )
majorWildflyVersion = wildflyVersion.substring( 0, wildflyVersion.indexOf( "." ) )
artifactClassifier = "wildfly-${majorWildflyVersion}-dist"
minorSlot = rootProject.hibernateMajorMinorVersion
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 {
@ -48,10 +58,14 @@ dependencies {
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 )
into( 'org/hibernate/' + slot ) {
@ -80,11 +94,11 @@ task copyModulesXml(type: Copy) {
}
}
task createModulesZip(type: Zip, dependsOn: [copyModulesXml]) {
baseName = 'hibernate-orm-modules'
classifier = artifactClassifier
task createModulesZip(type: Zip, dependsOn: [copyAndExpandModuleXml]) {
baseName 'hibernate-orm-modules'
classifier artifactClassifier
from modulesXmlDir
from moduleXmlStagingDir
into( 'org/hibernate/' + slot ) {
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 {
publications {
mavenZip( MavenPublication ) {
@ -118,9 +127,9 @@ publishing {
build.dependsOn createModulesZip
/*************************/
/* Testing */
/*************************/
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// tasks related to in-container (Arquillian + WF) testing
if ( JavaVersion.current().isJava9Compatible() ) {
logger.lifecycle( "WARNING - Skipping hibernate-orm-modules tests for Java 9" )
@ -128,28 +137,27 @@ if ( JavaVersion.current().isJava9Compatible() ) {
test.enabled = false
}
test {
systemProperties['jboss.socket.binding.port-offset'] = 137
}
task installWildFly(type: Copy) {
description = 'Downloads the WildFly distribution and installs it into a local directory (if needed)'
// Unzip Wildfly Dist
task extractWildFly(type: Copy) {
from {
configurations.wildflyDist.collect { zipTree(it) }
}
into "$buildDir/"
into wildFlyInstallDir
}
// Unzip Hibernate ORM Modules ZIP into the server's "modules" dir
task extractModules(dependsOn: [extractWildFly, createModulesZip], type: Copy) {
task installHibernateModule( type:Copy, dependsOn: [createModulesZip, installWildFly]) {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
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 {
expand( buildDir: buildDir.getName(), wildflyVersion: wildflyVersion )
expand( buildDir: wildFlyInstallDir, wildflyVersion: wildflyVersion )
}

View File

@ -23,12 +23,16 @@
<container qualifier="container.active-1" mode="suite" default="true">
<configuration>
<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 -->
<!--
<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>
</container>
</group>

View File

@ -17,10 +17,6 @@ buildDir = "target"
idea.module {
}
final String[] versionComponents = version.split( '\\.' );
final String majorMinorVersion = versionComponents[0] + '.' + versionComponents[1];
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) {
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'
args '-avz', '--links', '--protocol=28', "${documentationDir.absolutePath}/", url