[jboss-cvs] JBossAS SVN: r87693 - in branches/Branch_5_x/testsuite/src: resources/test-configs/cluster-profilesvc-0/farm and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 22 18:08:49 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-04-22 18:08:49 -0400 (Wed, 22 Apr 2009)
New Revision: 87693

Added:
   branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/
   branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/
   branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
Removed:
   branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod/
Modified:
   branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java
Log:
[JBAS-5552] Tweak test to have one of the modified deployments be an exploded sar

Modified: branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java
===================================================================
--- branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java	2009-04-22 20:47:08 UTC (rev 87692)
+++ branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/defaultcfg/profileservice/test/FarmedClusterHotDeployUnitTestCase.java	2009-04-22 22:08:49 UTC (rev 87693)
@@ -23,7 +23,9 @@
 package org.jboss.test.cluster.defaultcfg.profileservice.test;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Properties;
 
@@ -110,11 +112,11 @@
       // Dir removal
       checkContent("jboss.system:service=HDRemoveDirFarmTestThreadPool", "RemoveDirFarmThreadPool", 0);
       
+      // Nested mod
+      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "UnmodifiedNestedFarmThreadPool", 0); 
+      
       // Simple mod
-      checkContent("jboss.system:service=HDModifyTestThreadPool", "UnmodifiedFarmThreadPool", 0);
-      
-      // Nested mod
-      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "UnmodifiedNestedFarmThreadPool", 0);      
+      checkContent("jboss.system:service=HDModifyTestThreadPool", "UnmodifiedFarmThreadPool", 0);     
    }
 
    private void performModifications() throws Exception
@@ -145,12 +147,13 @@
       toRemove = new File(farmDir, "hd-removeDir");
       removeFile(toRemove);
       
+      // Nested mod
+      dir = new File(farmDir, "hd-nestedMod.sar"); 
+      dir = new File(dir, "META-INF");
+      copyFile(dir, "hd-nested-mod-deployment-service.xml", "jboss-service.xml");
+      
       // Simple mod
       copyFile(farmDir, "hd-mod-deployment-service.xml");
-      
-      // Nested mod
-      dir = new File(farmDir, "hd-nestedMod");      
-      copyFile(dir, "hd-nested-mod-deployment-service.xml");
    }
    
    private void validateFinalState() throws Exception
@@ -176,11 +179,11 @@
       // Dir removal
       checkContentRemoved("jboss.system:service=HDRemoveDirFarmTestThreadPool", 0);
       
+      // Nested mod
+      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "ModifiedNestedFarmThreadPool", 0);
+      
       // Simple mod
       checkContent("jboss.system:service=HDModifyTestThreadPool", "ModifiedFarmThreadPool", 0);
-      
-      // Nested mod
-      checkContent("jboss.system:service=HDModifyNestedTestThreadPool", "ModifiedNestedFarmThreadPool", 0);
    }
 
    /**
@@ -214,12 +217,17 @@
       return new InitialContext(env1);
    }
 
-   private void copyFile(File dir, String filename) throws Exception
+   private void copyFile(File dir, String fileName) throws Exception
    {
-      InputStream is = getDeployURL(filename).openStream();
+      copyFile(dir, fileName, fileName);
+   }
+
+   private void copyFile(File dir, String sourceName, String targetName) throws Exception
+   {
+      InputStream is = getDeployURL(sourceName).openStream();
       try
       {
-         File output = new File(dir, filename);
+         File output = new File(dir, targetName);
          FileOutputStream fos = new FileOutputStream(output);
          try
          {
@@ -347,5 +355,64 @@
       assertTrue(objectName + " -- node0 OK", node0OK);
       assertTrue(objectName + " -- node1 OK", node1OK);
    }
+   
+   /** 
+    * Does some file copies into the dirs the test normally uses. 
+    * Just a tool for debugging 
+    */
+   public static void main(String[] args)
+   {
+      try
+      {
+         File source = new File("/home/bes/dev/jboss/Branch_5_x/testsuite/output/resources/cluster/farm/hotdeploy/hd-add-deployment-service.xml");
+         
+         File dest = new File("/home/bes/dev/jboss/Branch_5_x/build/output/jboss-5.1.0.CR1/server/cluster-profilesvc-0/farm/hd-add-deployment-service.xml");
+         copyFile(source, dest);
+         source = new File("/home/bes/dev/jboss/Branch_5_x/testsuite/output/resources/cluster/farm/hotdeploy/hd-mod-deployment-service.xml");
+         
+         dest = new File("/home/bes/dev/jboss/Branch_5_x/build/output/jboss-5.1.0.CR1/server/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml");
+         copyFile(source, dest);
+         
+         Thread.sleep(6000);
+         
+         source = new File("/home/bes/dev/jboss/Branch_5_x/testsuite/output/resources/cluster/farm/hotdeploy/hd-mod-deployment-service.xml");
+         
+         dest = new File("/home/bes/dev/jboss/Branch_5_x/build/output/jboss-5.1.0.CR1/server/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml");
+         copyFile(source, dest);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      
+      System.out.println(new java.util.Date());
+   }
 
+   private static void copyFile(File source, File dest) throws FileNotFoundException, IOException
+   {
+      InputStream is = new java.io.FileInputStream(source);
+      try
+      {
+         FileOutputStream fos = new FileOutputStream(dest);
+         try
+         {
+            byte[] tmp = new byte[1024];
+            int read;
+            while((read = is.read(tmp)) > 0)
+            {
+               fos.write(tmp, 0, read);
+            }
+            fos.flush();
+         }
+         finally
+         {
+            fos.close();
+         }         
+      }
+      finally
+      {
+         is.close();
+      }
+   }
+
 }

Added: branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	                        (rev 0)
+++ branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	2009-04-22 22:08:49 UTC (rev 87693)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDModifyNestedTestThreadPool">
+      <attribute name="Name">UnmodifiedNestedFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">ModifyNestedFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>


Property changes on: branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:keywords
   + 




More information about the jboss-cvs-commits mailing list