From d36807efe9ca5eee9406eb3d60f8ff57f460e9cf Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Tue, 25 Jul 2023 23:33:31 +1000 Subject: [PATCH] Remove Old Dev UI: Hibernate ORM Elastic Signed-off-by: Phillip Kruger --- ...earchElasticsearchDevConsoleProcessor.java | 31 ----------- .../resources/dev-templates/embedded.html | 7 --- .../resources/dev-templates/entity-types.html | 54 ------------------- ...ateSearchElasticsearchDevInfoSupplier.java | 14 ----- ...chActiveFalseAndNamedPuActiveTrueTest.java | 50 ----------------- ...ConsoleHibernateSearchActiveFalseTest.java | 36 ------------- .../DevConsoleHibernateSearchSmokeTest.java | 37 ------------- .../test/devconsole/MyIndexedEntity.java | 19 ------- .../namedpu/MyNamedPuIndexedEntity.java | 19 ------- 9 files changed, 267 deletions(-) delete mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/dev/HibernateSearchElasticsearchDevConsoleProcessor.java delete mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html delete mode 100644 extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html delete mode 100644 extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevInfoSupplier.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseAndNamedPuActiveTrueTest.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseTest.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchSmokeTest.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/MyIndexedEntity.java delete mode 100644 integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/namedpu/MyNamedPuIndexedEntity.java diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/dev/HibernateSearchElasticsearchDevConsoleProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/dev/HibernateSearchElasticsearchDevConsoleProcessor.java deleted file mode 100644 index ace9ed5340ed5..0000000000000 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/deployment/dev/HibernateSearchElasticsearchDevConsoleProcessor.java +++ /dev/null @@ -1,31 +0,0 @@ -package io.quarkus.hibernate.search.orm.elasticsearch.deployment.dev; - -import static io.quarkus.deployment.annotations.ExecutionTime.STATIC_INIT; - -import io.quarkus.deployment.IsDevelopment; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.annotations.BuildSteps; -import io.quarkus.deployment.annotations.Record; -import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; -import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem; -import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem; -import io.quarkus.hibernate.search.orm.elasticsearch.deployment.HibernateSearchEnabled; -import io.quarkus.hibernate.search.orm.elasticsearch.runtime.dev.HibernateSearchElasticsearchDevInfoSupplier; -import io.quarkus.hibernate.search.orm.elasticsearch.runtime.dev.HibernateSearchElasticsearchDevRecorder; - -@BuildSteps(onlyIf = { HibernateSearchEnabled.class, IsDevelopment.class }) -@Deprecated // Only useful for the legacy Dev UI -public class HibernateSearchElasticsearchDevConsoleProcessor { - - @BuildStep - public DevConsoleRuntimeTemplateInfoBuildItem exposeInfos(CurateOutcomeBuildItem curateOutcomeBuildItem) { - return new DevConsoleRuntimeTemplateInfoBuildItem("indexedPersistenceUnits", - new HibernateSearchElasticsearchDevInfoSupplier(), this.getClass(), curateOutcomeBuildItem); - } - - @BuildStep - @Record(value = STATIC_INIT, optional = true) - DevConsoleRouteBuildItem invokeEndpoint(HibernateSearchElasticsearchDevRecorder recorder) { - return new DevConsoleRouteBuildItem("entity-types", "POST", recorder.indexEntity()); - } -} diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html deleted file mode 100644 index 9cc1a072f0350..0000000000000 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html +++ /dev/null @@ -1,7 +0,0 @@ - - - Persistence units {info:indexedPersistenceUnits.persistenceUnits.size} - - - Indexed Entities {info:indexedPersistenceUnits.numberOfIndexedEntities} -
diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html deleted file mode 100644 index fd6cdcbffbff0..0000000000000 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html +++ /dev/null @@ -1,54 +0,0 @@ -{#include main} -{#title}Indexed Entities{/title} -{#body} -{#if info:indexedPersistenceUnits.persistenceUnits.isEmpty} -

No indexed entities were found.

-{#else} -
- -
- {#for indexedPersistenceUnit in info:indexedPersistenceUnits.persistenceUnits} -

Persistence Unit {indexedPersistenceUnit.persistenceUnitName}

- - - - - - - - - - - - - - - {#for indexedEntityType in indexedPersistenceUnit.indexedEntities} - - - - - - {/for} - -
-
- -
-
Entity nameEntity type
-
- -
-
{indexedEntityType.jpaName}{indexedEntityType.javaClass}
- {/for} -
- -{/if} -{/body} -{/include} diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevInfoSupplier.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevInfoSupplier.java deleted file mode 100644 index 332d455e9c6a2..0000000000000 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/dev/HibernateSearchElasticsearchDevInfoSupplier.java +++ /dev/null @@ -1,14 +0,0 @@ -package io.quarkus.hibernate.search.orm.elasticsearch.runtime.dev; - -import java.util.function.Supplier; - -@Deprecated // Only useful for the legacy Dev UI -public class HibernateSearchElasticsearchDevInfoSupplier - implements Supplier { - - @Override - public HibernateSearchElasticsearchDevInfo get() { - return HibernateSearchElasticsearchDevController.get().getInfo(); - } - -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseAndNamedPuActiveTrueTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseAndNamedPuActiveTrueTest.java deleted file mode 100644 index 7feac472f60d6..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseAndNamedPuActiveTrueTest.java +++ /dev/null @@ -1,50 +0,0 @@ -package io.quarkus.test.devconsole; - -import org.hamcrest.Matchers; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.test.QuarkusDevModeTest; -import io.quarkus.test.devconsole.namedpu.MyNamedPuIndexedEntity; -import io.restassured.RestAssured; - -/** - * Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would - * not be able to locate the template resources correctly. - */ -public class DevConsoleHibernateSearchActiveFalseAndNamedPuActiveTrueTest { - - @RegisterExtension - static final QuarkusDevModeTest test = new QuarkusDevModeTest() - .withApplicationRoot((jar) -> jar.addAsResource( - new StringAsset("quarkus.datasource.db-kind=h2\n" - + "quarkus.datasource.jdbc.url=jdbc:h2:mem:test\n" - + "quarkus.datasource.\"nameddatasource\".db-kind=h2\n" - + "quarkus.datasource.\"nameddatasource\".jdbc.url=jdbc:h2:mem:test2\n" - // Hibernate Search is inactive for the default PU - + "quarkus.hibernate-orm.datasource=\n" - + "quarkus.hibernate-orm.packages=io.quarkus.test.devconsole\n" - + "quarkus.hibernate-search-orm.active=false\n" - + "quarkus.hibernate-search-orm.elasticsearch.version=7.10\n" - // ... but it's (implicitly) active for a named PU - + "quarkus.hibernate-orm.\"namedpu\".datasource=nameddatasource\n" - + "quarkus.hibernate-orm.\"namedpu\".packages=io.quarkus.test.devconsole.namedpu\n" - + "quarkus.hibernate-search-orm.\"namedpu\".elasticsearch.version=7.10\n" - // Start Hibernate Search offline for the named PU, - // because we don't have dev services except for the default PU - + "quarkus.hibernate-search-orm.\"namedpu\".schema-management.strategy=none\n" - + "quarkus.hibernate-search-orm.\"namedpu\".elasticsearch.version-check.enabled=false\n"), - "application.properties") - .addClasses(MyIndexedEntity.class) - .addClasses(MyNamedPuIndexedEntity.class)); - - @Test - public void testLegacyPages() { - RestAssured.get("q/dev-v1/io.quarkus.quarkus-hibernate-search-orm-elasticsearch/entity-types") - .then() - .statusCode(200) - .body(Matchers.containsString(MyNamedPuIndexedEntity.class.getName())) - .body(Matchers.not(Matchers.containsString(MyIndexedEntity.class.getName()))); - } -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseTest.java deleted file mode 100644 index 254ea53156989..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchActiveFalseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package io.quarkus.test.devconsole; - -import org.hamcrest.Matchers; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.test.QuarkusDevModeTest; -import io.restassured.RestAssured; - -/** - * Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would - * not be able to locate the template resources correctly. - */ -public class DevConsoleHibernateSearchActiveFalseTest { - - @RegisterExtension - static final QuarkusDevModeTest test = new QuarkusDevModeTest() - .withApplicationRoot((jar) -> jar.addAsResource( - new StringAsset("quarkus.datasource.db-kind=h2\n" - + "quarkus.datasource.jdbc.url=jdbc:h2:mem:test\n" - // Hibernate Search is inactive: the dev console should be empty. - + "quarkus.hibernate-search-orm.active=false\n" - + "quarkus.hibernate-search-orm.elasticsearch.version=7.10\n"), - "application.properties") - .addClasses(MyIndexedEntity.class)); - - @Test - public void testLegacyPages() { - RestAssured.get("q/dev-v1/io.quarkus.quarkus-hibernate-search-orm-elasticsearch/entity-types") - .then() - .statusCode(200) - .body(Matchers.containsString("No indexed entities were found")); - } - -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchSmokeTest.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchSmokeTest.java deleted file mode 100644 index cee4f89e75b4a..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/DevConsoleHibernateSearchSmokeTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package io.quarkus.test.devconsole; - -import org.hamcrest.Matchers; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.RegisterExtension; - -import io.quarkus.test.QuarkusDevModeTest; -import io.restassured.RestAssured; - -/** - * Note that this test cannot be placed under the relevant {@code -deployment} module because then the DEV UI processor would - * not be able to locate the template resources correctly. - */ -public class DevConsoleHibernateSearchSmokeTest { - - @RegisterExtension - static final QuarkusDevModeTest test = new QuarkusDevModeTest() - .withApplicationRoot((jar) -> jar.addAsResource( - new StringAsset("quarkus.datasource.db-kind=h2\n" - + "quarkus.datasource.jdbc.url=jdbc:h2:mem:test\n" - + "quarkus.hibernate-search-orm.elasticsearch.version=7.10\n" - // Start offline, we don't have an Elasticsearch cluster here - + "quarkus.hibernate-search-orm.schema-management.strategy=none\n" - + "quarkus.hibernate-search-orm.elasticsearch.version-check.enabled=false\n"), - "application.properties") - .addClasses(MyIndexedEntity.class)); - - @Test - public void testLegacyPages() { - RestAssured.get("q/dev-v1/io.quarkus.quarkus-hibernate-search-orm-elasticsearch/entity-types") - .then() - .statusCode(200) - .body(Matchers.containsString(MyIndexedEntity.class.getName())); - } - -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/MyIndexedEntity.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/MyIndexedEntity.java deleted file mode 100644 index 8919ea3a6f784..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/MyIndexedEntity.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.quarkus.test.devconsole; - -import jakarta.persistence.Entity; -import jakarta.persistence.Id; - -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; - -@Entity -@Indexed -public class MyIndexedEntity { - - @Id - Long id; - - @FullTextField - String field; - -} diff --git a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/namedpu/MyNamedPuIndexedEntity.java b/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/namedpu/MyNamedPuIndexedEntity.java deleted file mode 100644 index 3bb2b7aa182e7..0000000000000 --- a/integration-tests/devmode/src/test/java/io/quarkus/test/devconsole/namedpu/MyNamedPuIndexedEntity.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.quarkus.test.devconsole.namedpu; - -import jakarta.persistence.Entity; -import jakarta.persistence.Id; - -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; - -@Entity -@Indexed -public class MyNamedPuIndexedEntity { - - @Id - Long id; - - @FullTextField - String field; - -}