mirror of https://github.com/apache/activemq.git
move to pax exam 3.4.0
This commit is contained in:
parent
d8f9686d2a
commit
9743dbddb6
|
@ -50,6 +50,17 @@
|
|||
<artifactId>pax-logging-service</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-atinject_1.0_spec</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ops4j.pax.exam</groupId>
|
||||
<artifactId>pax-exam-junit4</artifactId>
|
||||
|
@ -105,9 +116,9 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openengsb.labs.paxexam.karaf</groupId>
|
||||
<artifactId>paxexam-karaf-container</artifactId>
|
||||
<version>${paxexam-karaf-container-version}</version>
|
||||
<groupId>org.ops4j.pax.exam</groupId>
|
||||
<artifactId>pax-exam-container-karaf</artifactId>
|
||||
<version>${pax-exam-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -21,10 +21,11 @@ import org.apache.felix.service.command.CommandSession;
|
|||
import org.apache.karaf.features.FeaturesService;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.TestProbeBuilder;
|
||||
import org.ops4j.pax.exam.junit.ProbeBuilder;
|
||||
import org.ops4j.pax.exam.ProbeBuilder;
|
||||
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
|
||||
import org.ops4j.pax.exam.karaf.options.LogLevelOption;
|
||||
import org.ops4j.pax.exam.options.UrlReference;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.Constants;
|
||||
|
@ -45,10 +46,12 @@ import java.util.concurrent.FutureTask;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
import static org.ops4j.pax.exam.CoreOptions.*;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
|
||||
public abstract class AbstractFeatureTest {
|
||||
|
||||
|
@ -152,19 +155,9 @@ public abstract class AbstractFeatureTest {
|
|||
|
||||
|
||||
public static String karafVersion() {
|
||||
return System.getProperty("karafVersion", "2.3.3");
|
||||
return System.getProperty("karafVersion", "unknown-need-env-var");
|
||||
}
|
||||
|
||||
public static String activemqVersion() {
|
||||
Package p = Package.getPackage("org.apache.activemq");
|
||||
String version=null;
|
||||
if (p != null) {
|
||||
version = p.getImplementationVersion();
|
||||
}
|
||||
return System.getProperty("activemqVersion", version);
|
||||
}
|
||||
|
||||
|
||||
public static UrlReference getActiveMQKarafFeatureUrl() {
|
||||
String type = "xml/features";
|
||||
return mavenBundle().groupId("org.apache.activemq").
|
||||
|
@ -220,15 +213,15 @@ public abstract class AbstractFeatureTest {
|
|||
new Option[]{
|
||||
karafDistributionConfiguration().frameworkUrl(
|
||||
maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("tar.gz").version(karafVersion()))
|
||||
//This version doesn't affect the version of karaf we use
|
||||
//This version doesn't affect the version of karaf we use
|
||||
.karafVersion(karafVersion()).name("Apache Karaf")
|
||||
.unpackDirectory(new File("target/paxexam/unpack/")),
|
||||
|
||||
|
||||
KarafDistributionOption.keepRuntimeFolder(),
|
||||
//logLevel(LogLevelOption.LogLevel.DEBUG),
|
||||
logLevel(LogLevelOption.LogLevel.INFO),
|
||||
replaceConfigurationFile("etc/config.properties", new File(basedir+"/target/classes/org/apache/activemq/karaf/itest/config.properties")),
|
||||
replaceConfigurationFile("etc/custom.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/custom.properties")),
|
||||
scanFeatures(getActiveMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};
|
||||
features(getActiveMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};
|
||||
|
||||
return options;
|
||||
}
|
||||
|
|
|
@ -20,14 +20,14 @@ import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.ops4j.pax.exam.CoreOptions;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.junit.Configuration;
|
||||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
import org.ops4j.pax.exam.Configuration;
|
||||
import org.ops4j.pax.exam.junit.PaxExam;
|
||||
import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import javax.jms.JMSException;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
@RunWith(PaxExam.class)
|
||||
public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest {
|
||||
private static final Integer AMQP_PORT = 61636;
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ import java.util.concurrent.Callable;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.junit.Configuration;
|
||||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
import org.ops4j.pax.exam.Configuration;
|
||||
import org.ops4j.pax.exam.junit.PaxExam;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
@RunWith(PaxExam.class)
|
||||
public class ActiveMQBrokerFeatureTest extends AbstractJmsFeatureTest {
|
||||
|
||||
@Configuration
|
||||
|
|
|
@ -21,21 +21,21 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.ops4j.pax.exam.MavenUtils;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.junit.Configuration;
|
||||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
import org.ops4j.pax.exam.Configuration;
|
||||
import org.ops4j.pax.exam.junit.PaxExam;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
@RunWith(PaxExam.class)
|
||||
public class ActiveMQBrokerNdCamelFeatureTest extends AbstractJmsFeatureTest {
|
||||
|
||||
@Configuration
|
||||
public static Option[] configure() {
|
||||
Option[] baseOptions = configure("activemq", "activemq-camel");
|
||||
return configureBrokerStart(append(scanFeatures(getCamelFeatureUrl(
|
||||
return configureBrokerStart(append(features(getCamelFeatureUrl(
|
||||
MavenUtils.getArtifactVersion("org.apache.camel.karaf", "apache-camel")
|
||||
), "activemq-camel"), baseOptions), "activemq-nd-camel");
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
public class ActiveMQBrokerNdExternalCamelFeatureTest extends AbstractJmsFeatureTest {
|
||||
|
@ -40,7 +40,7 @@ public class ActiveMQBrokerNdExternalCamelFeatureTest extends AbstractJmsFeature
|
|||
Option[] baseOptions = append(
|
||||
replaceConfigurationFile("data/tmp/camel.xml", new File(basedir + "/src/test/resources/org/apache/activemq/karaf/itest/camel.xml")),
|
||||
configure("activemq", "activemq-camel"));
|
||||
return configureBrokerStart(append(scanFeatures(getCamelFeatureUrl(
|
||||
return configureBrokerStart(append(features(getCamelFeatureUrl(
|
||||
MavenUtils.getArtifactVersion("org.apache.camel.karaf", "apache-camel")
|
||||
), "activemq-camel"), baseOptions));
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ import org.junit.Ignore;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.ops4j.pax.exam.CoreOptions;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.junit.Configuration;
|
||||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
import org.ops4j.pax.exam.Configuration;
|
||||
import org.ops4j.pax.exam.junit.PaxExam;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
@RunWith(PaxExam.class)
|
||||
@Ignore("Can fail sometimes. Old web-console is also @deprecated")
|
||||
public class ActiveMQBrokerNdWebConsoleFeatureTest extends ActiveMQBrokerFeatureTest {
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.replaceConfigurationFile;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
public class ActiveMQBrokerRuntimeConfigTest extends AbstractJmsFeatureTest {
|
||||
|
|
|
@ -20,10 +20,10 @@ import org.apache.activemq.ActiveMQConnectionFactory;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.ops4j.pax.exam.Option;
|
||||
import org.ops4j.pax.exam.junit.Configuration;
|
||||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
import org.ops4j.pax.exam.Configuration;
|
||||
import org.ops4j.pax.exam.junit.PaxExam;
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
@RunWith(PaxExam.class)
|
||||
public class ActiveMQClientBundleTest extends AbstractFeatureTest {
|
||||
|
||||
@Configuration
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.ops4j.pax.exam.junit.Configuration;
|
|||
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
|
||||
|
||||
|
||||
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
|
||||
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
|
||||
|
||||
|
||||
@RunWith(JUnit4TestRunner.class)
|
||||
|
|
|
@ -75,6 +75,7 @@ org.osgi.framework.system.packages= \
|
|||
org.osgi.util.tracker;uses:="org.osgi.framework";version="1.5.1", \
|
||||
org.apache.karaf.jaas.boot;version="${karaf-version}", \
|
||||
org.apache.karaf.jaas.boot.principal;version="${karaf-version}", \
|
||||
org.apache.karaf.management.boot;version="${karaf-version}", \
|
||||
org.apache.karaf.version;version="${karaf-version}", \
|
||||
${jre-${java.specification.version}}
|
||||
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -128,7 +128,7 @@
|
|||
<jaxb-basics-version>0.6.4</jaxb-basics-version>
|
||||
<stompjms-version>1.19</stompjms-version>
|
||||
|
||||
<pax-exam-version>2.6.0</pax-exam-version>
|
||||
<pax-exam-version>3.4.0</pax-exam-version>
|
||||
<paxexam-karaf-container-version>1.0.0</paxexam-karaf-container-version>
|
||||
<pax-runner-version>1.6.1</pax-runner-version>
|
||||
<pax-tiny-bundle-version>1.3.1</pax-tiny-bundle-version>
|
||||
|
@ -151,7 +151,7 @@
|
|||
<maven-release-plugin-version>2.4.1</maven-release-plugin-version>
|
||||
<maven-eclipse-plugin-version>2.9</maven-eclipse-plugin-version>
|
||||
<maven-war-plugin-version>2.4</maven-war-plugin-version>
|
||||
<maven-compiler-plugin-version>2.5.1</maven-compiler-plugin-version>
|
||||
<maven-compiler-plugin-version>3.1</maven-compiler-plugin-version>
|
||||
<maven-jar-plugin-version>2.4</maven-jar-plugin-version>
|
||||
<maven-archiver-version>2.5</maven-archiver-version>
|
||||
<maven-source-plugin-version>2.2.1</maven-source-plugin-version>
|
||||
|
|
Loading…
Reference in New Issue