[jboss-cvs] JBossAS SVN: r62755 - trunk/testsuite/src/main/org/jboss/test/cluster/test.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 2 15:20:39 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-05-02 15:20:39 -0400 (Wed, 02 May 2007)
New Revision: 62755

Modified:
   trunk/testsuite/src/main/org/jboss/test/cluster/test/FamilyClusterInfoUnitTestCase.java
Log:
Isolate the FCI used in the different test cases

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/test/FamilyClusterInfoUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/test/FamilyClusterInfoUnitTestCase.java	2007-05-02 19:18:24 UTC (rev 62754)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/test/FamilyClusterInfoUnitTestCase.java	2007-05-02 19:20:39 UTC (rev 62755)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, 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.test.cluster.test;
 
 import java.util.ArrayList;
@@ -82,11 +103,14 @@
       
       void endUpdates()
       {
-         long start = System.currentTimeMillis();
-         
-         while (started && (System.currentTimeMillis() - start) < 100)
+         if (started)
          {
             stopped = true;
+            try
+            {
+               this.join(250);
+            }
+            catch (InterruptedException ignored) {}
          }
          
          if (started)
@@ -182,11 +206,16 @@
       ArrayList targets = new ArrayList();
       targets.add("ONE");
       targets.add("TWO");
-      ClusteringTargetsRepository.initTarget("testSynchronization", targets, 0);
-      FamilyClusterInfo fci = ClusteringTargetsRepository.getFamilyClusterInfo("testSynchronization");
+      ClusteringTargetsRepository.initTarget("testImmutability", targets, 0);
+      FamilyClusterInfo fci = ClusteringTargetsRepository.getFamilyClusterInfo("testImmutability");
       
       List fciTargets = fci.getTargets();
       
+      // Confirm the targets are what we expect
+      assertEquals("Expected number of targets", 2, fciTargets.size());
+      assertEquals("First target as expected", "ONE", fciTargets.get(0));
+      assertEquals("Second target as expected", "TWO", fciTargets.get(1));
+      
       try 
       { 
          fciTargets.add("FAIL");




More information about the jboss-cvs-commits mailing list