Revert "HHH-13656 Con not build and run test on Eclipse IDE"
This reverts commit f6fad942df
.
This commit is contained in:
parent
39b46f2a9a
commit
dd0b6a9da3
|
@ -1 +0,0 @@
|
|||
org.gradle.jvmargs=-Duser.language=en_US -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Duser.country=US
|
|
@ -109,7 +109,6 @@ ext {
|
|||
junit5_params : "org.junit.jupiter:junit-jupiter-params:${junit5Version}",
|
||||
junit: "junit:junit:${junitVersion}",
|
||||
junit5_vintage: "org.junit.vintage:junit-vintage-engine:${junitVintageVersion}",
|
||||
junit_pcomms: "org.junit.platform:junit-platform-commons:1.5.2",
|
||||
|
||||
log4j: "log4j:log4j:1.2.17",
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
/hibernate-core-IdeTests.launch
|
||||
/hibernate-core-RunnableIdeTest.launch
|
||||
/.externalToolBuilders/
|
|
@ -8,11 +8,7 @@ plugins {
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
import groovy.xml.MarkupBuilder
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
apply plugin: Antlr4Plugin
|
||||
|
@ -24,9 +20,6 @@ configurations {
|
|||
tests {
|
||||
description = 'Configuration for the produced test jar'
|
||||
}
|
||||
|
||||
eclipseConfig {
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
@ -66,17 +59,9 @@ dependencies {
|
|||
provided( libraries.ant )
|
||||
provided( libraries.cdi )
|
||||
|
||||
eclipseConfig( compileOnly( libraries.ant ) )
|
||||
eclipseConfig( compileOnly( libraries.logging_annotations ) )
|
||||
eclipseConfig( runtime( libraries.junit ) )
|
||||
eclipseConfig( runtime( libraries.junit5_api ) )
|
||||
eclipseConfig( runtime( libraries.junit5_jupiter ) )
|
||||
eclipseConfig( runtime( libraries.junit5_params ) )
|
||||
eclipseConfig( runtime( libraries.junit_pcomms ) )
|
||||
|
||||
runtime( libraries.junit5_vintage )
|
||||
runtime( libraries.junit5_jupiter )
|
||||
|
||||
|
||||
testCompile( project(':hibernate-testing') )
|
||||
testCompile( libraries.shrinkwrap_api )
|
||||
testCompile( libraries.shrinkwrap )
|
||||
|
@ -180,159 +165,6 @@ idea {
|
|||
}
|
||||
}
|
||||
|
||||
cleanEclipse {
|
||||
project.delete '.externalToolBuilders'
|
||||
project.delete 'hibernate-core-RunnableIdeTest.launch'
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn(cleanEclipse)
|
||||
|
||||
eclipse {
|
||||
project {
|
||||
file {
|
||||
withXml { provider ->
|
||||
def projectDescriptionNode = provider.asNode()
|
||||
// projectDescriptionNode.children( ).each { nodeItem ->
|
||||
// println( 'nodeItem: ' + nodeItem )
|
||||
// }
|
||||
def buildSpecNode = projectDescriptionNode.children().find { child -> child.name( ).equals('buildSpec') }
|
||||
def buildCommandMkp = new StreamingMarkupBuilder().bind {
|
||||
buildCommand {
|
||||
name( 'org.eclipse.ui.externaltools.ExternalToolBuilder' )
|
||||
triggers( 'full,incremental,' )
|
||||
arguments( ) {
|
||||
dictionary( ) {
|
||||
key ( 'LaunchConfigHandle' )
|
||||
value ( '<project>/.externalToolBuilders/gradlew_process_test_resources.launch' )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
def buildCommandNode = new XmlParser().parseText( buildCommandMkp.toString() )
|
||||
buildSpecNode.append( buildCommandNode )
|
||||
}
|
||||
}
|
||||
}
|
||||
mkdir '.externalToolBuilders'
|
||||
file('.externalToolBuilders/gradlew_process_test_resources.launch').withWriter { writer ->
|
||||
// Create MarkupBuilder with 4 space indent
|
||||
def xml = new MarkupBuilder(new IndentPrinter(writer, " ", true))
|
||||
|
||||
xml.doubleQuotes = true
|
||||
xml.mkp.xmlDeclaration(version: '1.0', encoding: 'utf-8', standalone: 'no')
|
||||
xml.launchConfiguration( type: 'org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType' ) {
|
||||
stringAttribute( key: 'org.eclipse.debug.core.ATTR_REFRESH_SCOPE', value: "${project.name}" )
|
||||
booleanAttribute( key: 'org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND', value: 'false' )
|
||||
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||
stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_LOCATION', value: file('../gradlew.bat').absolutePath )
|
||||
} else {
|
||||
stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_LOCATION', value: file('../gradlew').absolutePath )
|
||||
}
|
||||
stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS', value: 'incremental,auto,' )
|
||||
stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS', value: 'hibernate-core:processTestResources --no-daemon' )
|
||||
booleanAttribute( key: 'org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED', value: 'true' )
|
||||
stringAttribute( key: 'org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY', value: file('../').absolutePath )
|
||||
}
|
||||
xml.mkp.comment("AUTO-GENERATED FILE. DO NOT MODIFY. This is generated by gradle eclipse task")
|
||||
}
|
||||
file('hibernate-core-RunnableIdeTest.launch').withWriter { writer ->
|
||||
// Create MarkupBuilder with 4 space indent
|
||||
def xml = new MarkupBuilder(new IndentPrinter(writer, " ", true))
|
||||
|
||||
xml.doubleQuotes = true
|
||||
xml.mkp.xmlDeclaration(version: '1.0', encoding: 'utf-8', standalone: 'no')
|
||||
xml.launchConfiguration( type: 'org.eclipse.jdt.junit.launchconfig' ) {
|
||||
listAttribute( key: 'org.eclipse.debug.core.MAPPED_RESOURCE_PATHS' ) {
|
||||
listEntry( value: "${project.name}" )
|
||||
}
|
||||
listAttribute( key: 'org.eclipse.debug.core.MAPPED_RESOURCE_TYPES' ) {
|
||||
listEntry( value: '4' )
|
||||
}
|
||||
stringAttribute( key: 'org.eclipse.jdt.junit.CONTAINER', value: "=${project.name}" )
|
||||
stringAttribute( key: 'org.eclipse.jdt.junit.EXCLUDE_TAGS', value: '' )
|
||||
booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_EXCLUDE_TAGS', value: 'false' )
|
||||
booleanAttribute( key: 'org.eclipse.jdt.junit.HAS_INCLUDE_TAGS', value: 'true' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.junit.INCLUDE_TAGS', value: 'RunnableIdeTest' )
|
||||
booleanAttribute( key: 'org.eclipse.jdt.junit.KEEPRUNNING_ATTR', value: 'false' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.junit.TESTNAME', value: '' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.junit.TEST_KIND', value: 'org.eclipse.jdt.junit.loader.junit5' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.launching.MAIN_TYPE', value: '' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.launching.PROJECT_ATTR', value: 'hibernate-core' )
|
||||
stringAttribute( key: 'org.eclipse.jdt.launching.VM_ARGUMENTS', value: '-ea' )
|
||||
}
|
||||
xml.mkp.comment("AUTO-GENERATED FILE. DO NOT MODIFY. This is generated by gradle eclipse task")
|
||||
}
|
||||
|
||||
|
||||
classpath {
|
||||
plusConfigurations += [
|
||||
configurations.eclipseConfig
|
||||
]
|
||||
def frf = it.fileReferenceFactory
|
||||
|
||||
file {
|
||||
beforeMerged { classpath ->
|
||||
}
|
||||
whenMerged { classpath ->
|
||||
Set exclusionSourceSet = [
|
||||
'src/main/resources',
|
||||
'src/test/resources'
|
||||
]
|
||||
List newSourceSet = []
|
||||
classpath.entries.each { item ->
|
||||
if( !exclusionSourceSet.contains( item.path ) ) {
|
||||
println( 'INCLUDING: ' + item )
|
||||
newSourceSet.add( item )
|
||||
} else {
|
||||
println( 'NOT INCLUDING: ' + item )
|
||||
}
|
||||
}
|
||||
|
||||
def aptMain = new SourceFolder('target/generated-src/apt/main', 'bin/main')
|
||||
def aptTest = new SourceFolder('target/generated-src/apt/test', 'bin/test')
|
||||
def resourceMain = new SourceFolder('src/main/resources', 'target/resources/main')
|
||||
def resourceTest = new SourceFolder('src/test/resources', 'target/resources/test')
|
||||
newSourceSet += [
|
||||
aptMain,
|
||||
aptTest,
|
||||
resourceMain,
|
||||
resourceTest
|
||||
]
|
||||
// def resourceMain = new Library( frf.fromFile( file ( 'target/resources/main' ) ) )
|
||||
// def resourceTest = new Library( frf.fromFile( file ( 'target/resources/test' ) ) )
|
||||
println( 'newSourceSet:' )
|
||||
println( newSourceSet )
|
||||
classpath.entries = newSourceSet
|
||||
|
||||
// classpath.configure([
|
||||
// aptMain,
|
||||
// aptTest,
|
||||
// resourceMain,
|
||||
// resourceTest
|
||||
// ])
|
||||
|
||||
// Find the "source" entry and add the exclude for the folder containing our super-source code
|
||||
// Set exclusionSourceSet = [
|
||||
// 'src/main/resources',
|
||||
// 'src/test/resources'
|
||||
// ]
|
||||
// Set newSourceSet = []
|
||||
// classpath.entries.each { item ->
|
||||
// if( !exclusionSourceSet.contains( item.path ) ) {
|
||||
// println( 'INCLUDING: ' + item )
|
||||
// newSourceSet.add( item )
|
||||
// } else {
|
||||
// println( 'NOT INCLUDING: ' + item )
|
||||
// }
|
||||
// }
|
||||
// println( 'newSourceSet:' )
|
||||
// println( newSourceSet )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xjc {
|
||||
outputDir = project.jaxbTargetDir
|
||||
|
||||
|
@ -367,8 +199,7 @@ task copyBundleResources (type: Copy) {
|
|||
from file('src/test/bundles')
|
||||
into ext.bundlesTargetDir
|
||||
filter( ReplaceTokens, tokens: ext.bundleTokens)
|
||||
//println( 'ext: ' + ext )
|
||||
//println( 'ext.bundleTokens:' + ext.bundleTokens )
|
||||
|
||||
doFirst {
|
||||
ext.bundlesTargetDir.mkdirs()
|
||||
}
|
||||
|
|
|
@ -373,7 +373,7 @@ public class MetadataContext {
|
|||
else if ( persistentClass.hasIdentifierMapper() ) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Iterator<Property> propertyIterator = persistentClass.getIdentifierMapper().getPropertyIterator();
|
||||
final Set<SingularPersistentAttribute<?, ?>> idClassAttributes = (Set<SingularPersistentAttribute<?, ?>>)(Object) buildIdClassAttributes(
|
||||
final Set<SingularPersistentAttribute<?, ?>> idClassAttributes = (Set<SingularPersistentAttribute<?, ?>>) buildIdClassAttributes(
|
||||
identifiableType,
|
||||
propertyIterator
|
||||
);
|
||||
|
|
|
@ -2419,7 +2419,7 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implements SqmCre
|
|||
|
||||
//noinspection unchecked
|
||||
return getFunctionTemplate("trim").makeSqmFunctionExpression(
|
||||
(List<SqmTypedNode<?>>)(Object)asList(
|
||||
asList(
|
||||
interpretTrimSpecification( ctx.trimSpecification() ),
|
||||
visitTrimCharacter( ctx.trimCharacter() ),
|
||||
source
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -67,7 +66,7 @@ public class DB2390DialectTestCase extends BaseEntityManagerFunctionalTestCase {
|
|||
|
||||
@Before
|
||||
public void populateSchema() {
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 0; i < 10; ++i ) {
|
||||
final SimpleEntity simpleEntity = new SimpleEntity( i, "Entity" + i );
|
||||
entityManager.persist( simpleEntity );
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.hibernate.dialect.InformixDialect;
|
|||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -127,7 +126,7 @@ public class InformixFunctionTest extends BaseCoreFunctionalTestCase {
|
|||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-10800" )
|
||||
public void testCurrentTimestamp() throws Exception {
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
int tries = 2;
|
||||
while ( tries-- > 0 ) {
|
||||
Timestamp timestamp = (Timestamp) session.createQuery(
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.hibernate.testing.RequiresDialect;
|
|||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.logger.LoggerInspectionRule;
|
||||
import org.hibernate.testing.logger.Triggerable;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -119,7 +118,7 @@ public class PostgreSQLSequenceGeneratorWithSerialTest extends BaseEntityManager
|
|||
|
||||
final int ITERATIONS = 51;
|
||||
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 1; i <= ITERATIONS; i++ ) {
|
||||
ApplicationConfiguration model = new ApplicationConfiguration();
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.hibernate.testing.RequiresDialectFeature;
|
|||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.logger.LoggerInspectionRule;
|
||||
import org.hibernate.testing.logger.Triggerable;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.hibernate.test.schemaupdate.SchemaExportWithGlobalQuotingEnabledTest;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
@ -114,7 +113,7 @@ public class SequenceMismatchStrategyFixWithSequenceGeneratorTest extends BaseEn
|
|||
|
||||
final int ITERATIONS = 51;
|
||||
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 1; i <= ITERATIONS; i++ ) {
|
||||
ApplicationConfiguration model = new ApplicationConfiguration();
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.hibernate.testing.RequiresDialectFeature;
|
|||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.logger.LoggerInspectionRule;
|
||||
import org.hibernate.testing.logger.Triggerable;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -106,7 +105,7 @@ public class SequenceMismatchStrategyWithoutSequenceGeneratorTest extends BaseEn
|
|||
|
||||
final int ITERATIONS = 51;
|
||||
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 1; i <= ITERATIONS; i++ ) {
|
||||
ApplicationConfiguration model = new ApplicationConfiguration();
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.hibernate.Hibernate;
|
|||
import org.hibernate.graph.RootGraph;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -33,7 +32,7 @@ public class FetchWithRootGraphTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Before
|
||||
public void before() {
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
for ( long i = 0; i < 10; ++i ) {
|
||||
SimpleEntity sim = new SimpleEntity( i, "Entity #" + i );
|
||||
EntityWithReference ref = new EntityWithReference( i, sim );
|
||||
|
|
|
@ -19,7 +19,7 @@ import javax.persistence.TableGenerator;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.jdbc.Work;
|
||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
|
@ -56,7 +56,7 @@ public class AssignedInitialValueTableGeneratorConfiguredTest extends BaseEntity
|
|||
|
||||
@Test
|
||||
public void testTheGeneratedIdValuesAreCorrect() {
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( long i = 0; i < 3; i++ ) {
|
||||
Product product = new Product();
|
||||
product.setName( "Hibernate " + i );
|
||||
|
|
|
@ -19,7 +19,7 @@ import javax.persistence.TableGenerator;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.jdbc.Work;
|
||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
|
@ -57,7 +57,7 @@ public class DefaultInitialValueTableGeneratorConfiguredTest extends BaseEntityM
|
|||
|
||||
@Test
|
||||
public void testTheGeneratedIdValuesAreCorrect() {
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( long i = 0; i < 3; i++ ) {
|
||||
Product product = new Product();
|
||||
product.setName( "Hibernate " + i );
|
||||
|
|
|
@ -13,8 +13,6 @@ import org.hibernate.tool.schema.Action;
|
|||
import org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
@ -22,9 +20,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SchemaToolingAutoActionTests {
|
||||
@Test
|
||||
public void testLegacySettingAsAction() {
|
||||
|
|
|
@ -6,14 +6,8 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.bootstrap.jpa;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.persistence.spi.PersistenceProvider;
|
||||
import javax.sql.DataSource;
|
||||
|
@ -23,20 +17,22 @@ import org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProvid
|
|||
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
|
||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.jpa.HibernatePersistenceProvider;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.jdbc.DataSourceStub;
|
||||
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseUnitTestCase;
|
||||
import org.hibernate.testing.util.jpa.PersistenceUnitInfoAdapter;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class PersistenceUnitInfoTests extends BaseUnitTestCase {
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-13432" )
|
||||
|
|
|
@ -35,8 +35,6 @@ import org.hibernate.testing.junit4.BaseUnitTestCase;
|
|||
import org.hibernate.testing.util.jpa.DelegatingPersistenceUnitInfo;
|
||||
import org.hibernate.testing.util.jpa.PersistenceUnitInfoAdapter;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -48,9 +46,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class PersistenceUnitOverridesTests extends BaseUnitTestCase {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,8 +20,6 @@ import org.hibernate.testing.orm.junit.SessionFactoryFunctionalTesting;
|
|||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -38,9 +36,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
@SessionFactory
|
||||
@SessionFactoryFunctionalTesting
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class LoadingSmokeTests {
|
||||
@Test
|
||||
public void testBasicLoad(SessionFactoryScope scope) {
|
||||
|
|
|
@ -23,8 +23,6 @@ import org.hibernate.testing.orm.junit.SessionFactory;
|
|||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -45,9 +43,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
)
|
||||
@ServiceRegistry
|
||||
@SessionFactory
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SingleTableInheritanceTests {
|
||||
@Test
|
||||
public void basicTest(SessionFactoryScope scope) {
|
||||
|
|
|
@ -35,8 +35,6 @@ import org.hibernate.testing.orm.junit.FailureExpected;
|
|||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -53,9 +51,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
)
|
||||
@ServiceRegistry
|
||||
@SessionFactory
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SmokeTests {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -27,15 +27,10 @@ import org.hibernate.sql.exec.spi.JdbcParameter;
|
|||
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class BasicCriteriaExecutionTests extends BaseNonConfigCoreFunctionalTestCase {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,8 +21,6 @@ import org.hibernate.query.sqm.tree.select.SqmSelection;
|
|||
import org.hibernate.testing.orm.domain.gambit.EntityWithManyToOneSelfReference;
|
||||
import org.hibernate.testing.orm.domain.gambit.SimpleEntity;
|
||||
import org.hibernate.testing.orm.junit.ExpectedException;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -39,9 +37,6 @@ import static org.hibernate.testing.hamcrest.CollectionMatchers.isEmpty;
|
|||
* @author Andrea Boriero
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class AliasCollisionTest extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,8 +20,7 @@ import org.hibernate.query.sqm.tree.predicate.SqmComparisonPredicate;
|
|||
import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
|
||||
import org.hibernate.query.sqm.tree.select.SqmSelectableNode;
|
||||
import org.hibernate.query.sqm.tree.select.SqmSelection;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -33,9 +32,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class AttributePathTests extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,8 +19,6 @@ import org.hibernate.query.sqm.tree.select.SqmSelectableNode;
|
|||
|
||||
import org.hibernate.testing.orm.junit.FailureExpected;
|
||||
import org.hibernate.testing.orm.junit.TestingUtil;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -34,9 +32,6 @@ import static org.junit.Assert.assertEquals;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class CaseExpressionsTest extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,8 +20,6 @@ import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
|
|||
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityOfBasics;
|
||||
import org.hibernate.testing.orm.junit.TestingUtil;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
@ -36,9 +34,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class DynamicInstantiationTests extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,8 +17,7 @@ import org.hibernate.query.sqm.tree.from.SqmRoot;
|
|||
import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
|
||||
import org.hibernate.query.sqm.tree.select.SqmSelection;
|
||||
import org.hibernate.query.sqm.tree.select.SqmSortSpecification;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
|
@ -39,9 +38,6 @@ import static org.junit.jupiter.api.Assertions.fail;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class FromClauseTests extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,16 +11,11 @@ import org.hibernate.orm.test.query.sqm.BaseSqmUnitTest;
|
|||
import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
|
||||
|
||||
import org.hibernate.testing.orm.domain.StandardDomainModel;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class LiteralTests extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,8 +13,6 @@ import org.hibernate.testing.orm.junit.DomainModel;
|
|||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hibernate.orm.test.query.sqm.BaseSqmUnitTest.interpretSelect;
|
||||
|
@ -33,9 +31,6 @@ import static org.hibernate.orm.test.query.sqm.BaseSqmUnitTest.interpretSelect;
|
|||
)
|
||||
)
|
||||
@SessionFactory
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class PagingTests {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,8 +29,6 @@ import org.hibernate.sql.exec.spi.ExecutionContext;
|
|||
|
||||
import org.hibernate.testing.orm.junit.ExpectedException;
|
||||
import org.hibernate.testing.orm.junit.ExpectedExceptionExtension;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
|
@ -46,9 +44,6 @@ import static org.hibernate.testing.hamcrest.CollectionMatchers.hasSize;
|
|||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@ExtendWith( ExpectedExceptionExtension.class )
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class ParameterTests extends BaseSqmUnitTest {
|
||||
@Test
|
||||
@ExpectedException( SemanticException.class )
|
||||
|
|
|
@ -12,8 +12,6 @@ import org.hibernate.testing.orm.junit.DomainModel;
|
|||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
|
@ -23,9 +21,6 @@ import org.junit.jupiter.api.Test;
|
|||
@DomainModel( annotatedClasses = SmokeTests.SimpleEntity.class )
|
||||
@ServiceRegistry
|
||||
@SessionFactory( exportSchema = true )
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class QueryPlanCachingTest {
|
||||
@Test
|
||||
public void testHqlTranslationCaching(SessionFactoryScope scope) {
|
||||
|
|
|
@ -33,8 +33,6 @@ import org.hibernate.testing.orm.domain.gambit.EntityOfLists;
|
|||
import org.hibernate.testing.orm.domain.gambit.EntityOfMaps;
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityOfSets;
|
||||
import org.hibernate.testing.orm.junit.TestingUtil;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.endsWith;
|
||||
|
@ -51,9 +49,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SelectClauseTests extends BaseSqmUnitTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,8 +20,6 @@ import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
|
|||
import org.hibernate.testing.orm.domain.gambit.EntityOfLists;
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityOfMaps;
|
||||
import org.hibernate.testing.orm.domain.gambit.EntityOfSets;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -35,9 +33,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
* @author Gunnar Morling
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class WhereClauseTests extends BaseSqmUnitTest {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,8 +41,6 @@ import org.hibernate.testing.orm.junit.DomainModel;
|
|||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
|
@ -66,9 +64,6 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
|||
)
|
||||
)
|
||||
@SessionFactory
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SmokeTests {
|
||||
@Test
|
||||
public void testSimpleHqlInterpretation(SessionFactoryScope scope) {
|
||||
|
|
|
@ -31,8 +31,6 @@ import org.hibernate.testing.orm.junit.SessionFactory;
|
|||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Tags;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
|
@ -63,9 +61,6 @@ import static org.hibernate.orm.test.metamodel.mapping.SmokeTests.Gender.MALE;
|
|||
}
|
||||
)
|
||||
@SessionFactory( exportSchema = true )
|
||||
@Tags({
|
||||
@Tag("RunnableIdeTest"),
|
||||
})
|
||||
public class SmokeTests {
|
||||
|
||||
@BeforeEach
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
|||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.jdbc.SQLStatementInterceptor;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -47,7 +46,7 @@ public class InClauseParameterPaddingTest extends BaseEntityManagerFunctionalTes
|
|||
|
||||
@Override
|
||||
protected void afterEntityManagerFactoryBuilt() {
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 1; i < 10; i++ ) {
|
||||
Person person = new Person();
|
||||
person.setId( i );
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
|||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.jdbc.SQLStatementInterceptor;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.hibernate.test.util.jdbc.PreparedStatementSpyConnectionProvider;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -59,7 +58,7 @@ public class MaxInExpressionParameterPaddingTest extends BaseEntityManagerFuncti
|
|||
|
||||
@Override
|
||||
protected void afterEntityManagerFactoryBuilt() {
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 0; i < MAX_COUNT; i++ ) {
|
||||
Person person = new Person();
|
||||
person.setId( i );
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.hibernate.annotations.UpdateTimestamp;
|
|||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -63,7 +62,7 @@ public class AnnotationMappingJoinClassTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Override
|
||||
protected void prepareTest() {
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
TaskStatus taskStatus = new TaskStatus();
|
||||
taskStatus.setName("Enabled");
|
||||
taskStatus.setDisplayName("Enabled");
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.hibernate.query.Query;
|
|||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -47,7 +46,7 @@ public class HbmMappingJoinClassTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Override
|
||||
protected void prepareTest() {
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
TaskStatus taskStatus = new TaskStatus();
|
||||
taskStatus.setName("Enabled");
|
||||
taskStatus.setDisplayName("Enabled");
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.hibernate.stat.QueryStatistics;
|
|||
import org.hibernate.stat.Statistics;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||
|
@ -49,7 +48,7 @@ public class QueryPlanCacheStatisticsTest extends BaseEntityManagerFunctionalTes
|
|||
SessionFactory sessionFactory = entityManagerFactory().unwrap( SessionFactory.class );
|
||||
statistics = sessionFactory.getStatistics();
|
||||
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( long i = 1; i <= 5; i++ ) {
|
||||
if ( i % 3 == 0 ) {
|
||||
entityManager.flush();
|
||||
|
|
|
@ -20,7 +20,6 @@ import javax.persistence.Version;
|
|||
import org.hibernate.cfg.AvailableSettings;
|
||||
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -68,7 +67,7 @@ public class BatchOptimisticLockingTest extends
|
|||
} );
|
||||
|
||||
try {
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
List<Person> persons = session.createQuery( "select p from Person p").getResultList();
|
||||
|
||||
for ( int i = 0; i < persons.size(); i++ ) {
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.hibernate.persister.entity.EntityPersister;
|
|||
import org.hibernate.resource.jdbc.spi.StatementInspector;
|
||||
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -158,7 +157,7 @@ public class BatchFetchNotFoundIgnoreDefaultStyleTest extends BaseCoreFunctional
|
|||
public void testMostNotFoundFromQuery() {
|
||||
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
// delete all but last Task entity
|
||||
for ( int i = 0; i < 7; i++ ) {
|
||||
session.delete( tasks.get( i ) );
|
||||
|
|
|
@ -32,7 +32,6 @@ import org.hibernate.testing.TestForIssue;
|
|||
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
|
||||
import org.hibernate.testing.bytecode.enhancement.EnhancementOptions;
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -132,7 +131,7 @@ public class LoadANonExistingEntityTest extends BaseNonConfigCoreFunctionalTestC
|
|||
@Before
|
||||
public void setUpData() {
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
for ( int i = 0; i < NUMBER_OF_ENTITIES; i++ ) {
|
||||
final Employee employee = new Employee();
|
||||
employee.id = i + 1;
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.hibernate.testing.TestForIssue;
|
|||
import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
|
||||
import org.hibernate.testing.bytecode.enhancement.EnhancementOptions;
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -68,7 +67,7 @@ public class LoadANonExistingNotFoundBatchEntityTest extends BaseNonConfigCoreFu
|
|||
statistics.clear();
|
||||
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
List<Employee> employees = new ArrayList<>( NUMBER_OF_ENTITIES );
|
||||
for ( int i = 0 ; i < NUMBER_OF_ENTITIES ; i++ ) {
|
||||
employees.add( session.load( Employee.class, i + 1 ) );
|
||||
|
@ -94,7 +93,7 @@ public class LoadANonExistingNotFoundBatchEntityTest extends BaseNonConfigCoreFu
|
|||
statistics.clear();
|
||||
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
for ( int i = 0 ; i < NUMBER_OF_ENTITIES ; i++ ) {
|
||||
Employee employee = session.get( Employee.class, i + 1 );
|
||||
assertNull( employee.employer );
|
||||
|
@ -116,7 +115,7 @@ public class LoadANonExistingNotFoundBatchEntityTest extends BaseNonConfigCoreFu
|
|||
statistics.clear();
|
||||
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
for ( int i = 0; i < NUMBER_OF_ENTITIES; i++ ) {
|
||||
Employee employee = session.get( Employee.class, i + 1 );
|
||||
Employer employer = new Employer();
|
||||
|
@ -128,7 +127,7 @@ public class LoadANonExistingNotFoundBatchEntityTest extends BaseNonConfigCoreFu
|
|||
);
|
||||
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
for ( int i = 0; i < NUMBER_OF_ENTITIES; i++ ) {
|
||||
Employee employee = session.get( Employee.class, i + 1 );
|
||||
assertTrue( Hibernate.isInitialized( employee.employer ) );
|
||||
|
@ -150,7 +149,7 @@ public class LoadANonExistingNotFoundBatchEntityTest extends BaseNonConfigCoreFu
|
|||
@Before
|
||||
public void setUpData() {
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
for ( int i = 0; i < NUMBER_OF_ENTITIES; i++ ) {
|
||||
final Employee employee = new Employee();
|
||||
employee.id = i + 1;
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.junit.Test;
|
|||
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -55,7 +54,7 @@ public class SQLServerDialectPaginationTest extends BaseEntityManagerFunctionalT
|
|||
@Test
|
||||
public void testPaginationQuery() {
|
||||
// prepare some test data
|
||||
doInJPA( this::entityManagerFactory, (TransactionUtil.JPATransactionVoidFunction)entityManager -> {
|
||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||
for ( int i = 1; i <= 20; ++i ) {
|
||||
final SimpleEntity entity = new SimpleEntity( i, "Entity" + i );
|
||||
entityManager.persist( entity );
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.hibernate.testing.DialectChecks;
|
|||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -93,7 +92,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
|
||||
public void doBatchInsertUpdateJoined(int nEntities, int nBeforeFlush) {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
for ( int i = 0; i < nEntities; i++ ) {
|
||||
Employee e = new Employee();
|
||||
e.getId();
|
||||
|
@ -111,7 +110,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -123,7 +122,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -140,7 +139,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
public void testAssertSubclassInsertedSuccessfullyAfterCommit() {
|
||||
final int nEntities = 10;
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
for ( int i = 0; i < nEntities; i++ ) {
|
||||
Employee e = new Employee();
|
||||
e.setName( "Mark" );
|
||||
|
@ -158,7 +157,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
Assert.assertEquals( nEntities, numberOfInsertedEmployee );
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -191,7 +190,7 @@ public class IdentityJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
} );
|
||||
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.hibernate.cfg.Environment;
|
|||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -89,7 +88,7 @@ public class JoinedSubclassBatchingTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
public void doBatchInsertUpdateJoined(int nEntities, int nBeforeFlush) {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
for ( int i = 0; i < nEntities; i++ ) {
|
||||
Employee e = new Employee();
|
||||
e.getId();
|
||||
|
@ -107,7 +106,7 @@ public class JoinedSubclassBatchingTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -119,7 +118,7 @@ public class JoinedSubclassBatchingTest extends BaseCoreFunctionalTestCase {
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.hibernate.testing.DialectChecks;
|
|||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -93,7 +92,7 @@ public class SequenceJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
|
||||
public void doBatchInsertUpdateJoined(int nEntities, int nBeforeFlush) {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
for ( int i = 0; i < nEntities; i++ ) {
|
||||
Employee e = new Employee();
|
||||
e.getId();
|
||||
|
@ -111,7 +110,7 @@ public class SequenceJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -123,7 +122,7 @@ public class SequenceJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
}
|
||||
} );
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
@ -155,7 +154,7 @@ public class SequenceJoinedSubclassBatchingTest extends BaseCoreFunctionalTestCa
|
|||
} );
|
||||
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)s -> {
|
||||
doInHibernate( this::sessionFactory, s -> {
|
||||
int i = 0;
|
||||
ScrollableResults sr = s.createQuery(
|
||||
"select e from Employee e" )
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.hibernate.query.Query;
|
|||
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
|
||||
|
@ -41,7 +40,7 @@ public abstract class AbstractSkipLockedTest
|
|||
@RequiresDialect({ SQLServer2005Dialect.class })
|
||||
public void testSQLServerSkipLocked() {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
for ( long i = 1; i <= 10; i++ ) {
|
||||
BatchJob batchJob = new BatchJob();
|
||||
batchJob.setId( i );
|
||||
|
@ -74,7 +73,7 @@ public abstract class AbstractSkipLockedTest
|
|||
@RequiresDialect({ PostgreSQL95Dialect.class })
|
||||
public void testPostgreSQLSkipLocked() {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
for ( long i = 1; i <= 10; i++ ) {
|
||||
BatchJob batchJob = new BatchJob();
|
||||
batchJob.setId( i );
|
||||
|
@ -113,7 +112,7 @@ public abstract class AbstractSkipLockedTest
|
|||
@RequiresDialect({ Oracle8iDialect.class })
|
||||
public void testOracleSkipLocked() {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
for ( long i = 1; i <= 10; i++ ) {
|
||||
BatchJob batchJob = new BatchJob();
|
||||
batchJob.setId( i );
|
||||
|
@ -148,7 +147,7 @@ public abstract class AbstractSkipLockedTest
|
|||
@RequiresDialect({ MySQL8Dialect.class })
|
||||
public void testMySQLSkipLocked() {
|
||||
|
||||
doInHibernate( this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
doInHibernate( this::sessionFactory, session -> {
|
||||
for ( long i = 1; i <= 10; i++ ) {
|
||||
BatchJob batchJob = new BatchJob();
|
||||
batchJob.setId( i );
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.hibernate.stat.Statistics;
|
|||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||
import org.hibernate.testing.transaction.TransactionUtil;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -86,7 +85,7 @@ public class MultiLoadSubSelectCollectionTest extends BaseNonConfigCoreFunctiona
|
|||
@TestForIssue( jiraKey = "HHH-12740" )
|
||||
public void testSubselect() {
|
||||
doInHibernate(
|
||||
this::sessionFactory, (TransactionUtil.HibernateTransactionConsumer)session -> {
|
||||
this::sessionFactory, session -> {
|
||||
|
||||
|
||||
List<Parent> list = session.byMultipleIds( Parent.class ).multiLoad( ids(56) );
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
|
||||
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
|
||||
|
||||
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
|
||||
|
||||
description = 'Support for testing Hibernate ORM functionality'
|
||||
|
@ -45,37 +43,6 @@ sourceSets.test.resources {
|
|||
setSrcDirs( ['src/test/java'] )
|
||||
}
|
||||
|
||||
tasks.eclipse.dependsOn(cleanEclipse)
|
||||
eclipse {
|
||||
classpath {
|
||||
file {
|
||||
whenMerged { classpath ->
|
||||
Set exclusionSourceSet = [
|
||||
//May be a saide efect of 'gradlew_process_test_resources' on hibernate-core.gradle. It will be?!
|
||||
'/org.eclipse.ui.externaltools.ExternalToolBuilder'
|
||||
]
|
||||
List newSourceSet = []
|
||||
classpath.entries.each { item ->
|
||||
if( !exclusionSourceSet.contains( item.path ) ) {
|
||||
//println( 'INCLUDING: ' + item )
|
||||
newSourceSet.add( item )
|
||||
} else {
|
||||
//println( 'NOT INCLUDING: ' + item )
|
||||
}
|
||||
}
|
||||
println( 'newSourceSet:' )
|
||||
println( newSourceSet )
|
||||
|
||||
def hibernateCore = new ProjectDependency('/hibernate-core')
|
||||
newSourceSet += [
|
||||
hibernateCore
|
||||
]
|
||||
classpath.entries = newSourceSet
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo : Fold into hibernate-core and publish in separate publications
|
||||
// once http://issues.gradle.org/browse/GRADLE-2966 is resolved;
|
||||
// that will allow us to keep the same artifactId and publish the pom
|
||||
|
|
Loading…
Reference in New Issue