You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by br...@apache.org on 2023/01/19 09:06:43 UTC
[activemq-artemis] branch main updated: ARTEMIS-4131 Support custom maven local repo for karaf tests
This is an automated email from the ASF dual-hosted git repository.
brusdev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new b1207b9a56 ARTEMIS-4131 Support custom maven local repo for karaf tests
b1207b9a56 is described below
commit b1207b9a5687f35f1aebad943ee0f6c13a042486
Author: Domenico Francesco Bruscino <br...@apache.org>
AuthorDate: Thu Jan 19 08:44:58 2023 +0100
ARTEMIS-4131 Support custom maven local repo for karaf tests
---
.../artemis/tests/integration/karaf/client/PaxExamOptions.java | 6 ++++++
.../artemis/tests/integration/karaf/ArtemisFeatureTest.java | 3 +++
2 files changed, 9 insertions(+)
diff --git a/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
index a9c4c4a5dc..165764b898 100644
--- a/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
+++ b/tests/karaf-client-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/client/PaxExamOptions.java
@@ -23,7 +23,9 @@ import org.ops4j.pax.exam.options.DefaultCompositeOption;
import java.io.File;
import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
@@ -43,6 +45,10 @@ public enum PaxExamOptions {
.unpackDirectory(new File("target/paxexam/unpack/")),
keepRuntimeFolder(),
configureConsole().ignoreLocalConsole(),
+ when(System.getProperty("maven.repo.local") != null).useOptions(
+ editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
+ "org.ops4j.pax.url.mvn.localRepository",
+ System.getProperty("maven.repo.local"))),
logLevel(LogLevelOption.LogLevel.INFO)
),
ARTEMIS_CORE_CLIENT(
diff --git a/tests/karaf-server-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java b/tests/karaf-server-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
index b1de10e3e4..2eace9e5af 100644
--- a/tests/karaf-server-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
+++ b/tests/karaf-server-integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java
@@ -68,6 +68,7 @@ import org.osgi.util.tracker.ServiceTracker;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.when;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
@@ -119,6 +120,8 @@ public class ArtemisFeatureTest extends Assert {
editConfigurationFilePut("etc/users.properties", USER, PASSWORD + ",manager"),
// [KARAF-6600] Use https URL for Maven Central
editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central, https://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases"),
+ when(System.getProperty("maven.repo.local") != null).useOptions(
+ editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.localRepository", System.getProperty("maven.repo.local"))),
// uncomment this to debug it.
// debugConfiguration("5005", true),
features(getArtemisMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};