Skip to content

Commit

Permalink
[WFLY-245] Basic x-site testcase implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmatowicz authored and bstansberry committed Jun 7, 2013
1 parent fdb7550 commit 762c44e
Show file tree
Hide file tree
Showing 17 changed files with 834 additions and 79 deletions.
31 changes: 19 additions & 12 deletions testsuite/integration/clust/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<jbossas.ts.integ.dir>${basedir}/..</jbossas.ts.integ.dir>
<jbossas.ts.dir>${jbossas.ts.integ.dir}/..</jbossas.ts.dir>
<jbossas.project.dir>${jbossas.ts.dir}/..</jbossas.project.dir>
<!-- additional properties for xsite tests -->
<node2>127.0.0.1</node2>
<node3>127.0.0.1</node3>
<siteA>siteA</siteA>
<siteB>siteB</siteB>
</properties>

<dependencies>
Expand Down Expand Up @@ -50,8 +55,8 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions combine.children="append">
<execution>
<id>ts.config-as.clust</id>
<phase>process-test-resources</phase>
<id>ts.config-as.clust</id>
<phase>process-test-resources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
Expand Down Expand Up @@ -81,15 +86,15 @@

<!-- Disable default-test execution. -->
<execution>
<id>default-test</id>
<id>default-test</id>
<goals><goal>test</goal></goals>
<phase>none</phase>
</execution>

<!-- TCP clustering tests with custom containers with manual deployments. -->
<execution>
<id>ts.surefire.clust.custom-manual-tcp-sync</id>
<phase>test</phase>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<!-- Force the order of tests -->
Expand Down Expand Up @@ -250,7 +255,7 @@
<!-- Tests which are placed in clust module but they're not run by default -->
<execution>
<id>ts.surefire.clust.multinode-manual-udp-extended</id>
<phase>test</phase>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<!-- Tests to execute. -->
Expand Down Expand Up @@ -328,8 +333,8 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions combine.children="append">
<execution>
<id>ts.config-as.clust.enable-jdbc-store</id>
<phase>process-test-resources</phase>
<id>ts.config-as.clust.enable-jdbc-store</id>
<phase>process-test-resources</phase>
<goals><goal>run</goal></goals>
<configuration>
<target>
Expand Down Expand Up @@ -363,8 +368,8 @@

<!-- Single node clustering tests. -->
<execution>
<id>ts.surefire.clust.jdbc-store</id>
<phase>test</phase>
<id>ts.surefire.clust.jdbc-store</id>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<!-- Tests to execute. -->
Expand Down Expand Up @@ -408,8 +413,6 @@
<echo>In Maven: node0: ${node0}</echo>
<!-- Build the UDP server configs in target/ . -->
<ant antfile="${basedir}/../src/test/scripts/clustering-build.xml">
<property name="siteA" value="siteA"/>
<property name="siteB" value="siteB"/>
<property name="node0" value="127.0.0.1"/>
<property name="node1" value="127.0.0.1"/>
<property name="node2" value="127.0.0.1"/>
Expand Down Expand Up @@ -442,17 +445,21 @@
<!-- Single node clustering tests. -->
<execution>
<id>ts.surefire.clust.xsite</id>
<phase>none</phase>
<phase>test</phase>
<goals><goal>test</goal></goals>
<configuration>
<!-- Tests to execute. -->
<includes>
<include>org/jboss/as/test/clustering/xsite/XSiteSimpleTestCase.java</include>
</includes>

<!-- Parameters to test cases. -->
<systemPropertyVariables>
<arquillian.launch>clustering-xsite</arquillian.launch>
<jboss.server.config.file.name>standalone-ha.xml</jboss.server.config.file.name>
<node2>127.0.0.1</node2>
<node3>127.0.0.1</node3>
<stack>udp</stack>
</systemPropertyVariables>
</configuration>
</execution>
Expand Down
61 changes: 61 additions & 0 deletions testsuite/integration/clust/src/test/config/arq/arquillian.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,65 @@

</group>

<group qualifier="clustering-xsite">

<container qualifier="container-0" mode="custom" managed="false" default="true">
<configuration>
<property name="jbossHome">${basedir}/target/wildfly-clustering-xsite-LON-0</property>
<!-- AS7-2493 different jboss.node.name must be specified -->
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/wildfly-clustering-xsite-LON-0 -Djboss.node.name=LON-0</property>
<property name="serverConfig">${jboss.server.config.file.name:standalone-ha.xml}</property>
<property name="managementAddress">${node0}</property>
<property name="managementPort">${as.managementPort:9990}</property>

