Skip to content

Commit

Permalink
Using Stable version of Fabric Exam.
Browse files Browse the repository at this point in the history
  • Loading branch information
hekonsek committed Apr 15, 2014
1 parent 5d47e14 commit bcc526a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 68 deletions.
70 changes: 7 additions & 63 deletions fuse-pocs-fabric/fuse-pocs-fabric-itest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<artifactId>fuse-pocs-fabric-itest</artifactId>

<properties>
<fabric-version>1.0.0.redhat-346</fabric-version>
<fabric-version>1.0.0.redhat-379</fabric-version>
<activemq-version>5.9.0.redhat-610379</activemq-version>
</properties>

<dependencies>
Expand Down Expand Up @@ -42,33 +43,18 @@
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>5.9.0.redhat-610346</version>
<version>${activemq-version}</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.activemq</groupId>-->
<!--<artifactId>activemq-karaf</artifactId>-->
<!--<version>5.9.0</version>-->
<!--</dependency>-->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-osgi</artifactId>
<version>5.9.0.redhat-610346</version>
<version>${activemq-version}</version>
</dependency>
<dependency>
<groupId>org.jboss.amq</groupId>
<artifactId>mq-fabric</artifactId>
<version>6.1.0.redhat-346</version>
<version>6.1.0.redhat-379</version>
</dependency>
<!--<dependency>-->
<!--<groupId>org.apache.xbean</groupId>-->
<!--<artifactId>xbean-classloader</artifactId>-->
<!--<version>3.16</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.xbean</groupId>-->
<!--<artifactId>xbean-spring</artifactId>-->
<!--<version>3.16</version>-->
<!--</dependency>-->

<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -93,54 +79,12 @@
<version>2.4</version>
</dependency>

<!-- Fabric Dependencies -->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-api</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-core</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-maven-proxy</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-core-agent-ssh</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-git-hawtio</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>io.fabric8</groupId>-->
<!--<artifactId>fabric-zookeeper</artifactId>-->
<!--<version>${fabric-version}</version>-->
<!--&lt;!&ndash; Excluding this as it can cause issues with multiple versions of commons-logging &ndash;&gt;-->
<!--<exclusions>-->
<!--<exclusion>-->
<!--<groupId>commons-logging</groupId>-->
<!--<artifactId>commons-logging</artifactId>-->
<!--</exclusion>-->
<!--<exclusion>-->
<!--<groupId>commons-logging</groupId>-->
<!--<artifactId>commons-logging-api</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
<!--</dependency>-->
</dependencies>

<repositories>
<repository>
<id>jboss-fuse-ea</id>
<url>https://repository.jboss.org/nexus/content/groups/ea</url>
<id>jboss-fuse</id>
<url>https://repository.jboss.org/nexus/content/groups/fs-public</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package camelpoc;

import io.fabric8.api.Container;
import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceProxy;
import io.fabric8.itests.paxexam.support.FabricTestSupport;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.junit.After;
Expand Down Expand Up @@ -70,10 +72,12 @@ public void tearDown() throws InterruptedException {
@Test
public void shouldCreateAmqBroker() throws Exception {
// Given
ServiceProxy<FabricService> fabricService = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);

String message = "message";
String queue = "queue";
System.err.println(executeCommand("fabric:create -n"));
containers = create().withName("router-container").withProfiles("mq-amq").
containers = create(fabricService).withName("router-container").withProfiles("mq-amq").
assertProvisioningResult().build();
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("admin", "admin", "discovery:(fabric:default)");
JmsTemplate jms = new JmsTemplate(connectionFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package camelpoc;

import io.fabric8.api.Container;
import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceProxy;
import io.fabric8.itests.paxexam.support.ContainerBuilder;
import io.fabric8.itests.paxexam.support.FabricTestSupport;
import org.apache.commons.io.IOUtils;
Expand All @@ -40,18 +42,20 @@ public class MasterTest extends FabricTestSupport {

@Test
public void shouldKeepSingletonNetty() throws Exception {
ServiceProxy<FabricService> fabricService = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);

System.err.println(executeCommand("fabric:create -n"));
System.err.println(executeCommand("fabric:profile-create --parents feature-camel foo"));
System.err.println(executeCommand("fabric:profile-edit --features camel-netty-http foo"));
System.err.println(executeCommand("fabric:profile-edit --bundles mvn:fuse-pocs/fuse-pocs-fabric-bundle/1.0-SNAPSHOT foo"));

Container master = (Container) ContainerBuilder.create().withName("master").withProfiles("foo").assertProvisioningResult().build().iterator().next();
Container master = (Container) ContainerBuilder.create(fabricService).withName("master").withProfiles("foo").assertProvisioningResult().build().iterator().next();

InputStream inputStream = new URL("http://localhost:18081/").openStream();
String response = IOUtils.toString(inputStream);
assertEquals("master", response);

Container slave = (Container) ContainerBuilder.create().withName("slave").withProfiles("foo").assertProvisioningResult().build().iterator().next();
Container slave = (Container) ContainerBuilder.create(fabricService).withName("slave").withProfiles("foo").assertProvisioningResult().build().iterator().next();
master.destroy();

inputStream = new URL("http://localhost:18081/").openStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import fuse.pocs.fabric.NettyHttpRoute;
import io.fabric8.api.Container;
import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceProxy;
import io.fabric8.itests.paxexam.support.ContainerBuilder;
import io.fabric8.itests.paxexam.support.FabricTestSupport;
import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -44,12 +46,14 @@ public void tearDown() throws InterruptedException {

@Test
public void shouldCreateCamelRouter() throws Exception {
ServiceProxy<FabricService> fabricService = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);

// Given
err.println(executeCommand("fabric:create -n"));
err.println(executeCommand("fabric:profile-create --parents feature-camel netty-http-server"));
err.println(executeCommand("fabric:profile-edit --features camel-netty-http netty-http-server"));
err.println(executeCommand("fabric:profile-edit --bundles mvn:fuse-pocs/fuse-pocs-fabric-bundle/1.0-SNAPSHOT netty-http-server"));
containers = ContainerBuilder.create().
containers = ContainerBuilder.create(fabricService).
withName("router-container").withProfiles("netty-http-server").
assertProvisioningResult().build();
InputStream inputStream = new URL("http://localhost:18080/").openStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package camelpoc;

import io.fabric8.api.Container;
import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceProxy;
import io.fabric8.itests.paxexam.support.ContainerBuilder;
import io.fabric8.itests.paxexam.support.FabricTestSupport;
import org.junit.After;
Expand Down Expand Up @@ -56,11 +58,12 @@ public void tearDown() throws InterruptedException {
@Test
public void shouldListBundleOnRemoteMachine() throws Exception {
// Given
ServiceProxy<FabricService> fabricService = ServiceProxy.createServiceProxy(bundleContext, FabricService.class);
System.err.println(executeCommand("fabric:create -n"));
System.err.println(executeCommand("fabric:profile-create --parents feature-camel netty-http-server"));
System.err.println(executeCommand("fabric:profile-edit --features camel-netty-http netty-http-server"));
System.err.println(executeCommand("fabric:profile-edit --bundles mvn:fuse-pocs/fuse-pocs-fabric-bundle/1.0-SNAPSHOT netty-http-server"));
containers = create().withName("router-container").withProfiles("netty-http-server").
containers = create(fabricService).withName("router-container").withProfiles("netty-http-server").
assertProvisioningResult().build();
Container container = containers.iterator().next();
String[] containerSshUrl = container.getSshUrl().split(":");
Expand Down

0 comments on commit bcc526a

Please sign in to comment.