Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ci/jpa-3.2-tck.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ pipeline {
}
parameters {
choice(name: 'IMAGE_JDK', choices: ['jdk17', 'jdk25'], description: 'The JDK base image version to use for the TCK image.')
string(name: 'TCK_VERSION', defaultValue: '3.2.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
string(name: 'TCK_SHA', defaultValue: '', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
string(name: 'TCK_URL', defaultValue: 'https://www.eclipse.org/downloads/download.php?file=/ee4j/jakartaee-tck/jakartaee11/staged/eftl/jakarta-persistence-tck-3.2.0.zip&mirror_id=1', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')
string(name: 'TCK_VERSION', defaultValue: '3.2.1', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
string(name: 'TCK_SHA', defaultValue: '1d282675f43fa13cf8ab2537d6dbfb1e1c95f7b838ab7cdd053e185c363a6519', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
string(name: 'TCK_URL', defaultValue: 'https://download.eclipse.org/jakartaee/persistence/3.2/jakarta-persistence-tck-3.2.1.zip', description: 'The URL from which to download the TCK ZIP file. Only needed for testing staged builds. Ensure the TCK_VERSION variable matches the ZIP file name suffix.')
choice(name: 'RDBMS', choices: ['postgresql','mysql','mssql','oracle','db2','sybase'], description: 'The JDK base image version to use for the TCK image.')
}
stages {
Expand All @@ -37,7 +37,7 @@ pipeline {
}
stage('TCK') {
agent {
label 'LongDuration'
label 'Worker&&Containers'
}
stages {
stage('Build') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.function.Consumer;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.hibernate.query.sqm.tree.expression.SqmBinaryArithmetic;
import org.hibernate.type.BindableType;
import org.hibernate.query.sqm.SqmBindableType;
import org.hibernate.query.sqm.SqmPathSource;
Expand Down Expand Up @@ -316,6 +317,13 @@ public Object visitIsTruePredicate(SqmTruthnessPredicate predicate) {
return predicate;
}

@Override
public Object visitBinaryArithmeticExpression(SqmBinaryArithmetic<?> expression) {
withTypeInference( expression.getRightHandOperand(), expression.getLeftHandOperand() );
withTypeInference( expression.getLeftHandOperand(), expression.getRightHandOperand() );
return expression;
}

@Override
public Object visitComparisonPredicate(SqmComparisonPredicate predicate) {
withTypeInference( predicate.getRightHandExpression(), predicate.getLeftHandExpression() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,28 @@ public void testHhh17001(SessionFactoryScope scope) {
);
}

@Test
@JiraKey( "HHH-20313" )
public void testCompareDoubleToInteger(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
final HibernateCriteriaBuilder cb = session.getCriteriaBuilder();
final CriteriaQuery<Parent> cq = cb.createQuery(Parent.class);
final Root<Parent> root = cq.from(Parent.class);
cq.where( cb.lt( root.get( "price" ), cb.prod( cb.literal( 54 ), 2 ) ) );
session.createQuery(cq).getResultList();
}
);
}


@Entity(name = "Parent")
public static class Parent {
@Id
private Long id;

private String name;
private Double price;

@OneToMany(mappedBy = "parent", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
private Set<Child> children = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,25 @@
import org.junit.platform.engine.support.hierarchical.EngineExecutionContext;
import org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine;
import org.junit.platform.engine.support.hierarchical.ThrowableCollector;
import org.junit.platform.engine.support.store.NamespacedHierarchicalStore;

public class BytecodeEnhancedTestEngine extends HierarchicalTestEngine<JupiterEngineExecutionContext> {

private static final Class<?> LAUNCHER_STORE_FACADE_BEFORE_JUNIT_5_14;
public static final String ENHANCEMENT_EXTENSION_ENGINE_ENABLED = "hibernate.testing.bytecode.enhancement.extension.engine.enabled";

static {
Class<?> launcherStoreFacadeBeforeJunit514 = null;
try {
// The class was moved to a different package in 5.14
launcherStoreFacadeBeforeJunit514 = Class.forName( "org.junit.jupiter.engine.descriptor.LauncherStoreFacade" );
}
catch (ClassNotFoundException e) {
// ignore
}
LAUNCHER_STORE_FACADE_BEFORE_JUNIT_5_14 = launcherStoreFacadeBeforeJunit514;
}

public static boolean isEnabled() {
return "true".equalsIgnoreCase( System.getProperty( ENHANCEMENT_EXTENSION_ENGINE_ENABLED, "false" ) );
}
Expand Down Expand Up @@ -264,6 +278,24 @@ protected JupiterEngineExecutionContext createExecutionContext(ExecutionRequest
catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
// Ignore errors as they are probably due to version mismatches and try the 5.13 way
}
if ( LAUNCHER_STORE_FACADE_BEFORE_JUNIT_5_14 != null ) {
try {
// Try constructing the JupiterEngineExecutionContext the way it was done in 5.13 and before
final Constructor<JupiterEngineExecutionContext> constructorV5_12 = JupiterEngineExecutionContext.class
.getConstructor( EngineExecutionListener.class, JupiterConfiguration.class, LAUNCHER_STORE_FACADE_BEFORE_JUNIT_5_14 );
final Constructor<?> launcherStoreFacadeConstructor =
LAUNCHER_STORE_FACADE_BEFORE_JUNIT_5_14.getConstructor( NamespacedHierarchicalStore.class );
return constructorV5_12.newInstance(
request.getEngineExecutionListener(),
this.getJupiterConfiguration( request ),
launcherStoreFacadeConstructor.newInstance( request.getStore() )
);
}
catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
InvocationTargetException e) {
// Ignore errors as they are probably due to version mismatches and try the 5.13 way
}
}

return new JupiterEngineExecutionContext(
request.getEngineExecutionListener(),
Expand Down
Loading