From e0c35ed7ab64cd2ff4bc6e5d218f3c1dea2999a4 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 29 Jul 2007 21:32:52 +0000
Subject: [PATCH] Update a number of tasks test cases so that the getCompletedTask method is made available in the parent TasksTestCase class rather than duplicated in each test class that needs this functionality.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/AddSchemaFileTaskTestCase.java |   53 -----------------------------------------------------
 1 files changed, 0 insertions(+), 53 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/AddSchemaFileTaskTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/AddSchemaFileTaskTestCase.java
index f0ea97b..ffe2e6f 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/AddSchemaFileTaskTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/AddSchemaFileTaskTestCase.java
@@ -398,58 +398,5 @@
     assertFalse(resultCode == 0);
     invalidFile.delete();
   }
-
-
-
-  /**
-   * Retrieves the specified task from the server, waiting for it to finish all
-   * the running its going to do before returning.
-   *
-   * @param  taskEntryDN  The DN of the entry for the task to retrieve.
-   *
-   * @return  The requested task entry.
-   *
-   * @throws  Exception  If an unexpected problem occurs.
-   */
-  private Task getCompletedTask(DN taskEntryDN)
-          throws Exception
-  {
-    TaskBackend taskBackend =
-         (TaskBackend) DirectoryServer.getBackend(DN.decode("cn=tasks"));
-    Task task = taskBackend.getScheduledTask(taskEntryDN);
-    if (task == null)
-    {
-      long stopWaitingTime = System.currentTimeMillis() + 10000L;
-      while ((task == null) && (System.currentTimeMillis() < stopWaitingTime))
-      {
-        Thread.sleep(10);
-        task = taskBackend.getScheduledTask(taskEntryDN);
-      }
-    }
-
-    if (task == null)
-    {
-      throw new AssertionError("There is no such task " +
-                               taskEntryDN.toString());
-    }
-
-    if (! TaskState.isDone(task.getTaskState()))
-    {
-      long stopWaitingTime = System.currentTimeMillis() + 20000L;
-      while ((! TaskState.isDone(task.getTaskState())) &&
-             (System.currentTimeMillis() < stopWaitingTime))
-      {
-        Thread.sleep(10);
-      }
-    }
-
-    if (! TaskState.isDone(task.getTaskState()))
-    {
-      throw new AssertionError("Task " + taskEntryDN.toString() +
-                               " did not complete in a timely manner.");
-    }
-
-    return task;
-  }
 }
 

--
Gitblit v1.10.0