From 009757f06b0ef5ac566ef3d2220385345195666e Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Fri, 2 Dec 2022 20:27:00 +0100 Subject: [PATCH] Add support to infispan 14 --- .../qe/books/BasicInfinispanBookCacheIT.java | 2 +- .../LegacyUsingJksInfinispanBookCacheIT.java | 25 ++++++++ .../books/UsingJksInfinispanBookCacheIT.java | 10 +-- .../src/test/resources/infinispan.xml | 57 ++++++++++++++++++ .../src/test/resources/jks/keystore.jks | Bin 0 -> 2734 bytes .../src/test/resources/jks/truststore.jks | Bin 0 -> 1270 bytes .../DockerContainerManagedResource.java | 3 +- .../quarkus/test/utils/PropertiesUtils.java | 2 +- .../test/bootstrap/InfinispanService.java | 3 + 9 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 examples/infinispan/src/test/java/io/quarkus/qe/books/LegacyUsingJksInfinispanBookCacheIT.java create mode 100644 examples/infinispan/src/test/resources/infinispan.xml create mode 100755 examples/infinispan/src/test/resources/jks/keystore.jks create mode 100755 examples/infinispan/src/test/resources/jks/truststore.jks diff --git a/examples/infinispan/src/test/java/io/quarkus/qe/books/BasicInfinispanBookCacheIT.java b/examples/infinispan/src/test/java/io/quarkus/qe/books/BasicInfinispanBookCacheIT.java index 211e3cac8..cb76434b8 100644 --- a/examples/infinispan/src/test/java/io/quarkus/qe/books/BasicInfinispanBookCacheIT.java +++ b/examples/infinispan/src/test/java/io/quarkus/qe/books/BasicInfinispanBookCacheIT.java @@ -9,7 +9,7 @@ @QuarkusScenario public class BasicInfinispanBookCacheIT extends BaseBookCacheIT { - @Container(image = "docker.io/infinispan/server:13.0", expectedLog = "Infinispan Server.*started in", port = 11222) + @Container(image = "docker.io/infinispan/server:14.0", expectedLog = "Infinispan Server.*started in", port = 11222) static final InfinispanService infinispan = new InfinispanService(); @QuarkusApplication diff --git a/examples/infinispan/src/test/java/io/quarkus/qe/books/LegacyUsingJksInfinispanBookCacheIT.java b/examples/infinispan/src/test/java/io/quarkus/qe/books/LegacyUsingJksInfinispanBookCacheIT.java new file mode 100644 index 000000000..dfd443426 --- /dev/null +++ b/examples/infinispan/src/test/java/io/quarkus/qe/books/LegacyUsingJksInfinispanBookCacheIT.java @@ -0,0 +1,25 @@ +package io.quarkus.qe.books; + +import io.quarkus.test.bootstrap.InfinispanService; +import io.quarkus.test.bootstrap.RestService; +import io.quarkus.test.scenarios.QuarkusScenario; +import io.quarkus.test.services.Container; +import io.quarkus.test.services.QuarkusApplication; + +@QuarkusScenario +public class LegacyUsingJksInfinispanBookCacheIT extends BaseBookCacheIT { + + @Container(image = "docker.io/infinispan/server:13.0", expectedLog = "Infinispan Server.*started in", port = 11222) + static final InfinispanService infinispan = new InfinispanService() + .withConfigFile("jks-config.yaml") + .withSecretFiles("jks/server.jks"); + + @QuarkusApplication + static final RestService app = new RestService() + .withProperty("quarkus.infinispan-client.server-list", infinispan::getInfinispanServerAddress) + .withProperty("quarkus.infinispan-client.auth-username", infinispan.getUsername()) + .withProperty("quarkus.infinispan-client.auth-password", infinispan.getPassword()) + .withProperty("quarkus.infinispan-client.trust-store", "secret::/jks/server.jks") + .withProperty("quarkus.infinispan-client.trust-store-password", "changeit") + .withProperty("quarkus.infinispan-client.trust-store-type", "jks"); +} diff --git a/examples/infinispan/src/test/java/io/quarkus/qe/books/UsingJksInfinispanBookCacheIT.java b/examples/infinispan/src/test/java/io/quarkus/qe/books/UsingJksInfinispanBookCacheIT.java index 8bbf2577f..9fea8fe38 100644 --- a/examples/infinispan/src/test/java/io/quarkus/qe/books/UsingJksInfinispanBookCacheIT.java +++ b/examples/infinispan/src/test/java/io/quarkus/qe/books/UsingJksInfinispanBookCacheIT.java @@ -9,17 +9,17 @@ @QuarkusScenario public class UsingJksInfinispanBookCacheIT extends BaseBookCacheIT { - @Container(image = "docker.io/infinispan/server:13.0", expectedLog = "Infinispan Server.*started in", port = 11222) + @Container(image = "docker.io/infinispan/server:14.0", expectedLog = "Infinispan Server.*started in", port = 11222) static final InfinispanService infinispan = new InfinispanService() - .withConfigFile("jks-config.yaml") - .withSecretFiles("jks/server.jks"); + .withConfigFile("infinispan.xml") + .withSecretFiles("jks/keystore.jks"); @QuarkusApplication static final RestService app = new RestService() .withProperty("quarkus.infinispan-client.server-list", infinispan::getInfinispanServerAddress) .withProperty("quarkus.infinispan-client.auth-username", infinispan.getUsername()) .withProperty("quarkus.infinispan-client.auth-password", infinispan.getPassword()) - .withProperty("quarkus.infinispan-client.trust-store", "secret::/jks/server.jks") - .withProperty("quarkus.infinispan-client.trust-store-password", "changeit") + .withProperty("quarkus.infinispan-client.trust-store", "secret::/jks/truststore.jks") + .withProperty("quarkus.infinispan-client.trust-store-password", "password") .withProperty("quarkus.infinispan-client.trust-store-type", "jks"); } diff --git a/examples/infinispan/src/test/resources/infinispan.xml b/examples/infinispan/src/test/resources/infinispan.xml new file mode 100644 index 000000000..2230a9156 --- /dev/null +++ b/examples/infinispan/src/test/resources/infinispan.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/infinispan/src/test/resources/jks/keystore.jks b/examples/infinispan/src/test/resources/jks/keystore.jks new file mode 100755 index 0000000000000000000000000000000000000000..fa6fb1621f83edd24afe5de1cd4000fdac42db36 GIT binary patch literal 2734 zcma);X*d)L`^L=}!we&1A2F2U$dYErG#L9Kk|FDiQDYm<;8b&h>tJ-w)6AT+i=*?&sruJtzjW1_`-b(7-czO4Jj(cjkfs)@Eq*b_{O*g(r@I2sW$5=L>wHqnjIk) zJG`X)ZZus(yX0NpX4(@UbsbpInBRN)(zBKUr6bPs8gu1WF7v6J`S#TWBeZ)t44W&9 z?-}pE#yXxp)X*-k$+Ff<@(>J-8UHMAs34|Cemt$t%o7x>8dg;HAsWc)*H*uGf_LE( z5iNNVGG?&vf}2tpu|oYmmq}}Zlkxo_=8wgib!8MrA@`@#*Faisk*cDKF?iU%JAtYp zBcJDhv++8&JMnGq2C=##x6miIC3FdW{~n3ho1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>Y{+>hWoIgac|rvx zb%4;-Kn(&XQbm-%kNhlg=q|}v<7@~F#WlHvNUYd&S#6h=Yn`BAdEKwPYu%XVaGV}NKN|efHl*aR zScV3d8gS(E_f<^FS%riwKVS<1-K#?d$o@n+*^`8P$A_FWQVng<#4T7)aDB6jcfS>O zMSGHe$7qM(6DF@s>tO>~N~7!rW&6j%#$ni-L-;T?=IUdRdxlD7%pdr#7fh!OYy~S# zaHpiTj;V%_`9?eM>}z9#Kpd+uw-XT!Ha=RtG}QOfTf`n-MQt?rOY$5;M9%NZpNH4S zAADKyZv$X%NU+v9n!vbD7HseTzq@Zq`0rLXR%(jB7{c!lQ2TwiEhf6pYe|$r*o5$M zAQ|)zb;Gp|I_r&GOE{qny;(f3YCB8uiHJz<{^Ky{yndvE$Y=))GDG%+gGJ(k8{;3U zyTf_^FhT8hgMQqBMa`8a?iSJ;RqEV`Nk9Xe_icpMxm2alnt_hxX>Qa|4Dv~70T^3E zc|3u`ua`~R*%oG@jHTs0PolaZe4u@?PGBQ&%qE~V(0t1^-z$RYLu~T)&?*1sc9BmF z`x7utFflL<1_@w>NC9O71OfpC00bcUs?~k7M+j-){-LH}PTnSnmJhBhJ6XbV&x4R+ gp8G%q6p{vFi%&7>cIQd606`?aa`BjlpaKFX5c63~!~g&Q literal 0 HcmV?d00001 diff --git a/quarkus-test-containers/src/main/java/io/quarkus/test/services/containers/DockerContainerManagedResource.java b/quarkus-test-containers/src/main/java/io/quarkus/test/services/containers/DockerContainerManagedResource.java index aa9fb5056..838c72d08 100644 --- a/quarkus-test-containers/src/main/java/io/quarkus/test/services/containers/DockerContainerManagedResource.java +++ b/quarkus-test-containers/src/main/java/io/quarkus/test/services/containers/DockerContainerManagedResource.java @@ -7,6 +7,7 @@ import static io.quarkus.test.utils.PropertiesUtils.RESOURCE_WITH_DESTINATION_PREFIX_MATCHER; import static io.quarkus.test.utils.PropertiesUtils.RESOURCE_WITH_DESTINATION_SPLIT_CHAR; import static io.quarkus.test.utils.PropertiesUtils.SECRET_PREFIX; +import static io.quarkus.test.utils.PropertiesUtils.SLASH; import java.nio.file.Files; import java.nio.file.Path; @@ -149,7 +150,7 @@ private void addFileToContainer(String filePath) { } private void addFileToContainer(String destinationPath, String hostFilePath) { - String containerFullPath = destinationPath + hostFilePath; + String containerFullPath = destinationPath + SLASH + hostFilePath; innerContainer.withClasspathResourceMapping(hostFilePath, containerFullPath, BindMode.READ_ONLY); } diff --git a/quarkus-test-core/src/main/java/io/quarkus/test/utils/PropertiesUtils.java b/quarkus-test-core/src/main/java/io/quarkus/test/utils/PropertiesUtils.java index 92c48b508..bf794ecef 100644 --- a/quarkus-test-core/src/main/java/io/quarkus/test/utils/PropertiesUtils.java +++ b/quarkus-test-core/src/main/java/io/quarkus/test/utils/PropertiesUtils.java @@ -21,7 +21,7 @@ public final class PropertiesUtils { public static final String RESOURCE_WITH_DESTINATION_PREFIX_MATCHER = ".*" + RESOURCE_WITH_DESTINATION_SPLIT_CHAR + ".*"; public static final String SECRET_PREFIX = "secret::/"; public static final Path TARGET = Path.of("target"); - public static final String SLASH = "/"; + public static final String SLASH = System.getProperty("file.separator"); private static final String AUTOGENERATED_COMMENT = "# This properties file has been auto generated " + "by Quarkus QE Test Framework"; diff --git a/quarkus-test-service-infinispan/src/main/java/io/quarkus/test/bootstrap/InfinispanService.java b/quarkus-test-service-infinispan/src/main/java/io/quarkus/test/bootstrap/InfinispanService.java index 7d928bf96..3662c9fae 100644 --- a/quarkus-test-service-infinispan/src/main/java/io/quarkus/test/bootstrap/InfinispanService.java +++ b/quarkus-test-service-infinispan/src/main/java/io/quarkus/test/bootstrap/InfinispanService.java @@ -64,7 +64,10 @@ public InfinispanService onPreStart(Action action) { withProperty("PASS", getPassword()); if (StringUtils.isNotEmpty(configFile)) { + // legacy -> Infinispan previous to version 14 withProperty("CONFIG_PATH", RESOURCE_PREFIX + SLASH + configFile); + // Infinispan 14+ configuration setup + withProperty("INFINISPAN_CONFIG_PATH", "resource_with_destination::/opt/infinispan/server/conf|" + configFile); } if (userConfigFiles != null) {