Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use of 4 spaces instead of tabs. Author removed

  • Loading branch information...
commit 3f3c63a2737d0784bf92a9c9f5503660e004b82a 1 parent c75737d
Francisco Perez-Sorrosal authored
Showing with 40 additions and 42 deletions.
  1. +40 −42 src/test/java/com/yahoo/omid/TestUtils.java
View
82 src/test/java/com/yahoo/omid/TestUtils.java
@@ -27,51 +27,49 @@
*
* This class contains functionality that is useful for the Omid tests.
*
- * @author Francisco Perez-Sorrosal - fperez@yahoo-inc.com
- *
*/
public class TestUtils {
- private static final Log LOG = LogFactory.getLog(TestUtils.class);
+ private static final Log LOG = LogFactory.getLog(TestUtils.class);
- public static void waitForSocketListening(String host, int port,
- int sleepTimeMillis) throws UnknownHostException, IOException,
- InterruptedException {
- while (true) {
- Socket sock = null;
- try {
- sock = new Socket(host, port);
- } catch (IOException e) {
- // ignore as this is expected
- Thread.sleep(sleepTimeMillis);
- continue;
- } finally {
- if (sock != null) {
- sock.close();
- }
- }
- LOG.info("Host " + host + ":" + port + " is up");
- break;
- }
- }
+ public static void waitForSocketListening(String host, int port,
+ int sleepTimeMillis) throws UnknownHostException, IOException,
+ InterruptedException {
+ while (true) {
+ Socket sock = null;
+ try {
+ sock = new Socket(host, port);
+ } catch (IOException e) {
+ // ignore as this is expected
+ Thread.sleep(sleepTimeMillis);
+ continue;
+ } finally {
+ if (sock != null) {
+ sock.close();
+ }
+ }
+ LOG.info("Host " + host + ":" + port + " is up");
+ break;
+ }
+ }
- public static void waitForSocketNotListening(String host, int port,
- int sleepTimeMillis) throws UnknownHostException, IOException,
- InterruptedException {
- while (true) {
- Socket sock = null;
- try {
- sock = new Socket(host, port);
- } catch (IOException e) {
- // ignore as this is expected
- break;
- } finally {
- if (sock != null) {
- sock.close();
- }
- }
- Thread.sleep(sleepTimeMillis);
- LOG.info("Host " + host + ":" + port + " is up");
- }
- }
+ public static void waitForSocketNotListening(String host, int port,
+ int sleepTimeMillis) throws UnknownHostException, IOException,
+ InterruptedException {
+ while (true) {
+ Socket sock = null;
+ try {
+ sock = new Socket(host, port);
+ } catch (IOException e) {
+ // ignore as this is expected
+ break;
+ } finally {
+ if (sock != null) {
+ sock.close();
+ }
+ }
+ Thread.sleep(sleepTimeMillis);
+ LOG.info("Host " + host + ":" + port + " is up");
+ }
+ }
}

0 comments on commit 3f3c63a

Please sign in to comment.
Something went wrong with that request. Please try again.