https://issues.apache.org/jira/browse/AMQ-4341 - some more tweaks and tests from the feedback

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1450824 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2013-02-27 16:02:28 +00:00
parent 30b20b3f38
commit af5f38797d
8 changed files with 51 additions and 19 deletions

View File

@ -144,6 +144,15 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.camel.karaf</groupId>
<artifactId>apache-camel</artifactId>
<version>${camel-version}</version>
<type>xml</type>
<classifier>features</classifier>
<scope>test</scope>
</dependency>
<!-- test and logging --> <!-- test and logging -->
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@ -54,7 +54,7 @@ public abstract class AbstractFeatureTest {
private static final Logger LOG = LoggerFactory.getLogger(AbstractFeatureTest.class); private static final Logger LOG = LoggerFactory.getLogger(AbstractFeatureTest.class);
private static final long ASSERTION_TIMEOUT = 20000L; private static final long ASSERTION_TIMEOUT = 20000L;
private static final long COMMAND_TIMEOUT = 10000L; private static final long COMMAND_TIMEOUT = 30000L;
public static final String USER = "karaf"; public static final String USER = "karaf";
public static final String PASSWORD = "karaf"; public static final String PASSWORD = "karaf";
@ -164,7 +164,14 @@ public abstract class AbstractFeatureTest {
return mavenBundle().groupId("org.apache.activemq"). return mavenBundle().groupId("org.apache.activemq").
artifactId("activemq-karaf").versionAsInProject().type(type); artifactId("activemq-karaf").versionAsInProject().type(type);
} }
// for use from a probe
public String getCamelFeatureUrl() {
return "mvn:org.apache.camel.karaf/apache-camel/"
+ System.getProperty("camel.version", "unknown")
+ "/xml/features";
}
public static UrlReference getKarafFeatureUrl() { public static UrlReference getKarafFeatureUrl() {
LOG.info("*** The karaf version is " + karafVersion() + " ***"); LOG.info("*** The karaf version is " + karafVersion() + " ***");
@ -192,8 +199,6 @@ public abstract class AbstractFeatureTest {
public static Option[] configure(String ...features) { public static Option[] configure(String ...features) {
ArrayList<String> f = new ArrayList<String>(); ArrayList<String> f = new ArrayList<String>();
// install the cxf jaxb spec as the karaf doesn't provide it by default
// f.add("cxf-jaxb");
f.addAll(Arrays.asList(features)); f.addAll(Arrays.asList(features));
Option[] options = Option[] options =
@ -205,10 +210,9 @@ public abstract class AbstractFeatureTest {
.unpackDirectory(new File("target/paxexam/unpack/")), .unpackDirectory(new File("target/paxexam/unpack/")),
KarafDistributionOption.keepRuntimeFolder(), KarafDistributionOption.keepRuntimeFolder(),
// override the config.properties (to fix pax-exam bug) //logLevel(LogLevelOption.LogLevel.DEBUG),
replaceConfigurationFile("etc/config.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/config.properties")), replaceConfigurationFile("etc/config.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/config.properties")),
replaceConfigurationFile("etc/custom.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/custom.properties")), replaceConfigurationFile("etc/custom.properties", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/custom.properties")),
//replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", new File(basedir+"/src/test/resources/org/apache/activemq/karaf/itest/org.ops4j.pax.logging.cfg")),
scanFeatures(getActiveMQKarafFeatureUrl(), f.toArray(new String[f.size()]))}; scanFeatures(getActiveMQKarafFeatureUrl(), f.toArray(new String[f.size()]))};
return options; return options;

View File

@ -36,7 +36,7 @@ public class ActiveMQBrokerFeatureTest extends AbstractFeatureTest {
@Configuration @Configuration
public static Option[] configure() { public static Option[] configure() {
return configureBrokerStart(configure("activemq-broker")); return configureBrokerStart(configure("activemq"));
} }
@Test @Test

View File

@ -40,7 +40,7 @@ public class ActiveMQBrokerNdWebConsoleFeatureTest extends ActiveMQBrokerFeature
public static Option[] configure() { public static Option[] configure() {
return append(CoreOptions.mavenBundle("commons-codec", "commons-codec").versionAsInProject(), return append(CoreOptions.mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
append(CoreOptions.mavenBundle("commons-httpclient", "commons-httpclient").versionAsInProject(), append(CoreOptions.mavenBundle("commons-httpclient", "commons-httpclient").versionAsInProject(),
configureBrokerStart(configure("activemq-broker")))); configure("activemq-broker")));
} }
@Override @Override

View File

@ -18,17 +18,23 @@ package org.apache.activemq.karaf.itest;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.ops4j.pax.exam.MavenUtils;
import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration; import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner; import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import static org.openengsb.labs.paxexam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
@RunWith(JUnit4TestRunner.class) @RunWith(JUnit4TestRunner.class)
public class ObrFeatureTest extends AbstractFeatureTest { public class ObrFeatureTest extends AbstractFeatureTest {
@Configuration @Configuration
public static Option[] configure() { public static Option[] configure() {
return configure("obr"); return append(
editConfigurationFilePut("etc/system.properties", "camel.version", MavenUtils.getArtifactVersion("org.apache.camel.karaf", "apache-camel")),
configure("obr"));
} }
@Test @Test
@ -36,8 +42,19 @@ public class ObrFeatureTest extends AbstractFeatureTest {
installAndAssertFeature("activemq-client"); installAndAssertFeature("activemq-client");
} }
//@Test @Test
public void testBroker() throws Throwable { public void testActiveMQ() throws Throwable {
installAndAssertFeature("activemq-broker"); installAndAssertFeature("activemq");
} }
@Test
public void testBroker() throws Throwable {
installAndAssertFeature("activemq-broker");
}
@Test
public void testCamel() throws Throwable {
System.err.println(executeCommand("features:addurl " + getCamelFeatureUrl()));
installAndAssertFeature("activemq-camel");
}
} }

View File

@ -49,7 +49,7 @@
</managementContext> </managementContext>
<persistenceAdapter> <persistenceAdapter>
<kahaDB directory="${data}/kahadb"/> <levelDB directory="${data}/leveldb"/>
</persistenceAdapter> </persistenceAdapter>
<plugins> <plugins>
@ -72,6 +72,8 @@
<transportConnectors> <transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000"/> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000"/>
<transportConnector name="http" uri="http://0.0.0.0:61666"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:61676"/>
</transportConnectors> </transportConnectors>
</broker> </broker>

View File

@ -37,8 +37,9 @@
<!-- All bundles needed by the broker --> <!-- All bundles needed by the broker -->
<feature name="activemq" description="ActiveMQ broker libraries" version="${project.version}" resolver="(obr)" start-level="50"> <feature name="activemq" description="ActiveMQ broker libraries" version="${project.version}" resolver="(obr)" start-level="50">
<feature>jetty</feature> <feature>jetty</feature>
<feature>spring-dm</feature>
<feature version="${project.version}">activemq-client</feature> <feature version="${project.version}">activemq-client</feature>
<bundle>mvn:org.apache.activemq/activemq-karaf/${project.version}</bundle>
<bundle dependency="true">mvn:org.apache.xbean/xbean-spring/${xbean-version}</bundle>
<bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections-version}</bundle> <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections-version}</bundle>
<bundle dependency='true'>mvn:commons-lang/commons-lang/${commons-lang-version}</bundle> <bundle dependency='true'>mvn:commons-lang/commons-lang/${commons-lang-version}</bundle>
<bundle dependency="true">mvn:commons-codec/commons-codec/1.4</bundle> <bundle dependency="true">mvn:commons-codec/commons-codec/1.4</bundle>
@ -56,7 +57,6 @@
<bundle dependency="true">mvn:org.codehaus.jettison/jettison/${jettison-version}</bundle> <bundle dependency="true">mvn:org.codehaus.jettison/jettison/${jettison-version}</bundle>
<bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson-version}</bundle> <bundle dependency="true">mvn:org.codehaus.jackson/jackson-core-asl/${jackson-version}</bundle>
<bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson-version}</bundle> <bundle dependency="true">mvn:org.codehaus.jackson/jackson-mapper-asl/${jackson-version}</bundle>
<bundle>mvn:org.apache.activemq/activemq-karaf/${project.version}</bundle>
<bundle dependency="true">mvn:org.scala-lang/scala-library/${scala-version}</bundle> <bundle dependency="true">mvn:org.scala-lang/scala-library/${scala-version}</bundle>
</feature> </feature>

