[jboss-cvs] JBossAS SVN: r73747 - in trunk/testsuite: imports/config and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 28 10:59:00 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-05-28 10:59:00 -0400 (Wed, 28 May 2008)
New Revision: 73747

Added:
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/ClusteredDeployUnitTestCase.java
Modified:
   trunk/testsuite/imports/config/tests-clustering.xml
   trunk/testsuite/imports/server-config.xml
Log:
[JBAS-5553] Test infrastructure for clustered deployments

Modified: trunk/testsuite/imports/config/tests-clustering.xml
===================================================================
--- trunk/testsuite/imports/config/tests-clustering.xml	2008-05-28 14:26:13 UTC (rev 73746)
+++ trunk/testsuite/imports/config/tests-clustering.xml	2008-05-28 14:59:00 UTC (rev 73747)
@@ -57,6 +57,9 @@
   <patternset id="cluster.classloader.leak.includes">
     <include name="org/jboss/test/cluster/classloader/leak/test/*TestCase.class"/>
   </patternset>
+  <patternset id="cluster.profileservice.includes">
+    <include name="org/jboss/test/cluster/defaultcfg/profileservice/test/*TestCase.class"/>
+  </patternset>
   <patternset id="cluster.excludes">
     <exclude name="org/jboss/test/cluster/**/*TestCase.class"/>
   </patternset>
@@ -318,6 +321,29 @@
     <server:stop name="cluster-classloader-leak-0"/>
     <server:stop name="cluster-classloader-leak-1"/>
 	    
+  </target>  
+
+  <target name="tests-clustered-profileservice">
+
+	 <mkdir dir="${build.reports}"/>
+	 <mkdir dir="${build.testlog}"/>
+	    
+  	 <create-profileservice-config conf="cluster-profilesvc-0" baseconf="all"/>    
+	 <create-profileservice-config conf="cluster-profilesvc-1" baseconf="all"/>
+		 
+  	 <server:start name="cluster-profilesvc-0"/>
+     <server:start name="cluster-profilesvc-1"/>
+	  	
+     <antcall target="tests-clustering-unit">
+	      <param name="cluster.includes.refid" value="cluster.profileservice.includes"/>
+	      <param name="jboss-junit-configuration" value="ClusteredProfileService"/>
+	      <param name="jbosstest.cluster.node0.config" value="cluster-profilesvc-0"/>
+	      <param name="jbosstest.cluster.node1.config" value="cluster-profilesvc-1"/>
+    </antcall>
+	   
+    <server:stop name="cluster-profilesvc-0"/>
+    <server:stop name="cluster-profilesvc-1"/>
+		    
   </target> 
 
    <!-- Executes a set of tests in a clustered environment -->  

Modified: trunk/testsuite/imports/server-config.xml
===================================================================
--- trunk/testsuite/imports/server-config.xml	2008-05-28 14:26:13 UTC (rev 73746)
+++ trunk/testsuite/imports/server-config.xml	2008-05-28 14:59:00 UTC (rev 73747)
@@ -643,6 +643,30 @@
          <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
          <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
       </server>   	
+      <server name="cluster-profilesvc-0" host="${node0}">
+         <jvmarg value="-Xms128m" />
+         <jvmarg value="-Xmx512m" />
+         <jvmarg value="-XX:MaxPermSize=512m" />        
+         <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+         <sysproperty key="java.net.preferIPv4Stack" value="true" />
+         <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+         <sysproperty key="resolve.dns" value="false" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
+         <sysproperty key="jboss.messaging.ServerPeerID" value="0" />
+         <sysproperty key="jboss.partition.name" value="${partitionName}"/>
+      </server>
+      <server name="cluster-profilesvc-1" host="${node1}">
+         <jvmarg value="-Xms128m" />
+         <jvmarg value="-Xmx512m" />
+         <jvmarg value="-XX:MaxPermSize=512m" />        
+         <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError" />
+         <sysproperty key="java.net.preferIPv4Stack" value="true" />
+         <sysproperty key="java.endorsed.dirs" value="${jboss.dist}/lib/endorsed" />
+         <sysproperty key="resolve.dns" value="false" />
+         <sysproperty key="jgroups.udp.ip_ttl" value="${jbosstest.udp.ip_ttl}" />
+         <sysproperty key="jboss.messaging.ServerPeerID" value="1" />
+         <sysproperty key="jboss.partition.name" value="${partitionName}"/>
+      </server>
       <server name="springdeployer" host="${node0}">
          <jvmarg value="-Xms128m" />
          <jvmarg value="-Xmx512m" />
