Skip to content

Commit

Permalink
[WFLY-4647] RemoteOutboundConnectionReconnectTestCase, EJBClientRecon…
Browse files Browse the repository at this point in the history
…nectionTestCase configured as clustered test cases
  • Loading branch information
mvinkler committed Jul 3, 2015
1 parent 45c4a00 commit 18c9977
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 15 deletions.
Expand Up @@ -21,6 +21,22 @@
</configuration> </configuration>
</container> </container>


<container qualifier="jbossas-non-clustered" default="false" mode="manual">
<configuration>
<property name="jbossHome">${basedir}/target/jbossas</property>
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/jbossas -Djboss.node.name=default-jbossas</property>
<property name="serverConfig">standalone.xml</property>
<property name="jbossArguments">${jboss.args}</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="managementAddress">${node0:127.0.0.1}</property>
<property name="managementPort">${as.managementPort:9990}</property>

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

<container qualifier="jbossas-with-remote-outbound-connection" default="false" mode="manual"> <container qualifier="jbossas-with-remote-outbound-connection" default="false" mode="manual">
<configuration> <configuration>
<property name="jbossHome">${basedir}/target/jbossas-with-remote-outbound-connection</property> <property name="jbossHome">${basedir}/target/jbossas-with-remote-outbound-connection</property>
Expand All @@ -37,6 +53,22 @@
</configuration> </configuration>
</container> </container>


<container qualifier="jbossas-with-remote-outbound-connection-non-clustered" default="false" mode="manual">
<configuration>
<property name="jbossHome">${basedir}/target/jbossas-with-remote-outbound-connection</property>
<property name="javaVmArguments">${server.jvm.args} -Djboss.inst=${basedir}/target/jbossas-with-remote-outbound-connection -Djboss.node.name=jbossas-with-remote-outbound-connection</property>
<property name="serverConfig">standalone.xml</property>
<property name="jbossArguments">${jboss.args}</property>
<property name="allowConnectingToRunningServer">true</property>
<property name="managementAddress">${node1}</property>
<property name="managementPort">10090</property>

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

<container qualifier="jbossas-layered" default="false" mode="manual"> <container qualifier="jbossas-layered" default="false" mode="manual">
<configuration> <configuration>
<property name="jbossHome">${basedir}/target/jbossas-layered</property> <property name="jbossHome">${basedir}/target/jbossas-layered</property>
Expand Down
Expand Up @@ -68,8 +68,8 @@ public class RemoteOutboundConnectionReconnectTestCase {
private static final String SERVER_ONE_MODULE_NAME = "server-one-module"; private static final String SERVER_ONE_MODULE_NAME = "server-one-module";
private static final String SERVER_TWO_MODULE_NAME = "server-two-module"; private static final String SERVER_TWO_MODULE_NAME = "server-two-module";


private static final String DEFAULT_JBOSSAS = "default-jbossas"; private static final String JBOSSAS_NON_CLUSTERED = "jbossas-non-clustered";
private static final String JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION = "jbossas-with-remote-outbound-connection"; private static final String JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED = "jbossas-with-remote-outbound-connection-non-clustered";


private static final String DEFAULT_AS_DEPLOYMENT = "default-jbossas-deployment"; private static final String DEFAULT_AS_DEPLOYMENT = "default-jbossas-deployment";
private static final String DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML = "other-deployment"; private static final String DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML = "other-deployment";
Expand Down Expand Up @@ -99,15 +99,15 @@ public void after() throws NamingException {
} }


@Deployment(name = DEFAULT_AS_DEPLOYMENT, managed = false, testable = false) @Deployment(name = DEFAULT_AS_DEPLOYMENT, managed = false, testable = false)
@TargetsContainer(DEFAULT_JBOSSAS) @TargetsContainer(JBOSSAS_NON_CLUSTERED)
public static Archive<?> createContainer1Deployment() { public static Archive<?> createContainer1Deployment() {
final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, SERVER_TWO_MODULE_NAME + ".jar"); final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, SERVER_TWO_MODULE_NAME + ".jar");
ejbJar.addClasses(EchoOnServerTwo.class, RemoteEcho.class); ejbJar.addClasses(EchoOnServerTwo.class, RemoteEcho.class);
return ejbJar; return ejbJar;
} }


