Skip to content

Commit

Permalink
HSEARCH-5010 Add Lucene 10 to TCK test run
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-bekhta committed Nov 21, 2024
1 parent ab7e4b3 commit b5aec70
Show file tree
Hide file tree
Showing 22 changed files with 334 additions and 6 deletions.
5 changes: 5 additions & 0 deletions bom/public/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<artifactId>hibernate-search-backend-lucene</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene10</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
Expand Down
15 changes: 15 additions & 0 deletions build/parents/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@
<artifactId>hibernate-search-backend-lucene</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene10</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-mapper-pojo-base</artifactId>
Expand Down Expand Up @@ -565,11 +570,21 @@
<artifactId>hibernate-search-util-internal-integrationtest-backend-elasticsearch</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene10</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-mapper-stub</artifactId>
Expand Down
44 changes: 42 additions & 2 deletions integrationtest/backend/lucene/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate.search</groupId>
Expand All @@ -10,7 +10,8 @@
<artifactId>hibernate-search-integrationtest-backend-lucene</artifactId>

<name>Hibernate Search ITs - Backend - Lucene</name>
<description>Hibernate Search integration tests for the Lucene backend, running the Backend TCK in particular</description>
<description>Hibernate Search integration tests for the Lucene backend, running the Backend TCK in particular
</description>

<properties>
<surefire.module>lucene</surefire.module>
Expand All @@ -28,6 +29,11 @@
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene10</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-integrationtest-backend-tck</artifactId>
Expand All @@ -52,6 +58,40 @@
<dependenciesToScan>
<dependency>${project.groupId}:hibernate-search-integrationtest-backend-tck</dependency>
</dependenciesToScan>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.hibernate.search:hibernate-search-util-internal-integrationtest-backend-lucene10</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>
</execution>
<execution>
<id>it-10</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<skip>${test.lucene.skip}</skip>
<!-- WARNING: When using <dependenciesToScan>, be sure to set the Maven property surefire.module -->
<dependenciesToScan>
<dependency>${project.groupId}:hibernate-search-integrationtest-backend-tck</dependency>
</dependenciesToScan>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.hibernate.search:hibernate-search-backend-lucene</classpathDependencyExclude>
<classpathDependencyExclude>org.hibernate.search:hibernate-search-util-internal-integrationtest-backend-lucene</classpathDependencyExclude>
<classpathDependencyExclude>org.apache.lucene:*</classpathDependencyExclude>
</classpathDependencyExcludes>
<additionalClasspathDependencies>
<additionalClasspathDependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene10</artifactId>
<version>${project.version}</version>
</additionalClasspathDependency>
<additionalClasspathDependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene10</artifactId>
<version>${project.version}</version>
</additionalClasspathDependency>
</additionalClasspathDependencies>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.hibernate.search.engine.backend.document.model.dsl.IndexSchemaElement;
import org.hibernate.search.integrationtest.backend.tck.testsupport.configuration.DefaultAnalysisDefinitions;
import org.hibernate.search.integrationtest.backend.tck.testsupport.util.extension.SearchSetupHelper;
import org.hibernate.search.util.impl.integrationtest.backend.lucene.TotalHitsUtils;
import org.hibernate.search.util.impl.integrationtest.mapper.stub.SimpleMappedIndex;
import org.hibernate.search.util.impl.integrationtest.mapper.stub.StubMapperUtils;
import org.hibernate.search.util.impl.test.annotation.TestForIssue;
Expand Down Expand Up @@ -66,8 +67,8 @@ void matchAllDocs_sortByScoreDesc() {
assertThatResult( result ).hasTotalHitCount( DOCUMENT_COUNT );

TopDocs topDocs = result.topDocs();
assertThat( topDocs.totalHits.relation ).isEqualTo( TotalHits.Relation.EQUAL_TO );
assertThat( topDocs.totalHits.value ).isEqualTo( DOCUMENT_COUNT );
assertThat( TotalHitsUtils.relation( topDocs.totalHits ) ).isEqualTo( TotalHits.Relation.EQUAL_TO );
assertThat( TotalHitsUtils.value( topDocs.totalHits ) ).isEqualTo( DOCUMENT_COUNT );
}

private static class IndexBinding {
Expand All @@ -78,8 +79,7 @@ private static class IndexBinding {
"text",
f -> f.asString()
.analyzer( DefaultAnalysisDefinitions.ANALYZER_STANDARD_ENGLISH.name )
)
.toReference();
).toReference();
}
}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<module>util/common</module>
<module>engine</module>
<module>backend/lucene</module>
<module>backend/lucene10</module>
<module>backend/elasticsearch</module>
<module>backend/elasticsearch-aws</module>
<module>mapper/pojo-base</module>
Expand Down
33 changes: 33 additions & 0 deletions util/internal/integrationtest/backend/lucene-common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-License-Identifier: Apache-2.0
Copyright Red Hat Inc. and Hibernate Authors
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest</artifactId>
<version>8.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene-common</artifactId>

<name>Hibernate Search Utils - Internal - ITs - Lucene Common</name>
<description>Hibernate Search integration testing utilities for tests involving the Lucene backend</description>

<dependencies>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene</artifactId>
</dependency>
</dependencies>

</project>

4 changes: 4 additions & 0 deletions util/internal/integrationtest/backend/lucene/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene-common</artifactId>
</dependency>
</dependencies>

</project>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.util.impl.integrationtest.backend.lucene;

import org.apache.lucene.search.TotalHits;

public final class TotalHitsUtils {
private TotalHitsUtils() {
}

public static long value(TotalHits totalHits) {
return totalHits.value;
}

public static TotalHits.Relation relation(TotalHits totalHits) {
return totalHits.relation;
}
}
83 changes: 83 additions & 0 deletions util/internal/integrationtest/backend/lucene10/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-License-Identifier: Apache-2.0
Copyright Red Hat Inc. and Hibernate Authors
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest</artifactId>
<version>8.0.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene10</artifactId>

<name>Hibernate Search Utils - Internal - ITs - Lucene 10</name>
<description>Hibernate Search integration testing utilities for tests involving the Lucene backend</description>

<properties>
<java-version.main.release>21</java-version.main.release>
<version.org.apache.lucene>10.0.0</version.org.apache.lucene>
</properties>

<dependencyManagement>
<dependencies>
<!-- Lucene backend -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analysis-common</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-join</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-facet</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>${version.org.apache.lucene}</version>
</dependency>
<dependency>
<groupId>com.carrotsearch</groupId>
<artifactId>hppc</artifactId>
<version>${version.com.carrotsearch.hppc}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-backend-lucene10</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.search</groupId>
<artifactId>hibernate-search-util-internal-integrationtest-backend-lucene-common</artifactId>
</dependency>
</dependencies>

</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.util.impl.integrationtest.backend.lucene;

import org.apache.lucene.search.TotalHits;

public final class TotalHitsUtils {
private TotalHitsUtils() {
}

public static long value(TotalHits totalHits) {
return totalHits.value();
}

public static TotalHits.Relation relation(TotalHits totalHits) {
return totalHits.relation();
}
}
Loading

0 comments on commit b5aec70

Please sign in to comment.