syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: [SYNCOPE-1348] Async test improvement
Date Tue, 14 Aug 2018 12:02:20 GMT
[SYNCOPE-1348] Async test improvement


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

Branch: refs/heads/master
Commit: 9126b7d0a19aafd8fec33daecb788e713b1f7132
Parents: 3690958
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Aug 14 14:02:04 2018 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Aug 14 14:02:11 2018 +0200

----------------------------------------------------------------------
 .../apache/syncope/fit/core/BatchITCase.java    | 36 +++++++++++---------
 .../reference-guide/concepts/policies.adoc      |  1 -
 2 files changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/9126b7d0/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java
index 25980ed..ac8a001 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java
@@ -237,16 +237,18 @@ public class BatchITCase extends AbstractITCase {
         URI monitor = response.getLocation();
         assertNotNull(monitor);
 
-        // wait a bit...
-        try {
-            Thread.sleep(5000);
-        } catch (InterruptedException e) {
+        for (int i = 0; i < 10 && response.getStatus() == Response.Status.ACCEPTED.getStatusCode();
i++) {
+            // wait a bit...
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e) {
+            }
+
+            // check results
+            response = WebClient.create(monitor).
+                    header(HttpHeaders.AUTHORIZATION, "Bearer " + adminClient.getJWT()).
+                    type(RESTHeaders.multipartMixedWith(boundary.substring(2))).get();
         }
-
-        // check results: now available
-        response = WebClient.create(monitor).
-                header(HttpHeaders.AUTHORIZATION, "Bearer " + adminClient.getJWT()).
-                type(RESTHeaders.multipartMixedWith(boundary.substring(2))).get();
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
         assertTrue(response.getMediaType().toString().
                 startsWith(RESTHeaders.multipartMixedWith(boundary.substring(2))));
@@ -325,14 +327,16 @@ public class BatchITCase extends AbstractITCase {
         assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatus());
         assertTrue(response.getMediaType().toString().startsWith(RESTHeaders.MULTIPART_MIXED));
 
-        // wait a bit...
-        try {
-            Thread.sleep(5000);
-        } catch (InterruptedException e) {
-        }
+        for (int i = 0; i < 10 && response.getStatus() == Response.Status.ACCEPTED.getStatusCode();
i++) {
+            // wait a bit...
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e) {
+            }
 
-        // check results: now available
-        response = batchResponse.poll();
+            // check results
+            response = batchResponse.poll();
+        }
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatus());
         assertTrue(response.getMediaType().toString().startsWith(RESTHeaders.MULTIPART_MIXED));
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/9126b7d0/src/main/asciidoc/reference-guide/concepts/policies.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/reference-guide/concepts/policies.adoc b/src/main/asciidoc/reference-guide/concepts/policies.adoc
index 9909fcb..7e44597 100644
--- a/src/main/asciidoc/reference-guide/concepts/policies.adoc
+++ b/src/main/asciidoc/reference-guide/concepts/policies.adoc
@@ -305,7 +305,6 @@ with existing Users, Groups or Any Objects.
 The
 ifeval::["{snapshotOrRelease}" == "release"]
 https://github.com/apache/syncope/blob/syncope-{docVersion}/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/DefaultPullCorrelationRule.java[default^]
-]
 endif::[]
 ifeval::["{snapshotOrRelease}" == "snapshot"]
 https://github.com/apache/syncope/blob/master/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/DefaultPullCorrelationRule.java[default^]


Mime
View raw message