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
16 changes: 0 additions & 16 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<configuration>
<outputFile>${project.build.outputDirectory}/properties-from-pom.properties</outputFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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<URL> testReposToUrls() {
return TEST_REPO_URLS.stream().map(url -> {
Expand All @@ -65,4 +74,7 @@ public static List<URL> testReposToUrls() {
}).toList();
}

public static String getProperty(String name) {
return properties.getProperty(name);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions integration-tests/src/test/resources/test.properties
Original file line number Diff line number Diff line change
@@ -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
Loading