Skip to content

Commit

Permalink
Fix Pax Exam to use https connections to Maven. (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
whikloj authored Mar 11, 2020
1 parent b0c2bd1 commit 8c6bc55
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ subprojects {
karaf: '4.0.6',
osgiCore: '6.0.0',
osgiFramework: '1.9.0',
paxExam: '4.13.1',
paxExam: '4.13.2',
slf4j: '1.7.28',
xercesServiceMix: '2.11.0_1'
]
Expand Down
3 changes: 3 additions & 0 deletions karaf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ tasks.test.dependsOn tasks.generateDependsFile
test {
systemProperty "project.version", "${project.version}"

systemProperty "org.ops4j.pax.url.mvn.useFallbackRepositories" ,"false"
systemProperty "org.ops4j.pax.url.mvn.repositories", "https://repo1.maven.org/maven2@id=central"

// Uncomment to enable remote debugging of internal Karaf container on port 5005
//systemProperty "debug.remote", "true"

Expand Down
41 changes: 18 additions & 23 deletions karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import javax.inject.Inject;

import org.apache.karaf.features.FeaturesService;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.ConfigurationManager;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.MavenUtils;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
Expand All @@ -64,7 +64,6 @@
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
@Ignore
public class KarafIT {

private static Logger LOGGER = getLogger(KarafIT.class);
Expand All @@ -85,7 +84,7 @@ public Option[] config() throws Exception {
final boolean debugExam = Boolean.parseBoolean(cm.getProperty("debug.keepExam", "false"));

final String islandoraHttp = getBundleUri("islandora-http-client", version);
final String isladnoraEvent = getBundleUri("islandora-event-support", version);
final String islandoraEvent = getBundleUri("islandora-event-support", version);
final String islandoraIndexFcrepo = getBundleUri("islandora-indexing-fcrepo", version);
final String islandoraIndexTriple = getBundleUri("islandora-indexing-triplestore", version);
final String islandoraConnectDeriv = getBundleUri("islandora-connector-derivative", version);
Expand All @@ -97,49 +96,45 @@ public Option[] config() throws Exception {
"toolbox-features");
final String activemqVersion = MavenUtils.getArtifactVersion("org.apache.activemq", "activemq-karaf");


return options(
when( debugRemote ).useOptions(
debugConfiguration( "5005", true )
),
karafDistributionConfiguration()
.frameworkUrl(
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.version(karafVersion)
.type("zip")
CoreOptions.maven().groupId("org.apache.karaf").artifactId("apache-karaf")
.version(karafVersion).type("zip")
)
.karafVersion(karafVersion)
.name("Apache Karaf")
.unpackDirectory(new File("build/exam"))
.useDeployFolder(false),
when( debugExam ).useOptions(
keepRuntimeFolder()
),
logLevel(LogLevel.INFO),
configureConsole()
.ignoreLocalConsole()
.ignoreRemoteShell(),
.ignoreLocalConsole(),
editConfigurationFilePut(
"etc/org.apache.karaf.features.repos.cfg",
"fcrepo-camel",
"etc/org.apache.karaf.features.repos.cfg", "fcrepo-camel",
"mvn:org.fcrepo.camel/fcrepo-camel/" + fcrepoCamelVersion + "/xml/features"),
editConfigurationFilePut(
"etc/org.apache.karaf.features.repos.cfg",
"fcrepo-camel-toolbox",
"etc/org.apache.karaf.features.repos.cfg", "fcrepo-camel-toolbox",
"mvn:org.fcrepo.camel/toolbox-features/" + fcrepoCamelToolboxVersion + "/xml/features"),
editConfigurationFilePut(
"etc/org.apache.karaf.features.repos.cfg",
"activemq",
"etc/org.apache.karaf.features.repos.cfg", "activemq",
"mvn:org.apache.activemq/activemq-karaf/" + activemqVersion + "/xml/features"),
editConfigurationFilePut(
"etc/org.apache.karaf.features.cfg",
"featuresBoot",
"standard"
"etc/org.apache.karaf.features.cfg", "featuresBoot", "standard"
),
editConfigurationFilePut(
"etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories",
"https://repo1.maven.org/maven2@id=central"
),
editConfigurationFilePut(
"etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.proxySupport",
"true"
"org.ops4j.pax.url.mvn.useFallbackRepositories",
"false"
),
features(maven().groupId("org.apache.karaf.features").artifactId("standard")
.versionAsInProject().classifier("features").type("xml"), "scr"),
Expand All @@ -161,7 +156,7 @@ public Option[] config() throws Exception {
systemProperty("c.i.a.triplestore-bundle").value(islandoraIndexTriple),

bundle(islandoraHttp).start(),
bundle(isladnoraEvent).start(),
bundle(islandoraEvent).start(),
bundle(islandoraConnectDeriv).start(),
bundle(islandoraIndexFcrepo).start(),
bundle(islandoraIndexTriple).start(),
Expand Down

0 comments on commit 8c6bc55

Please sign in to comment.