[jboss-svn-commits] JBL Code SVN: r27540 - labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jul 4 10:25:10 EDT 2009


Author: mark.little at jboss.com
Date: 2009-07-04 10:25:10 -0400 (Sat, 04 Jul 2009)
New Revision: 27540

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java
Log:
https://jira.jboss.org/jira/browse/JBTM-576

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java	2009-07-04 14:10:01 UTC (rev 27539)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java	2009-07-04 14:25:10 UTC (rev 27540)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
+ * as indicated by the @author tags. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2009,
+ * @author JBoss Inc.
+ */
+
 package com.hp.mwtests.ts.arjuna.recovery;
 
 import com.arjuna.ats.arjuna.recovery.RecoveryManager;
@@ -142,13 +163,24 @@
                 address = socket.getInetAddress();
 
                 host = InetAddress.getLocalHost().getHostName();
-
+                
                 port = PeriodicRecovery.getServerSocket().getLocalPort();
 
                 System.out.println("client atempting to connect to host " + host + " port " + port);
                 System.out.flush();
 
-                connectorSocket = new Socket(host, port);
+                try
+                {
+                    connectorSocket = new Socket(host, port);
+                }
+                catch (final Exception ex)
+                {
+                    // in case local host name bind fails (e.g., on Mac OS)
+                    
+                    host = "127.0.0.1";
+                    
+                    connectorSocket = new Socket(host, port);
+                }
 
                 System.out.println("connected!!!");
                 System.out.flush();




More information about the jboss-svn-commits mailing list