syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: Further attempt to investigate how this single test is failing only in Travis CI
Date Fri, 24 Jun 2016 07:56:06 GMT
Repository: syncope
Updated Branches:
  refs/heads/master e9d42f4ab -> 72fd2cfc0


Further attempt to investigate how this single test is failing only in Travis CI


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

Branch: refs/heads/master
Commit: 81d1b8e631ec365807ea0b0c53002475e8d344e3
Parents: e9d42f4
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Thu Jun 23 17:50:39 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Jun 23 18:07:13 2016 +0200

----------------------------------------------------------------------
 .../apache/syncope/fit/core/PullTaskITCase.java | 32 +++++++++++++++++++-
 .../src/test/resources/core-test.properties     | 18 +++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/81d1b8e6/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 9072127..66e2d76 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -25,15 +25,22 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 import java.util.UUID;
 import javax.ws.rs.core.Response;
 import org.apache.commons.collections4.IterableUtils;
 import org.apache.commons.collections4.Predicate;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.syncope.client.lib.SyncopeClient;
@@ -148,9 +155,30 @@ public class PullTaskITCase extends AbstractTaskITCase {
     }
 
     @Test
-    public void pull() throws Exception {
+    public void fromCSV() throws Exception {
         removeTestUsers();
 
+        // Attemp to reset CSV content
+        Properties props = new Properties();
+        InputStream propStream = null;
+        InputStream srcStream = null;
+        OutputStream dstStream = null;
+        try {
+            propStream = getClass().getResourceAsStream("/core-test.properties");
+            props.load(propStream);
+
+            srcStream = new FileInputStream(props.getProperty("test.csv.src"));
+            dstStream = new FileOutputStream(props.getProperty("test.csv.dst"));
+
+            IOUtils.copy(srcStream, dstStream);
+        } catch (IOException e) {
+            fail(e.getMessage());
+        } finally {
+            IOUtils.closeQuietly(propStream);
+            IOUtils.closeQuietly(srcStream);
+            IOUtils.closeQuietly(dstStream);
+        }
+
         // -----------------------------
         // Create a new user ... it should be updated applying pull policy
         // -----------------------------
@@ -180,6 +208,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
 
             ExecTO exec = execProvisioningTask(taskService, PULL_TASK_KEY, 50, false);
             assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
+            
+            LOG.info("Execution of task {}:\n{}", PULL_TASK_KEY, exec);
 
             // check for pull results
             int usersPost = userService.search(new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).

http://git-wip-us.apache.org/repos/asf/syncope/blob/81d1b8e6/fit/core-reference/src/test/resources/core-test.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/core-test.properties b/fit/core-reference/src/test/resources/core-test.properties
new file mode 100644
index 0000000..f4e4d32
--- /dev/null
+++ b/fit/core-reference/src/test/resources/core-test.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+test.csv.src=${project.build.directory}/test-classes/test.csv
+test.csv.dst=${test.csvdir.path}/test.csv


Mime
View raw message