Skip to content

Commit

Permalink
fix(feature.xml): fix the modules and versions
Browse files Browse the repository at this point in the history
-add additional test to check the full feature
-update versions of camunda-connect and spin
  • Loading branch information
rbraeunlich committed Sep 4, 2016
1 parent df61336 commit d460cee
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 10 deletions.
22 changes: 15 additions & 7 deletions camunda-bpm-karaf-feature/src/main/resources/features.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">

<feature name="spring" version="${spring.framework.version}">
<feature name="camunda-spring" version="${spring.framework.version}">
<bundle>mvn:org.springframework/spring-asm/${spring.framework.version}</bundle>
<bundle>mvn:org.springframework/spring-core/${spring.framework.version}</bundle>
<bundle>mvn:org.springframework/spring-beans/${spring.framework.version}</bundle>
</feature>

<feature name="camunda-optionals" version="${camunda-bpm.version}">
<bundle>mvn:javax.persistence/com.springsource.javax.persistence/2.0.0</bundle>
<bundle>mvn:javax.servlet/javax.servlet-api/3.0.1</bundle>
<bundle>mvn:javax.transaction/com.springsource.javax.transaction/1.1.0</bundle>
<feature name="javax-bundles" version="${camunda-bpm.version}">
<bundle>mvn:javax.persistence/com.springsource.javax.persistence/1.99.0</bundle>
<bundle>mvn:javax.servlet/com.springsource.javax.servlet/2.5.0</bundle>
<bundle>mvn:javax.enterprise/cdi-api/1.2</bundle>
<bundle>mvn:javax.inject/com.springsource.javax.inject/1.0.0</bundle>
<bundle>mvn:javax.el/javax.el-api/2.2.5</bundle>
<bundle>mvn:javax.annotation/javax.annotation-api/1.2</bundle>
<bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
<bundle>mvn:javax.transaction/javax.transaction-api/1.2</bundle>
<bundle>mvn:javax.ejb/javax.ejb-api/3.2</bundle>
<bundle>mvn:org.apache.xmlcommons/com.springsource.org.apache.xmlcommons/1.3.4</bundle>
<bundle>mvn:javax.mail/com.springsource.javax.mail/1.4.5</bundle>
</feature>

<feature name="camunda-optionals" version="${camunda-bpm.version}">
<feature version="${camunda-bpm.version}">javax-bundles</feature>
<bundle>mvn:org.apache.catalina/com.springsource.org.apache.catalina/6.0.24</bundle>
<bundle>mvn:org.apache.coyote/com.springsource.org.apache.coyote/6.0.24</bundle>
<bundle>mvn:org.apache.juli/com.springsource.org.apache.juli.extras/6.0.24</bundle>
Expand Down Expand Up @@ -90,7 +98,7 @@
</feature>

<feature name="camunda-bpm-karaf-feature-full" version="${project.version}">
<feature version="${spring.framework.version}">spring</feature>
<feature version="${spring.framework.version}">camunda-spring</feature>
<feature version="${camunda-bpm.version}">camunda-optionals</feature>
<feature version="${camunda-bpm.version}">camunda-core</feature>
<feature version="${camunda-connect.version}">camunda-connect</feature>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package org.camunda.bpm.extension.osgi.karaf;

import static org.hamcrest.CoreMatchers.either;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
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 java.io.File;

import javax.inject.Inject;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;

@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class KarafFullFeatureIntegrationTest {

@Inject
protected BundleContext ctx;

@Configuration
public Option[] config() {
MavenArtifactUrlReference karafUrl =
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.type("zip")
.versionAsInProject();
return new Option[] {
karafDistributionConfiguration().frameworkUrl(karafUrl)
.unpackDirectory(new File("target/exam")),
// We use this option to allow the container to use artifacts found in private / local repo.
editConfigurationFileExtend("etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.repositories",
"file:${maven.repo.local}@id=mavenlocalrepo@snapshots"),
editConfigurationFileExtend("etc/org.ops4j.pax.url.mvn.cfg",
"org.ops4j.pax.url.mvn.localRepository",
"${maven.repo.local}"),
editConfigurationFileExtend("etc/system.properties",
"maven.repo.local",
System.getProperty("maven.repo.local", "")), keepRuntimeFolder(),
features(new File("target/classes/features.xml").toURI().toString(),
"camunda-bpm-karaf-feature-full") };
}

@Test
public void startCamundaOsgiBundle() throws BundleException {
assertThat(ctx, is(notNullValue()));
Bundle[] bundles = ctx.getBundles();
boolean found = false;
for (Bundle b : bundles) {
assertThat("Bundle " + b.getSymbolicName() + " is in wrong state.",b.getState(), is(either(equalTo(Bundle.RESOLVED)).or(equalTo(Bundle.ACTIVE)).or(equalTo(Bundle.STARTING))));
if (b.getSymbolicName().equals("org.camunda.bpm.extension.osgi")) {
b.start();
found = true;
}
}
if (!found) {
fail("Couldn't find bundle");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class KarafIntegrationTest {
public class KarafMinimalFeatureIntegrationTest {

@Inject
protected BundleContext ctx;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

<properties>
<camunda-bpm.version>7.5.0</camunda-bpm.version>
<camunda-spin.version>1.1.0</camunda-spin.version>
<camunda-connect.version>1.0.1</camunda-connect.version>
<camunda-spin.version>1.4.0-SNAPSHOT</camunda-spin.version>
<camunda-connect.version>1.0.4-SNAPSHOT</camunda-connect.version>
<camunda-commons.version>1.3.0</camunda-commons.version>

<spring.framework.version>3.1.2.RELEASE</spring.framework.version>
Expand Down

0 comments on commit d460cee

Please sign in to comment.