From 585d1bf2936de4197aaf3af84f07a5607e013a1e Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 09 Aug 2013 08:34:00 +0000
Subject: [PATCH] *Test*.java: Used TestCaseUtils.findFreePort() instead of TestCaseUtils.bindFreePort(). Used StaticUtils.close().
---
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java
index 22e765d..d2a2a46 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java
@@ -25,21 +25,17 @@
* Copyright 2006-2009 Sun Microsystems, Inc.
* Portions copyright 2013 ForgeRock AS.
*/
-
package org.opends.server.replication;
-import static org.opends.server.loggers.ErrorLogger.logError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
+import static org.opends.server.TestCaseUtils.*;
+import static org.opends.server.loggers.ErrorLogger.*;
+import static org.testng.Assert.*;
-import org.opends.server.replication.service.ReplicationBroker;
-
-import java.net.ServerSocket;
import java.net.SocketTimeoutException;
import java.util.Iterator;
import java.util.List;
-
import java.util.NoSuchElementException;
+
import org.opends.messages.Category;
import org.opends.messages.Message;
import org.opends.messages.Severity;
@@ -55,18 +51,17 @@
import org.opends.server.replication.protocol.ReplicationMsg;
import org.opends.server.replication.server.ReplServerFakeConfiguration;
import org.opends.server.replication.server.ReplicationServer;
+import org.opends.server.replication.service.ReplicationBroker;
+import org.opends.server.types.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import org.opends.server.types.*;
-
-import static org.opends.server.TestCaseUtils.*;
-import static org.testng.Assert.assertNotNull;
/**
* Test the constructors, encoders and decoders of the Replication AckMsg,
* ModifyMsg, ModifyDnMsg, AddMsg and Delete MSG
*/
+@SuppressWarnings("javadoc")
public class ProtocolWindowTest extends ReplicationTestCase
{
private static final int WINDOW_SIZE = 10;
@@ -79,7 +74,7 @@
private int replServerPort;
- // the base DN used for this test
+ /** the base DN used for this test */
private DN baseDn;
private ReplicationServer replicationServer;
@@ -298,10 +293,7 @@
baseDn = DN.decode(TEST_ROOT_DN_STRING);
- // find a free port for the replicationServer
- ServerSocket socket = TestCaseUtils.bindFreePort();
- replServerPort = socket.getLocalPort();
- socket.close();
+ replServerPort = TestCaseUtils.findFreePort();
// configure the replication Server.
replicationServer = new ReplicationServer(new ReplServerFakeConfiguration(
--
Gitblit v1.10.0