View File

@ -53,18 +53,18 @@
org.jasypt*;resolution:=optional, org.jasypt*;resolution:=optional,
org.eclipse.jetty*;resolution:=optional, org.eclipse.jetty*;resolution:=optional,
org.springframework.jms*;version="[3,4]";resolution:=optional, org.springframework.jms*;version="[3,4]";resolution:=optional,
org.springframework.osgi*;version="[3,4]";resolution:=optional, org.springframework.osgi*;version="[1.2,1.3]";resolution:=optional,
org.springframework.transaction*;version="[3,4]";resolution:=optional, org.springframework.transaction*;version="[3,4]";resolution:=optional,
org.xmlpull*;resolution:=optional, org.xmlpull*;resolution:=optional,
scala*;resolution:=optional, scala*;resolution:=optional,
org.springframework*;version="[3,4]";resolution:=optional,
org.apache.xbean.spring*,
javax.annotation*, javax.annotation*,
javax.jms*, javax.jms*,
javax.management javax.management*,
javax.transaction*, javax.transaction*,
org.apache.commons.pool*, org.apache.commons.pool*,
org.apache.commons.net*, org.apache.commons.net*,
org.apache.xbean.spring*,
org.springframework*;version="[3,4]";resolution:=optional,
* *
</activemq.osgi.import.pkg> </activemq.osgi.import.pkg>
<activemq.osgi.export> <activemq.osgi.export>