Skip to content

Commit 5470b77

Browse files
committed
Share tests across modules
1 parent 07d594d commit 5470b77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+33
-9
lines changed

buildSrc/src/main/groovy/shared-testing.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
// Sets up shared testing
3+
// to execute tests from hibernate-models in the context of other modules.
4+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
16
plugins {
27
id "testing"
38
}
@@ -24,7 +29,7 @@ configurations {
2429
}
2530

2631
dependencies {
27-
testImplementation project( path: ":hibernate-models", configuration: "exposedTestClasses" )
32+
testImplementation project( ":hibernate-models-testing" )
2833

2934
sharedTestClasses project(path: ':hibernate-models', configuration: 'exposedTestClasses')
3035
sharedTestResources project(path: ':hibernate-models', configuration: 'exposedTestResources')

buildSrc/src/main/groovy/testing.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
// Module that need testing
3+
// - automatically applied by published-java-module
4+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
16
plugins {
27
id "java-module"
38
id "jacoco"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.hibernate.models.spi.ClassLoading;
1414
import org.hibernate.models.spi.RegistryPrimer;
1515
import org.hibernate.models.spi.SourceModelBuildingContext;
16-
import org.hibernate.models.testing.intg.TestingModelContextFactory;
16+
import org.hibernate.models.testing.intg.ModelContextFactory;
1717
import org.hibernate.models.testing.orm.JpaAnnotations;
1818

1919
import org.jboss.jandex.Index;
@@ -24,7 +24,7 @@
2424
/**
2525
* @author Steve Ebersole
2626
*/
27-
public class JandexTestingModelContextFactoryImpl implements TestingModelContextFactory {
27+
public class JandexModelContextFactoryImpl implements ModelContextFactory {
2828
@Override
2929
public SourceModelBuildingContext createModelContext(
3030
RegistryPrimer registryPrimer,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.hibernate.models.testing.shared.intg.JandexModelContextFactoryImpl

hibernate-models-jandex/src/test/resources/META-INF/services/org.hibernate.models.testing.intg.TestingModelContextFactory

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins {
2+
id 'java-module'
3+
}
4+
5+
description = "Test fixtures for modules performing tests"
6+
7+
dependencies {
8+
implementation project( ":hibernate-models" )
9+
implementation jakartaLibs.jpa
10+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
*
1414
* @author Steve Ebersole
1515
*/
16-
public interface TestingModelContextFactory {
16+
public interface ModelContextFactory {
1717
SourceModelBuildingContext createModelContext(RegistryPrimer registryPrimer, Class<?>... modelClasses);
1818
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)