@Deployment(name = DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML, managed = false, testable = false) @Deployment(name = DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML, managed = false, testable = false)
@TargetsContainer(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION) @TargetsContainer(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED)
public static Archive<?> createContainer2Deployment() { public static Archive<?> createContainer2Deployment() {
final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, SERVER_ONE_MODULE_NAME + ".jar"); final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, SERVER_ONE_MODULE_NAME + ".jar");
ejbJar.addClasses(EchoOnServerOne.class, RemoteEcho.class, IndependentBean.class); ejbJar.addClasses(EchoOnServerOne.class, RemoteEcho.class, IndependentBean.class);
Expand All @@ -127,7 +127,7 @@ public static Archive<?> createContainer2Deployment() {
@Test @Test
public void testRemoteServerStartsLate() throws Exception { public void testRemoteServerStartsLate() throws Exception {
// First start the server which has a remote-outbound-connection // First start the server which has a remote-outbound-connection
this.container.start(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION); this.container.start(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED);
boolean defaultContainerStarted = false; boolean defaultContainerStarted = false;
try { try {
// deploy a deployment which contains jboss-ejb-client.xml that contains an EJB receiver pointing // deploy a deployment which contains jboss-ejb-client.xml that contains an EJB receiver pointing
Expand All @@ -151,7 +151,7 @@ public void testRemoteServerStartsLate() throws Exception {
logger.info("Got the expected exception on invoking a bean when other server was down", e); logger.info("Got the expected exception on invoking a bean when other server was down", e);
} }
// now start the main server // now start the main server
this.container.start(DEFAULT_JBOSSAS); this.container.start(JBOSSAS_NON_CLUSTERED);
defaultContainerStarted = true; defaultContainerStarted = true;
// deploy to this container // deploy to this container
this.deployer.deploy(DEFAULT_AS_DEPLOYMENT); this.deployer.deploy(DEFAULT_AS_DEPLOYMENT);
Expand All @@ -164,14 +164,14 @@ public void testRemoteServerStartsLate() throws Exception {
} finally { } finally {
try { try {
this.deployer.undeploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML); this.deployer.undeploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML);
this.container.stop(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION); this.container.stop(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED);
} catch (Exception e) { } catch (Exception e) {
logger.debug("Exception during container shutdown", e); logger.debug("Exception during container shutdown", e);
} }
if (defaultContainerStarted) { if (defaultContainerStarted) {
try { try {
this.deployer.undeploy(DEFAULT_AS_DEPLOYMENT); this.deployer.undeploy(DEFAULT_AS_DEPLOYMENT);
this.container.stop(DEFAULT_JBOSSAS); this.container.stop(JBOSSAS_NON_CLUSTERED);
} catch (Exception e) { } catch (Exception e) {
logger.debug("Exception during container shutdown", e); logger.debug("Exception during container shutdown", e);
} }
Expand All @@ -192,12 +192,12 @@ public void testRemoteServerStartsLate() throws Exception {
@Test @Test
public void testRemoteServerRestarts() throws Exception { public void testRemoteServerRestarts() throws Exception {
// Start the main server // Start the main server
this.container.start(DEFAULT_JBOSSAS); this.container.start(JBOSSAS_NON_CLUSTERED);
// deploy to this container // deploy to this container
this.deployer.deploy(DEFAULT_AS_DEPLOYMENT); this.deployer.deploy(DEFAULT_AS_DEPLOYMENT);


// Now start the server which has a remote-outbound-connection // Now start the server which has a remote-outbound-connection
this.container.start(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION); this.container.start(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED);
this.deployer.deploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML); this.deployer.deploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML);


boolean defaultContainerStarted = true; boolean defaultContainerStarted = true;
Expand All @@ -216,7 +216,7 @@ public void testRemoteServerRestarts() throws Exception {
Assert.assertEquals("Unexpected echo from bean", EchoOnServerTwo.ECHO_PREFIX + msg, echoBeforeShuttingDownServer); Assert.assertEquals("Unexpected echo from bean", EchoOnServerTwo.ECHO_PREFIX + msg, echoBeforeShuttingDownServer);


// now stop the main server // now stop the main server
this.container.stop(DEFAULT_JBOSSAS); this.container.stop(JBOSSAS_NON_CLUSTERED);
defaultContainerStarted = false; defaultContainerStarted = false;


try { try {
Expand All @@ -228,7 +228,7 @@ public void testRemoteServerRestarts() throws Exception {
} }


// now restart the main server // now restart the main server
this.container.start(DEFAULT_JBOSSAS); this.container.start(JBOSSAS_NON_CLUSTERED);
defaultContainerStarted = true; defaultContainerStarted = true;


final String echoAfterServerRestart = dependentBean.echo(msg); final String echoAfterServerRestart = dependentBean.echo(msg);
Expand All @@ -238,14 +238,14 @@ public void testRemoteServerRestarts() throws Exception {
} finally { } finally {
try { try {
this.deployer.undeploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML); this.deployer.undeploy(DEPLOYMENT_WITH_JBOSS_EJB_CLIENT_XML);
this.container.stop(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION); this.container.stop(JBOSSAS_WITH_REMOTE_OUTBOUND_CONNECTION_NON_CLUSTERED);
} catch (Exception e) { } catch (Exception e) {
logger.debug("Exception during container shutdown", e); logger.debug("Exception during container shutdown", e);
} }
if (defaultContainerStarted) { if (defaultContainerStarted) {
try { try {
this.deployer.undeploy(DEFAULT_AS_DEPLOYMENT); this.deployer.undeploy(DEFAULT_AS_DEPLOYMENT);
this.container.stop(DEFAULT_JBOSSAS); this.container.stop(JBOSSAS_NON_CLUSTERED);
} catch (Exception e) { } catch (Exception e) {
logger.debug("Exception during container shutdown", e); logger.debug("Exception during container shutdown", e);
} }
Expand Down
Expand Up @@ -69,7 +69,7 @@ public class EJBClientReconnectionTestCase {
private static final Logger log = Logger.getLogger(EJBClientReconnectionTestCase.class); private static final Logger log = Logger.getLogger(EJBClientReconnectionTestCase.class);


private static final String DEPLOYMENT = "ejbclientreconnection"; private static final String DEPLOYMENT = "ejbclientreconnection";
private static final String CONTAINER = "default-jbossas"; private static final String CONTAINER = "jbossas-non-clustered";


@ArquillianResource @ArquillianResource
private ContainerController controller; private ContainerController controller;
Expand Down

0 comments on commit 18c9977

Please sign in to comment.