Commit 26388442 authored by acoburn's avatar acoburn
Browse files

Create karaf features for installing jena and jsonld libraries and

dependencies.
parent 8d29aa7f
/*
* Copyright 2016 Amherst College
*
* 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 edu.amherst.acdc.itests;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.maven;
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.features;
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;
import static org.slf4j.LoggerFactory.getLogger;
import java.io.File;
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.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.slf4j.Logger;
/**
* @author Aaron Coburn
* @since May 2, 2016
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class AcrepoJenaLibsIT extends AbstractOSGiIT {
private static Logger LOGGER = getLogger(AcrepoJenaLibsIT.class);
@Configuration
public Option[] config() {
final ConfigurationManager cm = new ConfigurationManager();
final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
final String sshPort = cm.getProperty("karaf.ssh.port");
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
.versionAsInProject().type("zip"))
.unpackDirectory(new File("target", "exam"))
.useDeployFolder(false),
logLevel(LogLevel.WARN),
keepRuntimeFolder(),
configureConsole().ignoreLocalConsole(),
features(maven().groupId("org.apache.karaf.features").artifactId("standard")
.versionAsInProject().classifier("features").type("xml"), "scr"),
features(maven().groupId("edu.amherst.acdc").artifactId("acrepo-karaf")
.type("xml").classifier("features").versionAsInProject(), "acrepo-jena-libs"),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort)
};
}
@Test
public void testInstallation() throws Exception {
assertTrue(featuresService.isInstalled(featuresService.getFeature("acrepo-jena-libs")));
assertTrue(featuresService.isInstalled(featuresService.getFeature("acrepo-jsonld-libs")));
}
}
/*
* Copyright 2016 Amherst College
*
* 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 edu.amherst.acdc.itests;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.maven;
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.features;
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;
import static org.slf4j.LoggerFactory.getLogger;
import java.io.File;
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.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.slf4j.Logger;
/**
* @author Aaron Coburn
* @since May 2, 2016
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class AcrepoJsonLdLibsIT extends AbstractOSGiIT {
private static Logger LOGGER = getLogger(AcrepoJsonLdLibsIT.class);
@Configuration
public Option[] config() {
final ConfigurationManager cm = new ConfigurationManager();
final String rmiRegistryPort = cm.getProperty("karaf.rmiRegistry.port");
final String rmiServerPort = cm.getProperty("karaf.rmiServer.port");
final String sshPort = cm.getProperty("karaf.ssh.port");
return new Option[] {
karafDistributionConfiguration()
.frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf")
.versionAsInProject().type("zip"))
.unpackDirectory(new File("target", "exam"))
.useDeployFolder(false),
logLevel(LogLevel.WARN),
keepRuntimeFolder(),
configureConsole().ignoreLocalConsole(),
features(maven().groupId("org.apache.karaf.features").artifactId("standard")
.versionAsInProject().classifier("features").type("xml"), "scr"),
features(maven().groupId("edu.amherst.acdc").artifactId("acrepo-karaf")
.type("xml").classifier("features").versionAsInProject(), "acrepo-jsonld-libs"),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", rmiRegistryPort),
editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", rmiServerPort),
editConfigurationFilePut("etc/org.apache.karaf.shell.cfg", "sshPort", sshPort)
};
}
@Test
public void testInstallation() throws Exception {
assertTrue(featuresService.isInstalled(featuresService.getFeature("acrepo-jsonld-libs")));
}
}
......@@ -66,8 +66,7 @@
<feature name="acrepo-services-validation" version="${project.version}" resolver="(orb)" start-level="50">
<details>Installs the validation service</details>
<bundle>mvn:org.apache.jena/jena-osgi/${jena.version}</bundle>
<bundle>mvn:com.github.andrewoma.dexx/collection/${dexx.version}</bundle>
<feature version="${project.version}">acrepo-jena-libs</feature>
<bundle>mvn:edu.amherst.acdc/acrepo-services-validation/${project.version}</bundle>
......@@ -91,14 +90,7 @@
<feature name="acrepo-services-jsonld" version="${project.version}" resolver="(orb)" start-level="50">
<details>Installs the JSON-LD transformation OSGi service</details>
<feature version="${camel.version}">camel-jackson</feature>
<bundle dependency="true">mvn:com.github.jsonld-java/jsonld-java/${jsonld.version}</bundle>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient.version}</bundle>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/${httpcore.version}</bundle>
<bundle dependency="true">mvn:commons-io/commons-io/${commons-io.version}</bundle>
<bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
<feature version="${project.version}">acrepo-jsonld-libs</feature>
<bundle>mvn:edu.amherst.acdc/acrepo-services-jsonld/${project.version}</bundle>
</feature>
......@@ -147,6 +139,31 @@
<configfile finalname="/etc/edu.amherst.acdc.fits.rest.cfg">mvn:edu.amherst.acdc/acrepo-fits-rest/${project.version}/cfg/configuration</configfile>
</feature>
<feature name="acrepo-jena-libs" version="${project.version}" resolver="(orb)" start-level="50">
<details>Installs jena and related dependencies</details>
<feature version="${project.version}">acrepo-jsonld-libs</feature>
<bundle>mvn:org.apache.jena/jena-osgi/${jena.version}</bundle>
<bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang.version}</bundle>
<bundle dependency="true">mvn:org.apache.commons/commons-csv/${commons-csv.version}</bundle>
<bundle dependency="true">mvn:org.apache.thrift/libthrift/${thrift.version}</bundle>
<bundle dependency="true">mvn:com.github.andrewoma.dexx/collection/${dexx.version}</bundle>
</feature>
<feature name="acrepo-jsonld-libs" version="${project.version}" resolver="(orb)" start-level="50">
<details>Installs the JSON-LD related bundles</details>
<bundle>mvn:com.github.jsonld-java/jsonld-java/${jsonld.version}</bundle>
<bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/${jackson2.version}</bundle>
<bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson2.version}</bundle>
<bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/${jackson2.version}</bundle>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient.version}</bundle>
<bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/${httpcore.version}</bundle>
<bundle dependency="true">mvn:commons-codec/commons-codec/${commons-codec.version}</bundle>
<bundle dependency="true">mvn:commons-io/commons-io/${commons-io.version}</bundle>
</feature>
</features>
......@@ -64,13 +64,15 @@
<httpcore.version>4.4.5</httpcore.version>
<commons-codec.version>1.10</commons-codec.version>
<dexx.version>0.6</dexx.version>
<commons-csv.version>1.0</commons-csv.version>
<thrift.version>0.9.2</thrift.version>
<jackson2.version>2.7.5</jackson2.version>
<!-- test gear -->
<fcrepo.version>4.5.1</fcrepo.version>
<karaf.version>4.0.5</karaf.version>
<pax-exam.version>4.8.0</pax-exam.version>
<jena.fuseki.version>2.3.1</jena.fuseki.version>
<jackson2.version>2.7.5</jackson2.version>
<!-- OSGi -->
<osgi.import.packages>*</osgi.import.packages>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment