syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject syncope git commit: added more precise test, SYNCOPE-727
Date Mon, 23 Nov 2015 15:29:35 GMT
Repository: syncope
Updated Branches:
  refs/heads/master d398b6e05 -> 7a259ec2e


added more precise test, SYNCOPE-727


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

Branch: refs/heads/master
Commit: 7a259ec2e00263e9aba922a549c62d114393d28d
Parents: d398b6e
Author: massi <massimiliano.perrone@tirasa.net>
Authored: Mon Nov 23 16:29:00 2015 +0100
Committer: massi <massimiliano.perrone@tirasa.net>
Committed: Mon Nov 23 16:29:00 2015 +0100

----------------------------------------------------------------------
 .../syncope/fit/core/reference/CLIITCase.java   | 26 ++++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/7a259ec2/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/CLIITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/CLIITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/CLIITCase.java
index 3e2dcbd..d05f446 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/CLIITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/CLIITCase.java
@@ -148,16 +148,20 @@ public class CLIITCase extends AbstractITCase {
 
     @Test
     public void userRead() {
-        final long userId = 1;
+        final long userId1 = 1;
+        final long userId2 = 2;
+        final long userId3 = 3;
+        final long userId4 = 4;
+        final long userId5 = 5;
         try {
-            PROCESS_BUILDER.command(getCommand("user", "--read", String.valueOf(userId)));
+            PROCESS_BUILDER.command(getCommand("user", "--read", String.valueOf(userId1)));
             final Process process = PROCESS_BUILDER.start();
             final String result = IOUtils.toString(process.getInputStream());
-            assertTrue(result.contains("username: " + userService.read(userId).getUsername()));
+            assertTrue(result.contains("username: " + userService.read(userId1).getUsername()));
             process.destroy();
 
-            PROCESS_BUILDER.command(getCommand("user", "--read", String.valueOf("1"), String.valueOf("2"),
-                    String.valueOf("3"), String.valueOf("4"), String.valueOf("5")));
+            PROCESS_BUILDER.command(getCommand("user", "--read", String.valueOf(userId1),
String.valueOf(userId2),
+                    String.valueOf(userId3), String.valueOf(userId4), String.valueOf(userId5)));
             final Process process2 = PROCESS_BUILDER.start();
             int users = CollectionUtils.countMatches(IOUtils.readLines(process2.getInputStream()),
                     new Predicate<String>() {
@@ -170,6 +174,18 @@ public class CLIITCase extends AbstractITCase {
             assertEquals(5, users);
 
             process2.destroy();
+
+            PROCESS_BUILDER.command(getCommand("user", "--read", String.valueOf(userId1),
String.valueOf(userId2),
+                    String.valueOf(userId3), String.valueOf(userId4), String.valueOf(userId5)));
+            final Process process3 = PROCESS_BUILDER.start();
+            final String result3 = IOUtils.toString(process3.getInputStream());
+            assertTrue(
+                    result3.contains("username: " + userService.read(userId1).getUsername())
+                    && result3.contains("username: " + userService.read(userId2).getUsername())
+                    && result3.contains("username: " + userService.read(userId3).getUsername())
+                    && result3.contains("username: " + userService.read(userId4).getUsername())
+                    && result3.contains("username: " + userService.read(userId5).getUsername()));
+            process3.destroy();
         } catch (IOException e) {
             fail(e.getMessage());
         }


Mime
View raw message