Skip to content

Commit

Permalink
[CONVERSION COMMIT] Use EAP in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise committed Dec 9, 2024
1 parent 6209dda commit 98eadb3
Show file tree
Hide file tree
Showing 17 changed files with 185 additions and 15 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
<release.short.version>5.1</release.short.version>
<docs.directory>${project.basedir}/../docs/releases/${release.short.version}</docs.directory>

<!-- test properties for product -->
<wildfly.test.server.producer>org.jboss.eap:wildfly-ee-galleon-pack</wildfly.test.server.producer>
<wildfly.channel.groupId>org.jboss.eap.channels</wildfly.channel.groupId>
<wildfly.channel.artifactId>eap-8.0</wildfly.channel.artifactId>
</properties>

<modules>
Expand All @@ -137,6 +142,11 @@
<name>JBoss Public Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>jboss-enterprise-maven-repository</id>
<name>JBoss Enterprise Maven Repository</name>
<url>https://maven.repository.redhat.com/ga/</url>
</repository>
</repositories>

<build>
Expand Down
5 changes: 5 additions & 0 deletions tests/bootable-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
<artifactId>maven-resolver-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.channel</groupId>
<artifactId>channel-core</artifactId>
<scope>test</scope>
</dependency>
<!-- to fix slf4j warning when provisioning -->
<dependency>
<groupId>org.jboss.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
41 changes: 41 additions & 0 deletions tests/domain-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,47 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<scope>test</scope>
</dependency>
<!-- Only required by tests -->
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.channel</groupId>
<artifactId>channel-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
<inherit-configs>true</inherit-configs>
<inherit-packages>true</inherit-packages>
</feature-pack>
Expand Down
13 changes: 12 additions & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@
<goal>package</goal>
</goals>
<configuration>
<channels>
<channel>
<manifest>
<groupId>${wildfly.channel.groupId}</groupId>
<artifactId>${wildfly.channel.artifactId}</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#${version.org.wildfly}</location>
<location>${wildfly.test.server.producer}</location>
</feature-pack>
</feature-packs>
<provisioning-dir>${project.build.directory}/wildfly</provisioning-dir>
Expand All @@ -65,6 +73,9 @@
<jboss.home>${jboss.home}</jboss.home>
<jboss-as.home>${jboss.home}</jboss-as.home>
<wildfly.test.version>${version.org.wildfly}</wildfly.test.version>
<wildfly.test.server.producer>${wildfly.test.server.producer}</wildfly.test.server.producer>
<wildfly.test.channel.groupId>${wildfly.channel.groupId}</wildfly.test.channel.groupId>
<wildfly.test.channel.artifactId>${wildfly.channel.artifactId}</wildfly.test.channel.artifactId>
<wildfly.management.port>10099</wildfly.management.port>
<wildfly.test.config.dir>${wildfly.test.config.dir}</wildfly.test.config.dir>
</systemPropertyVariables>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@
@RunWith(JUnit4.class)
public abstract class AbstractProvisionConfiguredMojoTestCase extends AbstractMojoTestCase {
private static final String TEST_REPLACE_WF_VERSION = "WF_VERSION";
private static final String TEST_REPLACE_SERVER_PRODUCER = "SERVER_PRODUCER";
private static final String TEST_REPLACE_CHANNEL_GROUP_ID = "CHANNEL_GROUP_ID";
private static final String TEST_REPLACE_CHANNEL_ARTIFACT_ID = "CHANNEL_ARTIFACT_ID";
private static final String TEST_REPLACE_BASE_DIR_ABSOLUTE_URL = "WF_BASE_DIR_ABSOLUTE_URL";
static final String WILDFLY_VERSION = "wildfly.test.version";
static final String WILDFLY_SERVER_PRODUCER = "wildfly.test.server.producer";
static final String WILDFLY_CHANNEL_GROUP_ID = "wildfly.test.channel.groupId";
static final String WILDFLY_CHANNEL_ARTIFACT_ID = "wildfly.test.channel.artifactId";
private final String artifactId;

protected AbstractProvisionConfiguredMojoTestCase(String artifactId) {
Expand Down Expand Up @@ -151,6 +157,15 @@ protected Mojo lookupConfiguredMojo(final Path pom, final String goal) throws Ex
private void patchPomFile(final Path pom) throws IOException {
StringBuilder content = new StringBuilder();
for (String s : Files.readAllLines(pom)) {
if (s.contains(TEST_REPLACE_CHANNEL_GROUP_ID)) {
s = s.replace(TEST_REPLACE_CHANNEL_GROUP_ID, System.getProperty(WILDFLY_CHANNEL_GROUP_ID));
}
if (s.contains(TEST_REPLACE_CHANNEL_ARTIFACT_ID)) {
s = s.replace(TEST_REPLACE_CHANNEL_ARTIFACT_ID, System.getProperty(WILDFLY_CHANNEL_ARTIFACT_ID));
}
if (s.contains(TEST_REPLACE_SERVER_PRODUCER)) {
s = s.replace(TEST_REPLACE_SERVER_PRODUCER, System.getProperty(WILDFLY_SERVER_PRODUCER));
}
if (s.contains(TEST_REPLACE_WF_VERSION)) {
s = s.replace(TEST_REPLACE_WF_VERSION, System.getProperty(WILDFLY_VERSION));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<channels>
<channel>
<manifest>
<groupId>org.wildfly.channels</groupId>
<artifactId>wildfly</artifactId>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>org.wildfly:wildfly-galleon-pack</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<record-provisioning-state>true</record-provisioning-state>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@
<included-dependencies>
<include>org.foo:bar:war</include>
</included-dependencies>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@
<included>::jar</included>
</included-dependencies>
<excluded-dependency-scope>test</excluded-dependency-scope>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
<inherit-packages>false</inherit-packages>
<inherit-configs>false</inherit-configs>
<included-configs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
<groupId>org.jboss.eap.plugins</groupId>
<artifactId>eap-maven-plugin</artifactId>
<configuration>
<channels>
<channel>
<manifest>
<groupId>CHANNEL_GROUP_ID</groupId>
<artifactId>CHANNEL_ARTIFACT_ID</artifactId>
</manifest>
</channel>
</channels>
<feature-packs>
<feature-pack>
<location>wildfly@maven(org.jboss.universe:community-universe)#WF_VERSION</location>
<location>SERVER_PRODUCER</location>
</feature-pack>
</feature-packs>
<layers>
Expand Down

0 comments on commit 98eadb3

Please sign in to comment.