HHH-8235 - Drop database profiles upstream

This commit is contained in:
Steve Ebersole 2013-05-10 15:28:03 -05:00
parent cf91fd7a49
commit 1337d36a79
31 changed files with 6 additions and 1729 deletions

View File

@ -22,6 +22,7 @@ buildscript {
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:1.0.0-SNAPSHOT'
}
}

View File

@ -1,184 +0,0 @@
##Hibernate Matrix Testing
### Goal
The idea of matrix testing is to allow testing in a varied set of configurations. Specifically for Hibernate, this
correlates to running the same set of tests against against multiple databases. This goal is achieved through
2 Gradle plugins.
Note that the second plugin (org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin) applies the first
one (org.hibernate.build.gradle.testing.database.DatabaseProfilePlugin) automatically, so generally scripts would
not even reference it. The reason for the split is historical and these 2 may get merged later...
### org.hibernate.build.gradle.testing.database.DatabaseProfilePlugin
This plugin is responsible for determining which databases are available for testing in the given environment. It
does this by performing a directory search. Well actually it can perform up to 2 directory searches:
* The standard profile directory is named _databases_ at the base directory of the root project
* A custom profile directory, which can be named by setting a system property named _hibernate-matrix-databases_
These directories are searched recursively. We leverage this in Hibernate to allow the standard _databases_ directory
to hold local profiles too. That is achieved by a _.gitignore_ which says to ignore any directory named
_local_ under the directory _databases_. So one option to provide custom profiles is to drop them in there. That
has the benefit of not having to specify _hibernate-matrix-databases_
Within these directories, the plugin looks for sub-directories which either:
* contain a file named _matrix.gradle_. _matrix.gradle_ is a limited DSL Gradle file which currently understands
just a specialized org.gradle.api.artifacts.Configuration reference named _jdbcDependency_. All that is a fancy
way to say that _matrix.gradle_ allows you to specify some dependencies this database profile needs (JDBC drivers,
etc). Any dependency artifacts named here get resolved using whatever resolvers (Maven, etc) are associated with
the build. For example
jdbcDependency {
"mysql:mysql-connector-java:5.1.17"
}
* contain a directory named _jdbc_ which is assumed to hold jar file(s) needed for the profile.
Such directories become the basis of a database profile made available to the build. The name of the profile
(which becomes important when we discuss the next plugin) is taken from the directory name. Database profiles can
also contain a _resources_ directory.
An example layout using _matrix.gradle_ might be
├── mysql50
│ ├── jdbc
│ │ └── mysql-connector-java-5.1.9.jar
│ └── resources
│ └── hibernate.properties
Or
├── mysql50
│ ├── matrix.gradle
│ └── resources
│ └── hibernate.properties
Either would result in a database profile named _mysql50_
Profiles can be ignored using the *hibernate-matrix-ignore* setting which accepts either
* a comma-separated list of the database profile names to be skipped
* the magic value **all** which indicates to ignore all profiles
### org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
The MatrixTestingPlugin essentially generates a bunch of Gradle tasks dynamically and adds them to your build. It does
this based on all the database profiles found. Running `gradle tasks --all` will list all tasks available to the build
including these generated ones.
For each database profile the plugin will generate a task named *matrix_{profile}* that executes the tests against
that particular database profile. It also generates a task named *matrix* that groups together all the
profile-specific tasks so that running `gradle matrix` will run all the profiles.
*see section below discussing SourceSet separation*
### Database Allocator (JBoss internally, VPN required)
For developers on the Red Hat VPN, one option is to use the databases in the JBoss QA lab for testing. Note that
this tends to result in **very** slow builds but the obvious trade off is not having to install and manage these
databases locally.
The JBoss QA team developed a servlet to allow management of "database allocations" including requesting an
allocation be set up. The MatrixTestingPlugin is able to play with that feature allowing you to ask the build
to allocate the database for you. This feature is disabled by default, to enable it, you need this system property
named _hibernate-matrix-dballcoation_ which accepts either
* a comma-separate list of profile names
* the magic value **all** which indicates to allocate for all **supported** databases (see
org.hibernate.build.qalab.DatabaseAllocator.SUPPORTED_DB_NAMES for details)
For example, if you want to run matrix test on PostgreSQL 8.4, knowing that the database name for that is
_postgresql84_, you can use this command:
gradle matrix_postgresql84 -Dhibernate-matrix-dballocation=postgresql84
which would
1. talk to the database allocator service and make a database instance available
2. use the information returned from the allocator service to properly set up the connection information
Hibernate would need to connect to that instance.
3. run the tests against the postgresql84 profile
For some databases we need adjust the connection url with some options after get it from the database allocator. In
these cases we can use the system property _hibernate-matrix-dballocation-url-postfix-${dbname}_. For example
`-Dhibernate-matrix-dballocation-url-postfix-sybase155="?SQLINITSTRING=set quoted_identifier on&DYNAMIC_PREPARE=true"`
A useful parameter to the allocator service when allocating a database is the _requester_ which is basically just a
string meant to identify who is making the request. By default the Hibernate build uses _hibernate_. But you can
specify an alternate requester using the system property _hibernate-matrix-dballocation-requestee_
### Testing SourceSets
If you are not familiar with Gradle's notion of
[SourceSet](http://gradle.org/current/docs/javadoc/org/gradle/api/tasks/SourceSet.html), you should be :)
The Hibernate build defines 2 different testing related SourceSets in a number of modules (currently hibernate-core,
hibernate-entitymanager and hibernate-envers):
* _test_ - tests that **should not** be run against the profiles from the MatrixTestingPlugin
* _matrix_ - tests that **should** be run against the profiles from the MatrixTestingPlugin
Tests in _test_ include unit tests as well as a few functional tests which use a database but where the particular
database should not at all affect the outcome. Tests in _matrix_ are functional tests where the outcome of the tests
are highly dependent on the database being used (how pessimistic locks are acquired, etc).
As always, Wikipedia is a great source of information
* [Functional Testing](http://en.wikipedia.org/wiki/Functional_testing)
* [Unit Testing](http://en.wikipedia.org/wiki/Unit_testing)
hibernate-core directory layout (for discussion):
hibernate-core
├── hibernate-core.gradle
├── src
├── main
│ ├── antlr
│ ├── java
│ ├── javadoc
│ ├── resources
│ └── xjb
├── matrix
│ └── java
└── test
├── java
└── resources
The directories of interest include
* matrix/java
all functional tests go into this directory
* test/java
all unit tests go into this directory
* test/resources
all resources for **functional tests and unit tests**. Yes, resource files in this directory are shared for both, so you don't need to copy one file to both place, for example, log4j.properties.
To make _idea plugin_ (similar entries for _eclipse plugin_) works, we also have this defined in hibernate-core.gradle:
sourceSets {
matrix {
java {
srcDir 'src/matrix/java'
}
resources {
srcDir 'src/matrix/resources'
}
}
}
ideaModule {
sourceDirs += file( '$buildDir/generated-src/antlr/main' )
testSourceDirs += file( 'src/matrix/java')
testSourceDirs += file( 'src/matrix/resources')
}

View File

@ -1,126 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.logging.Logging;
import org.slf4j.Logger;
import org.hibernate.build.qalab.DatabaseAllocation;
import org.hibernate.build.qalab.DatabaseAllocator;
/**
* Basic support for {@link DatabaseProfile} implementations
*
* @author Steve Ebersole
* @author Strong Liu
*/
public abstract class AbstractDatabaseProfileImpl implements DatabaseProfile {
private static final Logger log = Logging.getLogger( AbstractDatabaseProfileImpl.class );
private final String name;
private final File profileDirectory;
private final Project project;
private final Map<String,String> hibernateProperties;
private final DatabaseAllocation databaseAllocation;
@SuppressWarnings( {"unchecked"})
protected AbstractDatabaseProfileImpl(File profileDirectory, Project project) {
this.profileDirectory = profileDirectory;
this.name = profileDirectory.getName();
this.project = project;
this.hibernateProperties = new HashMap<String, String>();
final File hibernatePropertiesFile = new File(
new File( profileDirectory, "resources" ),
"hibernate.properties"
);
if ( hibernatePropertiesFile.exists() ) {
Properties props = new Properties();
try {
FileInputStream stream = new FileInputStream( hibernatePropertiesFile );
try {
props.load( stream );
}
finally {
try {
stream.close();
}
catch (IOException ignore) {
}
}
}
catch (IOException e) {
log.warn( "Unable to read Hibernate properties for database profile [" + name + "]", e );
}
for ( String propName : props.stringPropertyNames() ) {
hibernateProperties.put( propName, props.getProperty( propName ) );
}
}
this.databaseAllocation = DatabaseAllocator.locate( project ).getAllocation( this );
}
@Override
public String getName() {
return name;
}
@Override
public File getDirectory() {
return profileDirectory;
}
@Override
public Map<String, String> getHibernateProperties() {
return hibernateProperties;
}
@Override
public DatabaseAllocation getDatabaseAllocation() {
return databaseAllocation;
}
protected Configuration prepareConfiguration(String name) {
Configuration configuration = getOrCreateConfiguration( name );
configuration.setDescription( "The JDBC dependency configuration for the [" + name + "] profile" );
return configuration;
}
protected Configuration getOrCreateConfiguration(String name) {
Configuration configuration = project.getConfigurations().findByName( name );
if ( configuration == null ) {
configuration = project.getConfigurations().create( name );
}
return configuration;
}
}

View File

@ -1,53 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import java.util.HashSet;
import java.util.Set;
import org.gradle.BuildAdapter;
import org.gradle.BuildResult;
import org.hibernate.build.qalab.DatabaseAllocation;
/**
* A Gradle {@link org.gradle.BuildListener} used to release all databases allocated when the build is finished.
*
* @author Steve Ebersole
*/
public class DatabaseAllocationCleanUp extends BuildAdapter {
private Set<DatabaseAllocation> databaseAllocations = new HashSet<DatabaseAllocation>();
public void addDatabaseAllocation(DatabaseAllocation databaseAllocation) {
databaseAllocations.add( databaseAllocation );
}
@Override
public void buildFinished(BuildResult result) {
super.buildFinished( result );
for ( DatabaseAllocation databaseAllocation : databaseAllocations ) {
databaseAllocation.release();
}
}
}

View File

@ -1,45 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import java.io.File;
import java.util.Map;
import org.gradle.api.artifacts.Configuration;
import org.hibernate.build.qalab.DatabaseAllocation;
/**
* Contract for database "profiles".
*
* @author Steve Ebersole
* @author Strong Liu
*/
public interface DatabaseProfile {
public String getName();
public File getDirectory();
public Map<String,String> getHibernateProperties();
public Configuration getTestingRuntimeConfiguration();
public DatabaseAllocation getDatabaseAllocation();
}

View File

@ -1,169 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
/**
* Plugin used to apply notion of database profiles, which are consumed by the matrix testing plugin.
*
* @author Steve Ebersole
* @author Strong Liu
*/
public class DatabaseProfilePlugin implements Plugin<Project> {
/**
* The directory containing standard database profiles.
*/
public static final String STANDARD_DATABASES_DIRECTORY = "databases";
/**
* Names a system setting key that can be set to point to a directory containing additional, custom
* database profiles.
*/
public static final String CUSTOM_DATABASES_DIRECTORY_KEY = "hibernate-matrix-databases";
public static final String HIBERNATE_MATRIX_IGNORE = "hibernate-matrix-ignore";
private static final String MATRIX_BUILD_FILE = "matrix.gradle";
private static final String JDBC_DIR = "jdbc";
private static final Logger log = Logging.getLogger( DatabaseProfilePlugin.class );
private Project project;
private List<DatabaseProfile> profiles;
public void apply(Project project) {
this.project = project;
final LinkedHashMap<String, DatabaseProfile> profileMap = new LinkedHashMap<String, DatabaseProfile>();
processStandardProfiles( profileMap );
processCustomProfiles( profileMap );
this.profiles = new ArrayList<DatabaseProfile>();
DatabaseAllocationCleanUp listener = new DatabaseAllocationCleanUp();
project.getGradle().addBuildListener( listener );
for ( DatabaseProfile profile : profileMap.values() ) {
this.profiles.add( profile );
listener.addDatabaseAllocation( profile.getDatabaseAllocation() );
}
}
private void processStandardProfiles(Map<String, DatabaseProfile> profileMap) {
final File standardDatabasesDirectory = project.file( STANDARD_DATABASES_DIRECTORY );
if ( standardDatabasesDirectory == null || ! standardDatabasesDirectory.exists() ) {
log.debug( "Standard databases directory [{}] did not exist", STANDARD_DATABASES_DIRECTORY );
return;
}
if ( ! standardDatabasesDirectory.isDirectory() ) {
log.warn( "Located standard databases directory [{}] was not a directory", STANDARD_DATABASES_DIRECTORY );
return;
}
processProfiles( standardDatabasesDirectory, profileMap );
}
private void processProfiles(File directory, Map<String, DatabaseProfile> profileMap) {
// the directory itself is a "database directory" if it contains either:
// 1) a file named 'matrix.gradle'
// 2) a directory named 'jdbc'
DatabaseProfile databaseProfile = null;
final File matrixDotGradleFile = new File( directory, MATRIX_BUILD_FILE );
if ( matrixDotGradleFile.exists() && matrixDotGradleFile.isFile() ) {
log.debug( "Found matrix.gradle file : " + matrixDotGradleFile );
databaseProfile = new MatrixDotGradleProfile( matrixDotGradleFile, project );
}
final File jdbcDirectory = new File( directory, JDBC_DIR );
if ( jdbcDirectory.exists() && jdbcDirectory.isDirectory() ) {
databaseProfile = new JdbcDirectoryProfile( jdbcDirectory, project );
}
if ( databaseProfile == null ) {
// we determined this directory is not a database directory, check its sub-directories
for ( File subDirectory : directory.listFiles() ) {
if ( subDirectory.isDirectory() ) {
processProfiles( subDirectory, profileMap );
}
}
return; // EARLY EXIT!!!
}
final String profileName = databaseProfile.getName();
if ( ignored().contains( profileName ) ) {
log.debug( "Skipping ignored database profile [{}]", profileName );
return;
}
DatabaseProfile previousEntry = profileMap.put( profileName, databaseProfile );
if ( previousEntry != null ) {
log.lifecycle(
"Found duplicate profile definitions [name={}], [{}] taking precedence over [{}]",
profileName,
databaseProfile.getDirectory().getAbsolutePath(),
previousEntry.getDirectory().getAbsolutePath()
);
}
}
private Set<String> ignored;
private Set<String> ignored() {
if ( ignored == null ) {
final String values = System.getProperty( HIBERNATE_MATRIX_IGNORE );
if ( values == null || values.length() == 0 ) {
ignored = Collections.emptySet();
}
else {
ignored = new HashSet<String>();
Collections.addAll( ignored, values.split( "," ) );
}
}
return ignored;
}
private void processCustomProfiles(Map<String, DatabaseProfile> profileMap) {
final String customDatabaseDirectoryPath = System.getProperty( CUSTOM_DATABASES_DIRECTORY_KEY );
if ( customDatabaseDirectoryPath != null && customDatabaseDirectoryPath.length() > 0 ) {
final File customDatabaseDirectory = new File( customDatabaseDirectoryPath );
if ( customDatabaseDirectory.exists() && customDatabaseDirectory.isDirectory() ) {
processProfiles( customDatabaseDirectory, profileMap );
}
}
}
public Iterable<DatabaseProfile> getDatabaseProfiles() {
return profiles;
}
}

View File

@ -1,39 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import org.hibernate.build.gradle.util.BuildException;
/**
* Indicates that we found multiple database profiles having the same name.
*
* @author Strong Liu
* @author Steve Ebersole
*/
public class DuplicateDatabaseProfileException extends BuildException {
public DuplicateDatabaseProfileException(String message) {
super( message );
}
}

View File

@ -1,48 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
/**
* Database profile as defined by a directory named {@code jdbc} containing JDBC drivers.
*
* @author Steve Ebersole
* @author Strong Liu
*/
public class JdbcDirectoryProfile extends AbstractDatabaseProfileImpl {
private final Configuration jdbcDependencies;
public JdbcDirectoryProfile(File jdbcDirectory, Project project) {
super( jdbcDirectory.getParentFile(), project );
jdbcDependencies = prepareConfiguration( getName() );
project.dependencies.add(getName(), project.files(jdbcDirectory.listFiles()))
}
@Override
public Configuration getTestingRuntimeConfiguration() {
return jdbcDependencies;
}
}

View File

@ -1,82 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.database;
import java.io.File;
import java.util.Collections;
import groovy.lang.Closure;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
/**
* Database profile as defined by a {@code matrix.gradle} file
*
* @author Steve Ebersole
* @author Strong Liu
*/
public class MatrixDotGradleProfile extends AbstractDatabaseProfileImpl {
private static final String MATRIX_NODE_CONVENTION_KEY = "matrixNode";
private final Configuration jdbcDependencies;
protected MatrixDotGradleProfile(File matrixDotGradleFile, Project project) {
super( matrixDotGradleFile.getParentFile(), project );
jdbcDependencies = prepareConfiguration( getName() );
final ConventionImpl convention = new ConventionImpl( jdbcDependencies, project );
project.getConvention().getPlugins().put( MATRIX_NODE_CONVENTION_KEY, convention );
try {
project.apply( Collections.singletonMap( "from", matrixDotGradleFile ) );
}
finally {
project.getConvention().getPlugins().remove( MATRIX_NODE_CONVENTION_KEY );
}
}
@Override
public Configuration getTestingRuntimeConfiguration() {
return jdbcDependencies;
}
private class ConventionImpl {
private final Configuration jdbcDependencies;
private final Project project;
private ConventionImpl(Configuration jdbcDependencies, Project project) {
this.jdbcDependencies = jdbcDependencies;
this.project = project;
}
@SuppressWarnings( {"UnusedDeclaration"})
public void jdbcDependency(Object dependencyNotation, Closure closure) {
project.getDependencies().add( jdbcDependencies.getName(), dependencyNotation, closure );
}
@SuppressWarnings( {"UnusedDeclaration"})
public void jdbcDependency(Object dependencyNotation) {
project.getDependencies().add( jdbcDependencies.getName(), dependencyNotation );
}
}
}

View File

@ -1,79 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.matrix;
import java.io.File;
import org.gradle.api.Project;
import org.hibernate.build.gradle.testing.database.DatabaseProfile;
import org.hibernate.build.gradle.util.Jdk;
import org.hibernate.build.qalab.*;
import org.hibernate.build.qalab.DatabaseAllocation;
/**
* A testing matrix node combines a database profile and a jdk (eventually) along with managing "db allocation"
* information.
*
* @author Steve Ebersole
* @author Strong Liu
*/
public class MatrixNode {
private final DatabaseProfile databaseProfile;
private final Jdk jdk;
private final File baseOutputDirectory;
private final DatabaseAllocation databaseAllocation;
@SuppressWarnings( {"ResultOfMethodCallIgnored"})
public MatrixNode(Project project, DatabaseProfile databaseProfile, Jdk jdk) {
this.databaseProfile = databaseProfile;
this.jdk = jdk;
baseOutputDirectory = new File( new File( project.getBuildDir(), "matrix" ), databaseProfile.getName() );
baseOutputDirectory.mkdirs();
this.databaseAllocation = DatabaseAllocator.locate( project ).getAllocation( databaseProfile );
}
public String getName() {
return databaseProfile.getName();
}
public DatabaseProfile getDatabaseProfile() {
return databaseProfile;
}
public Jdk getJdk() {
return jdk;
}
public File getBaseOutputDirectory() {
return baseOutputDirectory;
}
public DatabaseAllocation getDatabaseAllocation() {
return databaseAllocation;
}
}

View File

@ -1,159 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.gradle.testing.matrix;
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.testing.Test
import org.hibernate.build.gradle.testing.database.DatabaseProfile
import org.hibernate.build.gradle.testing.database.DatabaseProfilePlugin
import org.hibernate.build.gradle.util.Jdk
import static org.gradle.api.plugins.JavaPlugin.COMPILE_CONFIGURATION_NAME
import static org.gradle.api.plugins.JavaPlugin.RUNTIME_CONFIGURATION_NAME
import static org.gradle.api.plugins.JavaPlugin.TEST_COMPILE_CONFIGURATION_NAME
import static org.gradle.api.plugins.JavaPlugin.TEST_RUNTIME_CONFIGURATION_NAME
/**
* TODO : 1) add a base configuration of common attribute across all matrix node tasks (convention)
* TODO : 2) somehow allow applying just a single database to a project (non matrix testing).
*
* @author Steve Ebersole
* @author Strong Liu
*/
public class MatrixTestingPlugin implements Plugin<Project> {
private static final Logger log = Logging.getLogger(MatrixTestingPlugin.class);
public static final String MATRIX_COMPILE_CONFIG_NAME = "matrixCompile";
public static final String MATRIX_RUNTIME_CONFIG_NAME = "matrixRuntime";
public static final String MATRIX_TASK_NAME = "matrix";
private Project project;
private SourceSet testSourceSet;
private Configuration matrixCompileConfig;
private Configuration matrixRuntimeConfig;
private Task matrixTask;
// currently, only the build jdk is supported
private Jdk theJdk = new Jdk();
public void apply(Project project) {
this.project = project;
project.rootProject.plugins.apply( DatabaseProfilePlugin );
List<MatrixNode> matrixNodes = locateMatrixNodes();
if ( matrixNodes == null || matrixNodes.isEmpty() ) {
// no db profiles defined
return;
}
matrixCompileConfig = prepareCompileConfiguration();
matrixRuntimeConfig = prepareRuntimeConfiguration();
testSourceSet = project.convention.getPlugin( JavaPluginConvention ).sourceSets
.getByName( SourceSet.TEST_SOURCE_SET_NAME );
matrixTask = prepareGroupingTask();
for ( MatrixNode matrixNode: matrixNodes ) {
Task matrixNodeTask = prepareNodeTask( matrixNode );
matrixTask.dependsOn( matrixNodeTask );
}
}
private List<MatrixNode> locateMatrixNodes() {
List<MatrixNode> matrixNodes = new ArrayList<MatrixNode>();
Iterable<DatabaseProfile> profiles = project.rootProject.plugins[DatabaseProfilePlugin].databaseProfiles;
if ( profiles != null ) {
for ( DatabaseProfile profile : profiles ) {
matrixNodes.add( new MatrixNode( project, profile, theJdk ) );
}
}
return matrixNodes;
}
/**
* Prepare compile configuration for matrix source set.
*/
private Configuration prepareCompileConfiguration() {
return project.configurations.create( MATRIX_COMPILE_CONFIG_NAME )
.setDescription( "Dependencies used to compile the matrix tests" )
.extendsFrom( project.configurations.getByName( COMPILE_CONFIGURATION_NAME ) )
.extendsFrom( project.configurations.getByName( TEST_COMPILE_CONFIGURATION_NAME ) );
}
/**
* Prepare runtime configuration for matrix source set.
*/
private Configuration prepareRuntimeConfiguration() {
return project.configurations.create( MATRIX_RUNTIME_CONFIG_NAME )
.setDescription( "Dependencies (baseline) used to run the matrix tests" )
.extendsFrom( matrixCompileConfig )
.extendsFrom( project.configurations.getByName( RUNTIME_CONFIGURATION_NAME ) )
.extendsFrom( project.configurations.getByName( TEST_RUNTIME_CONFIGURATION_NAME ) );
}
private Task prepareGroupingTask() {
Task matrixTask = project.tasks.create( MATRIX_TASK_NAME );
matrixTask.group = "Verification"
matrixTask.description = "Runs the unit tests on Database Matrix"
return matrixTask;
}
private void generateNodeTasks(List<MatrixNode> matrixNodes) {
// For now we just hard code this to locate the databases processed by
// org.hibernate.build.gradle.testing.database.DatabaseProfilePlugin. But long term would be much better to
// abstract this idea via the MatrixNode/MatrixNodeProvider interfaces; this would allow the jvm variance
// needed for jdbc3/jdbc4 testing for example. Not to mention its much more generally applicable
//
// Also the notion that the plugin as a MatrixNodeProducer might not be appropriate. probably a split there
// is in order too (config producer and jvm producer and somehow they get wired into a matrix).
//
// but again this is just a start.
}
private Task prepareNodeTask(MatrixNode node) {
String taskName = MATRIX_TASK_NAME + '_' + node.name
log.debug( "Adding Matrix Testing task $taskName" );
final Test nodeTask = project.tasks.create( taskName, Test );
nodeTask.description = "Runs the matrix against ${node.name}"
nodeTask.classpath = node.databaseProfile.testingRuntimeConfiguration + testSourceSet.runtimeClasspath
nodeTask.testClassesDir = testSourceSet.output.classesDir
nodeTask.ignoreFailures = true
nodeTask.workingDir = node.baseOutputDirectory
nodeTask.testReportDir = new File(node.baseOutputDirectory, "reports")
nodeTask.testResultsDir = new File(node.baseOutputDirectory, "results")
nodeTask.dependsOn( project.tasks.getByName( testSourceSet.classesTaskName ) );
nodeTask.systemProperties = node.databaseAllocation.properties
nodeTask.systemProperties['hibernate.test.validatefailureexpected'] = true
nodeTask.jvmArgs = ['-Xms1024M', '-Xmx1024M']//, '-XX:MaxPermSize=512M', '-Xss4096k', '-Xverify:none', '-XX:+UseFastAccessorMethods', '-XX:+DisableExplicitGC']
nodeTask.maxHeapSize = "1024M"
return nodeTask;
}
}

View File

@ -1,39 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.qalab;
import java.util.Map;
/**
* Represents a database instances allocated in the JBoss/Red Hat Qe Lab via {@link DatabaseAllocator}
*
* @author mvecera
* @author Strong Liu
* @author Steve Ebersole
*/
public interface DatabaseAllocation {
public Map<String,String> getProperties();
public void release();
}

View File

@ -1,101 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.qalab
import org.gradle.api.Project
import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import org.hibernate.build.gradle.testing.database.DatabaseProfile
/**
* Helper for dealing with the "DB Allocator" service set up in the JBoss/Red Hat QE lab.
*
* Use the <code>hibernate-matrix-dballocation</code> setting to control db allocation. By default,
* no allocations are performed. <code>hibernate-matrix-dballocation</code> could be either:<ul>
* <li><b>all</b> - allocate all non-ignored databases</li>
* <li><b>profile1{,profile2,...}</b> - allocate only the named profiles, provided the name is also one of the supported names</li>
* </ul>
*
* @author mvecera
* @author Strong Liu
* @author Steve Ebersole
*/
class DatabaseAllocator {
private static final Logger log = Logging.getLogger( DatabaseAllocator.class );
public static final String ALLOCATION_ENABLED = "hibernate-matrix-dballocation";
public static final String REQUESTEE = "hibernate-matrix-dballocation-requestee";
public static final String DB_ALLOCATOR_KEY = "dbAllocator";
public static def SUPPORTED_DB_NAMES = [
"oracle9i", "oracle10g", "oracle11gR1", "oracle11gR2", "oracle11gR2RAC", "oracle11gR1RAC",
"postgresql82", "postgresql83", "postgresql84", "postgresql91", "postgresql92",
"postgresplus92",
"mysql50", "mysql51","mysql55",
"db2-91", "db2-97", "db2-10",
"mssql2005", "mssql2008R1", "mssql2008R2", "mssql2012",
"sybase155", "sybase157"
];
private Map<String,DatabaseAllocation> databaseAllocationMap = new HashMap<String, DatabaseAllocation>();
private final Project rootProject;
DatabaseAllocator(Project rootProject) {
this.rootProject = rootProject
}
public DatabaseAllocation getAllocation(DatabaseProfile profile) {
DatabaseAllocation databaseAllocation = databaseAllocationMap.get( profile.name );
if ( databaseAllocation == null ) {
databaseAllocation = createAllocation( profile );
databaseAllocationMap.put( profile.name, databaseAllocation );
}
return databaseAllocation;
}
private DatabaseAllocation createAllocation(DatabaseProfile profile) {
if ( isAllocationEnabled( profile.name ) ) {
log.lifecycle( "using Allocator to get database [${profile.name}] connection info" );
final File outputDirectory = new File( new File( rootProject.getBuildDir(), "matrix" ), profile.getName() )
return new EnabledDatabaseAllocation( rootProject.getAnt(), profile, outputDirectory );
}
return new DisabledDatabaseAllocation( profile );
}
private boolean isAllocationEnabled(String name) {
if ( !SUPPORTED_DB_NAMES.contains(name) ) {
return false
};
String value = System.properties[ALLOCATION_ENABLED]
return value != null && (value.contains(name) || value.equals("all"));
}
public static DatabaseAllocator locate(Project project) {
if ( ! project.rootProject.hasProperty( DB_ALLOCATOR_KEY ) ) {
project.rootProject.ext.setProperty( DB_ALLOCATOR_KEY, new DatabaseAllocator( project.rootProject ) );
}
return (DatabaseAllocator) project.rootProject.properties[ DB_ALLOCATOR_KEY ];
}
}

View File

@ -1,47 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.qalab
import org.hibernate.build.gradle.testing.database.DatabaseProfile
/**
* @author Steve Ebersole
*/
class DisabledDatabaseAllocation implements DatabaseAllocation {
private final DatabaseProfile databaseProfile;
DisabledDatabaseAllocation(DatabaseProfile databaseProfile) {
this.databaseProfile = databaseProfile;
}
@Override
Map<String, String> getProperties() {
return databaseProfile.hibernateProperties;
}
@Override
void release() {
// nothing to do
}
}

View File

@ -1,150 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.build.qalab
import org.gradle.api.Project
import org.hibernate.build.gradle.testing.database.DatabaseProfile
import org.hibernate.build.gradle.util.BuildException
import org.gradle.api.logging.Logging
import org.gradle.api.logging.Logger
/**
* @author Steve Ebersole
*/
class EnabledDatabaseAllocation implements DatabaseAllocation {
private static final Logger log = Logging.getLogger( DatabaseAllocator.class );
private static final String DB_ALLOCATOR_URL = "http://dballocator.mw.lab.eng.bos.redhat.com:8080/Allocator/AllocatorServlet";
private static final String ALLOCATOR_OUTPUT_FILE_NAME = "allocated-db.properties";
private static final String DB_ALLOCATION_URL_POSTFIX = "hibernate-matrix-dballocation-url-postfix";
private static final String DRIVER_PROP = "hibernate.connection.driver_class";
private static final String URL_PROP = "hibernate.connection.url";
private static final String USERNAME_PROP = "hibernate.connection.username";
private static final String PASSWORD_PROP = "hibernate.connection.password";
private static final int RETRIES = 30
private static final int EXPIRY = 300;
private final DatabaseProfile databaseProfile
private final AntBuilder ant;
private final File allocatorOutputFile;
private final String requester;
private final String uuid;
private final File tmpFile;
private final Map<String,String> properties;
EnabledDatabaseAllocation(AntBuilder ant, DatabaseProfile databaseProfile, File outputDirectory) {
this.ant = ant;
this.databaseProfile = databaseProfile;
outputDirectory.mkdirs()
this.allocatorOutputFile = new File( outputDirectory, ALLOCATOR_OUTPUT_FILE_NAME );
this.tmpFile = new File( outputDirectory, "tmpfile" );
if ( System.properties.containsKey("hibernate-matrix-dballocation-requestee") ) {
requester = System.properties["hibernate-matrix-dballocation-requestee"]
}
else {
requester = "hibernate"
}
if ( allocatorOutputFile.exists() ) {
allocatorOutputFile.delete()
}
int attempts = 0;
while ( !(allocatorOutputFile.exists() && allocatorOutputFile.length() > 0) ) {
if ( attempts >= RETRIES ) {
throw new BuildException( 'Database unavailable' );
}
if ( attempts > 0 ) {
log.lifecycle( "Trouble accessing Allocator servlet; waiting before trying again" );
Thread.sleep( 60000 );
}
def allocatorUrl = DB_ALLOCATOR_URL +
"?operation=alloc&label=${databaseProfile.name}&requestee=${requester}&expiry=${EXPIRY}"
ant.get(
src: allocatorUrl,
dest: allocatorOutputFile.absolutePath,
ignoreerrors: 'true'
);
attempts++
}
def allocatorProps = new Properties();
allocatorProps.load( new FileInputStream( allocatorOutputFile ) );
this.uuid = allocatorProps['uuid']
log.lifecycle( "Finished allocating for DB instance [${databaseProfile.name}], uuid is [${uuid}]" );
properties = new HashMap<String, String>();
properties.putAll( databaseProfile.hibernateProperties );
properties[DRIVER_PROP] = allocatorProps["db.jdbc_class"]
properties[URL_PROP] = allocatorProps["db.jdbc_url"] + getURLPostfix(databaseProfile.name)
properties[USERNAME_PROP] = allocatorProps["db.username"]
properties[PASSWORD_PROP] = allocatorProps["db.password"]
properties["uuid"] = allocatorProps["uuid"];
clean();
}
private String getURLPostfix(String dbName) {
for ( String key: System.properties.keySet() ) {
if ( key.startsWith(DB_ALLOCATION_URL_POSTFIX) ) {
String db = key.substring(DB_ALLOCATION_URL_POSTFIX.length() + 1, key.length())
if ( db.equalsIgnoreCase(dbName) ) {
String postfix = System.properties[key];
log.debug("found URL postfix[%s] for DB[%s]", postfix, db );
return postfix;
}
}
}
return ""
}
void clean() {
log.lifecycle( "Cleaning DB [${databaseProfile.name}]..." );
final String allocatorUrl = DB_ALLOCATOR_URL + "?operation=erase&uuid=${uuid}";
ant.get( src: allocatorUrl, dest: tmpFile.absolutePath );
}
@Override
Map<String, String> getProperties() {
return properties;
}
@Override
void release() {
log.lifecycle( "De-allocating DB [${databaseProfile.name}]..." );
final String allocatorUrl = DB_ALLOCATOR_URL + "?operation=dealloc&uuid=${uuid}";
ant.get( src: allocatorUrl, dest: tmpFile.absolutePath );
}
}

View File

@ -1,3 +0,0 @@
#Ignore any sub directory named 'local'. these are used to define custom database profiles local
# to the developer's machine
/local

View File

@ -1,25 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "org.apache.derby:derby:10.8.2.2"

View File

@ -1,40 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.DerbyTenSevenDialect
hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
hibernate.connection.url jdbc:derby:testdb;create=true
hibernate.connection.username sa
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,25 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "mysql:mysql-connector-java:5.1.17"

View File

@ -1,42 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com:3306/dballo01
hibernate.connection.username dballo01
hibernate.connection.password dballo01
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,25 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "mysql:mysql-connector-java:5.1.17"

View File

@ -1,46 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
#hibernate.connection.url jdbc:mysql://vmg02.mw.lab.eng.bos.redhat.com:3306/dballo01
#hibernate.connection.username dballo01
#hibernate.connection.password dballo01
hibernate.connection.url jdbc:mysql://127.0.0.1:3306/hibernate
hibernate.connection.username hibernate
hibernate.connection.password hibernate
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,24 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "postgresql:postgresql:8.4-701.jdbc4"

View File

@ -1,42 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://postgresql01.mw.lab.eng.bos.redhat.com:5432/dballo03
hibernate.connection.username dballo03
hibernate.connection.password dballo03
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,24 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "postgresql:postgresql:8.4-701.jdbc4"

View File

@ -1,43 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://postgresql03.mw.lab.eng.bos.redhat.com:5432/dballo03
hibernate.connection.username dballo03
hibernate.connection.password dballo03
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,24 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
jdbcDependency "postgresql:postgresql:9.1-901.jdbc4"

View File

@ -1,42 +0,0 @@
#
# Hibernate, Relational Persistence for Idiomatic Java
#
# Copyright (c) 2011, Red Hat Inc. or third-party contributors as
# indicated by the @author tags or express copyright attribution
# statements applied by the authors. All third-party contributions are
# distributed under license by Red Hat Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# Lesser General Public License, as published by the Free Software Foundation.
#
# This program 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 distribution; if not, write to:
# Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301 USA
#
hibernate.dialect org.hibernate.dialect.PostgreSQL82Dialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://127.0.0.1/hibernate
hibernate.connection.username hibernate
hibernate.connection.password hibernate
hibernate.connection.pool_size 5
hibernate.show_sql true
hibernate.format_sql true
hibernate.max_fetch_depth 5
hibernate.cache.region_prefix hibernate.test
hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory

View File

@ -1,6 +1,8 @@
apply plugin: 'antlr'
apply plugin: 'hibernate-matrix-testing'
apply plugin: org.hibernate.build.gradle.inject.InjectionPlugin
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
dependencies {
compile( libraries.jta )

View File

@ -1,6 +1,6 @@
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
apply plugin: 'hibernate-matrix-testing'
dependencies {
compile( project(':hibernate-core') )

View File

@ -1,4 +1,4 @@
apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin
apply plugin: 'hibernate-matrix-testing'
dependencies {
compile( project( ':hibernate-core' ) )