Skip to content

Commit

Permalink
[resolves wildfly-extras#357] ActiveMQIntegrationTest bundles all Act…
Browse files Browse the repository at this point in the history
…iveMQ jars
  • Loading branch information
Thomas Diesler authored and jamesnetherton committed Mar 4, 2015
1 parent bbdf570 commit 0e27f35
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@

package org.wildfly.camel.test.activemq;

import java.io.InputStream;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.camel.component.ActiveMQComponent;
import org.apache.camel.CamelContext;
Expand All @@ -35,18 +51,10 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.Asset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.jms.*;
import javax.naming.InitialContext;
import java.io.File;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

@RunWith(Arquillian.class)
public class ActiveMQIntegrationTest {

Expand All @@ -60,18 +68,12 @@ public class ActiveMQIntegrationTest {

@Deployment
public static WebArchive createdeployment() {
File[] amqDependencies = Maven.configureResolverViaPlugin().
resolve("org.apache.activemq:activemq-all").
withTransitivity().
asFile();

final WebArchive archive = ShrinkWrap.create(WebArchive.class, "camel-activemq-tests.war");
archive.addAsLibraries(amqDependencies);
archive.setManifest(new Asset() {
@Override
public InputStream openStream() {
ManifestBuilder builder = new ManifestBuilder();
builder.addManifestHeader("Dependencies", "org.jboss.as.controller-client,javax.jms.api");
builder.addManifestHeader("Dependencies", "org.apache.activemq,javax.jms.api");
return builder.openStream();
}
});
Expand Down

0 comments on commit 0e27f35

Please sign in to comment.