You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/08/13 16:59:17 UTC

syncope git commit: [SYNCOPE-652] More test improvements

Repository: syncope
Updated Branches:
  refs/heads/SYNCOPE-652 a82d98880 -> eeafa162a


[SYNCOPE-652] More test improvements


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/eeafa162
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/eeafa162
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/eeafa162

Branch: refs/heads/SYNCOPE-652
Commit: eeafa162afd49d7f6e5184e7a8fd732ece00e03b
Parents: a82d988
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Thu Aug 13 16:59:12 2015 +0200
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Thu Aug 13 16:59:12 2015 +0200

----------------------------------------------------------------------
 .../fit/core/reference/AbstractTaskITCase.java      | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/eeafa162/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
index 2d9dae1..7bdd7c5 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AbstractTaskITCase.java
@@ -50,8 +50,6 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
 
     protected static class ThreadExec implements Callable<TaskExecTO> {
 
-        private final AbstractTaskITCase test;
-
         private final TaskService taskService;
 
         private final Long taskKey;
@@ -60,10 +58,9 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
 
         private final boolean dryRun;
 
-        public ThreadExec(final AbstractTaskITCase test, final TaskService taskService, final Long taskKey,
-                final int maxWaitSeconds, final boolean dryRun) {
+        public ThreadExec(
+                final TaskService taskService, final Long taskKey, final int maxWaitSeconds, final boolean dryRun) {
 
-            this.test = test;
             this.taskService = taskService;
             this.taskKey = taskKey;
             this.maxWaitSeconds = maxWaitSeconds;
@@ -72,7 +69,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
 
         @Override
         public TaskExecTO call() throws Exception {
-            return test.execProvisioningTask(taskService, taskKey, maxWaitSeconds, dryRun);
+            return execProvisioningTask(taskService, taskKey, maxWaitSeconds, dryRun);
         }
     }
 
@@ -132,7 +129,12 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
         List<Future<TaskExecTO>> futures = new ArrayList<>();
 
         for (Long key : taskKeys) {
-            futures.add(service.submit(new ThreadExec(this, taskService, key, maxWaitSeconds, dryRun)));
+            futures.add(service.submit(new ThreadExec(taskService, key, maxWaitSeconds, dryRun)));
+            // avoid flooding the test server
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e) {
+            }
         }
 
         Map<Long, TaskExecTO> res = new HashMap<>();