directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-45 - Normalize fortress test policies
Date Thu, 13 Nov 2014 13:30:14 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 9603733b9 -> 8012dbe1c


FC-45 - Normalize fortress test policies


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/8012dbe1
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/8012dbe1
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/8012dbe1

Branch: refs/heads/master
Commit: 8012dbe1c67cdc25b6bcd48eb4c857e7c436a2ca
Parents: 9603733
Author: Shawn McKinney <smckinney@apache.org>
Authored: Thu Nov 13 07:29:59 2014 -0600
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Thu Nov 13 07:29:59 2014 -0600

----------------------------------------------------------------------
 .../core/rbac/DelegatedMgrImplTest.java         |  1 +
 .../fortress/core/rbac/PolicyTestData.java      | 25 ++++++++++++++++++++
 .../core/rbac/PswdPolicyMgrImplTest.java        | 13 ++++++----
 3 files changed, 34 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8012dbe1/src/test/java/org/apache/directory/fortress/core/rbac/DelegatedMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/rbac/DelegatedMgrImplTest.java
b/src/test/java/org/apache/directory/fortress/core/rbac/DelegatedMgrImplTest.java
index c203dba..a5a2105 100755
--- a/src/test/java/org/apache/directory/fortress/core/rbac/DelegatedMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/rbac/DelegatedMgrImplTest.java
@@ -161,6 +161,7 @@ public class DelegatedMgrImplTest extends TestCase
                 PermTestData.AUDITMGR_OBJ, PermTestData.AUDITMGR_OPS, false, true );
         }
 
+        PswdPolicyMgrImplTest.add( "ADD " + TestUtils.getDataLabel( PolicyTestData.class,
"POLICIES_BASE" ), PolicyTestData.POLICIES_BASE, true );
         AdminMgrImplTest.addUsers( "ADD-USRS TU0", UserTestData.USERS_TU0, false );
         assignAdminUsers( "ASGN-USRS TU0 SUPER", UserTestData.USERS_TU0, AdminRoleTestData.AROLES_SUPER,
false );
     }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8012dbe1/src/test/java/org/apache/directory/fortress/core/rbac/PolicyTestData.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/rbac/PolicyTestData.java b/src/test/java/org/apache/directory/fortress/core/rbac/PolicyTestData.java
index 0116c5b..cf63323 100755
--- a/src/test/java/org/apache/directory/fortress/core/rbac/PolicyTestData.java
+++ b/src/test/java/org/apache/directory/fortress/core/rbac/PolicyTestData.java
@@ -54,6 +54,31 @@ public class PolicyTestData extends TestCase
         String message();
     }
 
+    @MyAnnotation(name = "POLICIES_BASE", value = "PLCY BASE")
+    final public static String[][] POLICIES_BASE =
+        {
+
+            {
+                "Test1", /* NAME_COL */
+                "userPassword", /* ATTR_COL */
+                "0", /* MINAGE_COL */
+                "7776000", /* MAXAGE_COL */
+                "5", /* HISTORY_COL */
+                "2", /* CHKQUAL_COL */
+                "4", /* MINLEN_COL */
+                "2592000", /* EXPIREWARN_COL */
+                "3", /* GRACE_COL */
+                "TRUE", /* LOCKOUT_COL */
+                "0", /* LOCKDURATION_COL */
+                "3", /* MAXFAIL_COL */
+                "0", /* INTERVAL_COL */
+                "TRUE", /* MUSTCHG_COL */
+                "TRUE", /* ALLOWCHG_COL */
+                "FALSE" /* SAFEMODIFY_COL */
+            },
+        };
+
+
     /**
      * Test Case TP1:
      */

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/8012dbe1/src/test/java/org/apache/directory/fortress/core/rbac/PswdPolicyMgrImplTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/rbac/PswdPolicyMgrImplTest.java
b/src/test/java/org/apache/directory/fortress/core/rbac/PswdPolicyMgrImplTest.java
index 0e1369e..77369a4 100755
--- a/src/test/java/org/apache/directory/fortress/core/rbac/PswdPolicyMgrImplTest.java
+++ b/src/test/java/org/apache/directory/fortress/core/rbac/PswdPolicyMgrImplTest.java
@@ -1191,8 +1191,8 @@ public class PswdPolicyMgrImplTest extends TestCase
         // todo: use annotations to pass names of input tables for logging:
         //     public void add(PwPolicy policy)
         //add("POLICIES_TP1", PolicyTestData.POLICIES_TP1);
-        add( "ADD " + TestUtils.getDataLabel( PolicyTestData.class, "POLICIES_TP1" ), PolicyTestData.POLICIES_TP1
);
-        add( "ADD " + TestUtils.getDataLabel( PolicyTestData.class, "POLICIES_TP2" ), PolicyTestData.POLICIES_TP2
);
+        add( "ADD " + TestUtils.getDataLabel( PolicyTestData.class, "POLICIES_TP1" ), PolicyTestData.POLICIES_TP1,
false );
+        add( "ADD " + TestUtils.getDataLabel( PolicyTestData.class, "POLICIES_TP2" ), PolicyTestData.POLICIES_TP2,
false );
     }
 
 
@@ -1200,7 +1200,7 @@ public class PswdPolicyMgrImplTest extends TestCase
      * @param msg
      * @param pArray
      */
-    public void add( String msg, String[][] pArray )
+    public static void add( String msg, String[][] pArray, boolean nofail )
     {
         LogUtil.logIt( msg );
         try
@@ -1215,8 +1215,11 @@ public class PswdPolicyMgrImplTest extends TestCase
         }
         catch ( SecurityException ex )
         {
-            LOG.error( "add caught SecurityException rc=" + ex.getErrorId() + ", msg=" +
ex.getMessage(), ex );
-            fail( ex.getMessage() );
+            if(!nofail)
+            {
+                LOG.error( "add caught SecurityException rc=" + ex.getErrorId() + ", msg="
+ ex.getMessage(), ex );
+                fail( ex.getMessage() );
+            }
         }
     }
 


Mime
View raw message