<!-- AS7-4070 -->
<property name="waitForPorts">${as.debug.port:8787} ${as.managementPort:9999}</property>
<property name="waitForPortsTimeoutInSeconds">8</property>
</configuration>
</container>

<container qualifier="container-1" mode="custom" managed="false">
<configuration>
<property name="jbossHome">${basedir}/target/wildfly-clustering-xsite-LON-1</property>
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/wildfly-clustering-xsite-LON-1 -Djboss.node.name=LON-1 -Djboss.port.offset=100</property>
<property name="serverConfig">${jboss.server.config.file.name:standalone-ha.xml}</property>
<property name="managementAddress">${node1}</property>
<property name="managementPort">10090</property>

<!-- AS7-4070 -->
<property name="waitForPorts">${as.debug.port.node1} 10099</property>
<property name="waitForPortsTimeoutInSeconds">8</property>
</configuration>
</container>

<container qualifier="container-2" mode="custom" managed="false">
<configuration>
<property name="jbossHome">${basedir}/target/wildfly-clustering-xsite-NYC-0</property>
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/wildfly-clustering-xsite-NYC-0 -Djboss.node.name=NYC-0 -Djboss.port.offset=200</property>
<property name="serverConfig">${jboss.server.config.file.name:standalone-ha.xml}</property>
<property name="managementAddress">${node2}</property>
<property name="managementPort">10190</property>

<!-- AS7-4070 -->
<property name="waitForPorts">${as.debug.port.node2} 10199</property>
<property name="waitForPortsTimeoutInSeconds">8</property>
</configuration>
</container>

<container qualifier="container-3" mode="custom" managed="false">
<configuration>
<property name="jbossHome">${basedir}/target/wildfly-clustering-xsite-SFO-0</property>
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/wildfly-clustering-xsite-SFO-0 -Djboss.node.name=SFO-0 -Djboss.port.offset=300</property>
<property name="serverConfig">${jboss.server.config.file.name:standalone-ha.xml}</property>
<property name="managementAddress">${node3}</property>
<property name="managementPort">10290</property>

<!-- AS7-4070 -->
<property name="waitForPorts">${as.debug.port.node3} 10299</property>
<property name="waitForPortsTimeoutInSeconds">8</property>
</configuration>
</container>

</group>

</arquillian>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.test.clustering;

/**
* Test constants statically imported used across the clustering tests.
*
* Used for testing against 4 node clusters required for xsite.
*
* @author Richard Achmatowicz
* @version May 2013
*/
public interface ExtendedClusteringTestConstants extends ClusteringTestConstants {

/**
* Manual container with unmanaged deployments names.
*/
String CONTAINER_3 = "container-2";
String CONTAINER_4 = "container-3";
String[] XSITE_CONTAINERS = new String[] { CONTAINER_1, CONTAINER_2, CONTAINER_3, CONTAINER_4 };

/**
* Deployment names.
*/
String DEPLOYMENT_3 = "deployment-2";
String DEPLOYMENT_4 = "deployment-3";
String[] XSITE_DEPLOYMENTS = new String[] { DEPLOYMENT_1, DEPLOYMENT_2, DEPLOYMENT_3, DEPLOYMENT_4 };

/**
* Some helper deployment names.
*/
String DEPLOYMENT_HELPER_3 = "deployment-helper-2";
String DEPLOYMENT_HELPER_4 = "deployment-helper-3";
String[] XSITE_DEPLOYMENT_HELPERS = new String[] { DEPLOYMENT_HELPER_1, DEPLOYMENT_HELPER_2, DEPLOYMENT_HELPER_3, DEPLOYMENT_HELPER_4 };

/**
* Node names passed in arquillian.xml via -Djboss.node.name property.
*/
String NODE_3 = "node-2";
String NODE_4 = "node-3";
String[] XSITE_NODES = new String[] { NODE_1, NODE_2 , NODE_3, NODE_4};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.test.clustering.cluster;

import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.as.test.clustering.ExtendedClusteringTestConstants;
import org.jboss.as.test.clustering.NodeUtil;
import org.junit.Test;

/**
* Base cluster test that ensures the custom containers are already running.
*
* @author Richard Achmatowicz
* @version May 2013
*/
public abstract class ExtendedClusterAbstractTestCase extends ClusterAbstractTestCase implements ExtendedClusteringTestConstants {

/**
* Ensure the containers are running, otherwise start them.
*/
@Test
@InSequence(-1)
@RunAsClient
public void testSetup() {
this.setUp();
}

/**
* Override this method for different behavior of the test.
*/
protected void setUp() {
NodeUtil.start(controller, XSITE_CONTAINERS);
}

}
Loading

0 comments on commit 762c44e

Please sign in to comment.