@@ -824,7 +848,7 @@
    <macrodef name="create-profileservice-config"
       description="Create a configuration with the full features profile service">
       <attribute name="conf"/>
-   	<attribute name="baseconf"/>
+   	  <attribute name="baseconf"/>
       <sequential>
          <delete dir="${jboss.dist}/server/@{conf}" failonerror="false"/>
          <echo message="creating @{conf} config, jboss.dist=${jboss.dist}"/>

Added: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/ClusteredDeployUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/ClusteredDeployUnitTestCase.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/ClusteredDeployUnitTestCase.java	2008-05-28 14:59:00 UTC (rev 73747)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt 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.test.cluster.defaultcfg.profileservice.test;
+
+import java.net.URL;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.ProgressEvent;
+import org.jboss.deployers.spi.management.deploy.ProgressListener;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.test.profileservice.test.AbstractProfileServiceTest;
+
+/**
+ * Profile service DeploymentManager tests in a clustered environment
+ * 
+ * @author Brian Stansberry
+ * @version $Revision:$
+ */
+public class ClusteredDeployUnitTestCase extends AbstractProfileServiceTest
+   implements ProgressListener
+{
+   private ProgressEvent eventInfo;
+   private long eventCount = 0;
+
+   public ClusteredDeployUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void progressEvent(ProgressEvent eventInfo)
+   {
+      eventCount ++;
+      this.eventInfo = eventInfo;
+      getLog().debug(eventInfo);
+   }
+
+   @Override
+   protected String getProfileName()
+   {
+      return "all";
+   }
+
+   public void testWarDeployment()
+      throws Exception
+   {
+      DeploymentManager mgtView = getDeploymentManager();
+      URL contentURL = super.getDeployURL("testWarDeployment.war");
+      DeploymentProgress progress = mgtView.distribute("testWarDeployment.war", DeploymentPhase.APPLICATION_CLUSTERED, contentURL);
+      assertEquals("DeploymentProgress.getDeploymentTargets", 2, progress.getDeploymentTargets().size());
+   }
+   public void testEarDeployment()
+      throws Exception
+   {
+      DeploymentManager mgtView = getDeploymentManager();
+      URL contentURL = super.getDeployURL("testEarDeployment.ear");
+      DeploymentProgress progress = mgtView.distribute("testEarDeployment.ear", DeploymentPhase.APPLICATION_CLUSTERED, contentURL);
+      assertEquals("DeploymentProgress.getDeploymentTargets", 2, progress.getDeploymentTargets().size());
+   }
+   public void testMCBeansDeployment()
+      throws Exception
+   {
+      URL contentURL = super.getDeployURL("testMCBeansDeployment.beans");
+
+      // Distribute the content
+      DeploymentManager mgtView = getDeploymentManager();
+      DeploymentProgress progress = mgtView.distribute("testMCBeansDeployment.beans", DeploymentPhase.APPLICATION_CLUSTERED, contentURL);
+      assertEquals("DeploymentProgress.getDeploymentTargets", 2, progress.getDeploymentTargets().size());
+      progress.addProgressListener(this);
+      progress.run();
+      DeploymentStatus status = progress.getDeploymentStatus();
+      assertTrue("DeploymentStatus.isCompleted", status.isCompleted());
+      // It should not be running yet
+      assertFalse("DeploymentStatus.isRunning", status.isRunning());
+      assertFalse("DeploymentStatus.isFailed", status.isFailed());
+
+      // Now start the deployment
+      progress = mgtView.start("testMCBeansDeployment.beans", DeploymentPhase.APPLICATION_CLUSTERED);
+      assertEquals("DeploymentProgress.getDeploymentTargets", 2, progress.getDeploymentTargets().size());
+      progress.addProgressListener(this);
+      progress.run();
+      status = progress.getDeploymentStatus();
+      assertTrue("DeploymentStatus.isCompleted", status.isCompleted());
+      assertTrue("DeploymentStatus.isRunning", status.isRunning());
+      assertFalse("DeploymentStatus.isFailed", status.isFailed());      
+   }
+   public void testSarDeployment()
+      throws Exception
+   {
+      DeploymentManager mgtView = getDeploymentManager();
+      URL contentURL = super.getDeployURL("testSarDeployment.sar");
+      DeploymentProgress progress = mgtView.distribute("testSarDeployment.sar", DeploymentPhase.APPLICATION, contentURL);
+      assertEquals("DeploymentProgress.getDeploymentTargets", 2, progress.getDeploymentTargets().size());
+   }
+}




More information about the jboss-cvs-commits mailing list