https://issues.apache.org/jira/browse/AMQ-5606 - reenable the karaf itest with the new amqp client - ActiveMQAMQPBrokerFeatureTest

This commit is contained in:
gtully 2015-04-02 16:56:10 +01:00
parent 94f1e98adc
commit 7741e02622
3 changed files with 16 additions and 14 deletions

View File

@ -98,7 +98,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.qpid</groupId> <groupId>org.apache.qpid</groupId>
<artifactId>proton-jms</artifactId> <artifactId>proton-j</artifactId>
<version>${qpid-proton-version}</version> <version>${qpid-proton-version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -107,6 +107,12 @@
<version>${qpid-jms-version}</version> <version>${qpid-jms-version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty-all-version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.camel.karaf</groupId> <groupId>org.apache.camel.karaf</groupId>

View File

@ -27,7 +27,6 @@ import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.junit.PaxExam;
@Ignore
@RunWith(PaxExam.class) @RunWith(PaxExam.class)
public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest { public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest {
private static final Integer AMQP_PORT = 61636; private static final Integer AMQP_PORT = 61636;
@ -35,9 +34,13 @@ public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest {
@Configuration @Configuration
public static Option[] configure() { public static Option[] configure() {
Option[] activeMQOptions = configure("activemq"); Option[] activeMQOptions = configure("activemq");
Option netty = CoreOptions.wrappedBundle(CoreOptions.mavenBundle("io.netty", "netty-all").versionAsInProject().getURL().toString() + "$Bundle-SymbolicName=netty-all");
Option protonJ = CoreOptions.wrappedBundle(CoreOptions.mavenBundle("org.apache.qpid", "proton-j").versionAsInProject().getURL().toString() + "$Bundle-SymbolicName=proton-j");
Option qpidClient = CoreOptions.wrappedBundle(CoreOptions.mavenBundle("org.apache.qpid", "qpid-jms-client").versionAsInProject().getURL().toString() + "$Bundle-SymbolicName=qpid-jms-client"); Option qpidClient = CoreOptions.wrappedBundle(CoreOptions.mavenBundle("org.apache.qpid", "qpid-jms-client").versionAsInProject().getURL().toString() + "$Bundle-SymbolicName=qpid-jms-client");
Option[] options = append(qpidClient, activeMQOptions); Option[] options = append(protonJ, activeMQOptions);
options = append(netty, options);
options = append(qpidClient, options);
Option[] configuredOptions = configureBrokerStart(options); Option[] configuredOptions = configureBrokerStart(options);
return configuredOptions; return configuredOptions;
@ -46,22 +49,14 @@ public class ActiveMQAMQPBrokerFeatureTest extends ActiveMQBrokerFeatureTest {
@Override @Override
protected Connection getConnection() throws Throwable { protected Connection getConnection() throws Throwable {
String amqpURI = "amqp://localhost" + AMQP_PORT; String amqpURI = "amqp://localhost:" + AMQP_PORT;
JmsConnectionFactory factory = new JmsConnectionFactory(amqpURI); JmsConnectionFactory factory = new JmsConnectionFactory(amqpURI);
factory.setUsername(AbstractFeatureTest.USER); factory.setUsername(AbstractFeatureTest.USER);
factory.setPassword(AbstractFeatureTest.PASSWORD); factory.setPassword(AbstractFeatureTest.PASSWORD);
Connection connection = null; Connection connection = factory.createConnection();
ClassLoader originalLoader = Thread.currentThread().getContextClassLoader(); connection.start();
try {
// ensure service loader uses a loader that can find the impl - not the system classpath
Thread.currentThread().setContextClassLoader(factory.getClass().getClassLoader());
connection = factory.createConnection();
connection.start();
} finally {
Thread.currentThread().setContextClassLoader(originalLoader);
}
return connection; return connection;
} }

View File

@ -106,6 +106,7 @@
<zookeeper-version>3.4.6</zookeeper-version> <zookeeper-version>3.4.6</zookeeper-version>
<qpid-proton-version>0.8</qpid-proton-version> <qpid-proton-version>0.8</qpid-proton-version>
<qpid-jms-version>0.1.0</qpid-jms-version> <qpid-jms-version>0.1.0</qpid-jms-version>
<netty-all-version>4.0.17.Final</netty-all-version>
<regexp-version>1.3</regexp-version> <regexp-version>1.3</regexp-version>
<rome-version>1.0</rome-version> <rome-version>1.0</rome-version>
<saxon-version>9.5.1-2</saxon-version> <saxon-version>9.5.1-2</saxon-version>