diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index d8336c6fa..066950e73 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -70,22 +70,6 @@ - - org.codehaus.mojo - properties-maven-plugin - 1.2.1 - - - generate-resources - - write-project-properties - - - ${project.build.outputDirectory}/properties-from-pom.properties - - - - org.apache.maven.plugins maven-surefire-plugin diff --git a/integration-tests/src/test/java/org/wildfly/prospero/it/cli/GenerateTest.java b/integration-tests/src/test/java/org/wildfly/prospero/it/cli/GenerateTest.java index a600dbb5b..8ad4b4059 100644 --- a/integration-tests/src/test/java/org/wildfly/prospero/it/cli/GenerateTest.java +++ b/integration-tests/src/test/java/org/wildfly/prospero/it/cli/GenerateTest.java @@ -50,7 +50,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; -import java.util.Properties; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -61,23 +60,10 @@ public class GenerateTest { - private static final String PRODUCT; - private static final String VERSION; - protected static final String BASE_DIST_URL; - protected static final String CORE_VERSION;// = "20.0.1.Final"; - - static { - try { - final Properties properties = new Properties(); - properties.load(GenerateTest.class.getClassLoader().getResourceAsStream("properties-from-pom.properties")); - PRODUCT = (String) properties.get("prospero.test.generate.server.profile"); - VERSION = (String) properties.get("prospero.test.generate.server_dist.version"); - BASE_DIST_URL = (String) properties.get("prospero.test.generate.server_dist.url"); - CORE_VERSION = (String) properties.get("prospero.test.generate.server_core.version"); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + private static final String PRODUCT = TestProperties.GENERATE_SERVER_PROFILE; + private static final String VERSION = TestProperties.GENERATE_SERVER_DIST_VERSION; + protected static final String BASE_DIST_URL = TestProperties.GENERATE_SERVER_DIST_URL; + protected static final String CORE_VERSION = TestProperties.GENERATE_SERVER_CORE_VERSION; @Rule public TemporaryFolder tempDir = new TemporaryFolder(); diff --git a/integration-tests/src/test/java/org/wildfly/prospero/it/utils/TestProperties.java b/integration-tests/src/test/java/org/wildfly/prospero/it/utils/TestProperties.java index f143b98bc..b764ed2cd 100644 --- a/integration-tests/src/test/java/org/wildfly/prospero/it/utils/TestProperties.java +++ b/integration-tests/src/test/java/org/wildfly/prospero/it/utils/TestProperties.java @@ -25,22 +25,27 @@ import java.util.Properties; /** - * Gives access to build properties defined in pom + * Gives access to test properties defined in test.properties */ public class TestProperties { + private static final Properties properties; + static { try { - final Properties properties = new Properties(); - properties.load(TestProperties.class.getClassLoader().getResourceAsStream("properties-from-pom.properties")); + properties = new Properties(); + properties.load(TestProperties.class.getClassLoader().getResourceAsStream("test.properties")); WF_CHANNEL_GROUP_ID = properties.getProperty("prospero.test.base.channel.groupId"); WF_CHANNEL_ARTIFACT_ID = properties.getProperty("prospero.test.base.channel.artifactId"); WF_CHANNEL_VERSION = properties.getProperty("prospero.test.base.channel.version"); - final String testRepoUrls = properties.getProperty("prospero.test.base.repositories"); - TEST_REPO_URLS = Arrays.asList(testRepoUrls.split(",")); + TEST_REPO_URLS = Arrays.asList(properties.getProperty("prospero.test.base.repositories").split(",")); DATASOURCE_FP_GROUPID = properties.getProperty("prospero.test.datasources-feature-pack.groupId"); DATASOURCE_FP_ARTIFACTID = properties.getProperty("prospero.test.datasources-feature-pack.artifactId"); DATASOURCE_FP_VERSION = properties.getProperty("prospero.test.datasources-feature-pack.version"); SERVER_PROFILE = properties.getProperty("prospero.test.server.profile"); + GENERATE_SERVER_PROFILE = properties.getProperty("prospero.test.generate.server.profile"); + GENERATE_SERVER_DIST_VERSION = properties.getProperty("prospero.test.generate.server_dist.version"); + GENERATE_SERVER_DIST_URL = properties.getProperty("prospero.test.generate.server_dist.url"); + GENERATE_SERVER_CORE_VERSION = properties.getProperty("prospero.test.generate.server_core.version"); } catch (IOException e) { throw new RuntimeException("Unable to read properties file", e); } @@ -54,6 +59,10 @@ public class TestProperties { public static final String DATASOURCE_FP_ARTIFACTID; public static final String DATASOURCE_FP_VERSION; public static final String SERVER_PROFILE; + public static final String GENERATE_SERVER_PROFILE; + public static final String GENERATE_SERVER_DIST_VERSION; + public static final String GENERATE_SERVER_DIST_URL; + public static final String GENERATE_SERVER_CORE_VERSION; public static List testReposToUrls() { return TEST_REPO_URLS.stream().map(url -> { @@ -65,4 +74,7 @@ public static List testReposToUrls() { }).toList(); } + public static String getProperty(String name) { + return properties.getProperty(name); + } } diff --git a/integration-tests/src/test/java/org/wildfly/prospero/test/BuildProperties.java b/integration-tests/src/test/java/org/wildfly/prospero/test/BuildProperties.java deleted file mode 100644 index f259a791d..000000000 --- a/integration-tests/src/test/java/org/wildfly/prospero/test/BuildProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2024 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wildfly.prospero.test; - -import java.io.IOException; -import java.util.Properties; - -/** - * Access to the Maven build properties - */ -public class BuildProperties { - - private static final Properties properties; - - static { - properties = new Properties(); - try { - properties.load(BuildProperties.class.getClassLoader().getResourceAsStream("properties-from-pom.properties")); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public static String getProperty(String name) { - return properties.getProperty(name); - } -} diff --git a/integration-tests/src/test/java/org/wildfly/prospero/test/TestLocalRepository.java b/integration-tests/src/test/java/org/wildfly/prospero/test/TestLocalRepository.java index 17648d858..e8240a9c2 100644 --- a/integration-tests/src/test/java/org/wildfly/prospero/test/TestLocalRepository.java +++ b/integration-tests/src/test/java/org/wildfly/prospero/test/TestLocalRepository.java @@ -39,13 +39,14 @@ import org.jboss.galleon.ProvisioningException; import org.wildfly.channel.ChannelManifest; import org.wildfly.channel.ChannelManifestMapper; +import org.wildfly.prospero.it.utils.TestProperties; import org.wildfly.prospero.wfchannel.MavenSessionManager; /** * Utility class to generate a local Maven repository and deploy artifacts to it */ public class TestLocalRepository { - public static final String GALLEON_PLUGINS_VERSION = BuildProperties.getProperty("version.org.wildfly.galleon-plugins"); + public static final String GALLEON_PLUGINS_VERSION = TestProperties.getProperty("version.org.wildfly.galleon-plugins"); private final Path root; private final RepositorySystem system; diff --git a/integration-tests/src/test/resources/test.properties b/integration-tests/src/test/resources/test.properties new file mode 100644 index 000000000..74ffa33bd --- /dev/null +++ b/integration-tests/src/test/resources/test.properties @@ -0,0 +1,13 @@ +prospero.test.base.channel.groupId=org.wildfly.channels +prospero.test.base.channel.artifactId=wildfly +prospero.test.base.channel.version=34.0.0.Final +prospero.test.base.repositories=https://repo1.maven.org/maven2/,https://repository.jboss.org/nexus/content/groups/public/ +prospero.test.datasources-feature-pack.groupId=org.wildfly +prospero.test.datasources-feature-pack.artifactId=wildfly-datasources-galleon-pack +prospero.test.datasources-feature-pack.version=4.0.0.Final +prospero.test.server.profile=wildfly +prospero.test.generate.server.profile=wildfly +prospero.test.generate.server_dist.version=28.0.0.Final +prospero.test.generate.server_dist.url=https://repo1.maven.org/maven2/org/wildfly/wildfly-dist/28.0.0.Final/wildfly-dist-28.0.0.Final.zip +prospero.test.generate.server_core.version=20.0.1.Final +version.org.wildfly.galleon-plugins=8.1.5.Final