directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [1/5] directory-fortress-core git commit: fixed test classes
Date Sat, 09 Jan 2016 00:15:04 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 5d4d78923 -> dc5bd437e


fixed test classes


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/95f172c8
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/95f172c8
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/95f172c8

Branch: refs/heads/master
Commit: 95f172c8a234b6f504aaa47c0a76406ebe43d0e1
Parents: 830acef
Author: clp207 <clp207@psu.edu>
Authored: Tue Jan 5 13:21:14 2016 -0500
Committer: clp207 <clp207@psu.edu>
Committed: Fri Jan 8 14:51:37 2016 -0500

----------------------------------------------------------------------
 .../fortress/core/impl/AdminRoleTestData.java   |  4 +--
 .../core/impl/accelerator/TestAccelerator.java  | 27 +++++++++++---------
 .../core/samples/CreateSessionSample.java       | 17 ++++++------
 3 files changed, 26 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/95f172c8/src/test/java/org/apache/directory/fortress/core/impl/AdminRoleTestData.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/AdminRoleTestData.java
b/src/test/java/org/apache/directory/fortress/core/impl/AdminRoleTestData.java
index 1019763..a2e29ca 100755
--- a/src/test/java/org/apache/directory/fortress/core/impl/AdminRoleTestData.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/AdminRoleTestData.java
@@ -980,8 +980,8 @@ public class AdminRoleTestData extends TestCase
         AdminRole role = ( AdminRole ) getRoleConstraint( rle );
         role.setName( RoleTestData.getName( rle ) );
         role.setDescription( RoleTestData.getDescription( rle ) );
-        role.setOsU( getOsU( rle ) );
-        role.setOsP( getOsP( rle ) );
+        role.setOsUList( getOsU( rle ) );
+        role.setOsPList( getOsP( rle ) );
         role.setBeginRange( getBeginRange( rle ) );
         role.setEndRange( getEndRange( rle ) );
         role.setBeginInclusive( isBeginInclusive( rle ) );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/95f172c8/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
b/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
index 73826ba..c05da95 100644
--- a/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
+++ b/src/test/java/org/apache/directory/fortress/core/impl/accelerator/TestAccelerator.java
@@ -19,21 +19,24 @@
  */
 package org.apache.directory.fortress.core.impl.accelerator;
 
-import org.apache.directory.fortress.core.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import org.apache.directory.fortress.core.AccelMgr;
+import org.apache.directory.fortress.core.AccelMgrFactory;
 import org.apache.directory.fortress.core.SecurityException;
+import org.apache.directory.fortress.core.impl.TestUtils;
+import org.apache.directory.fortress.core.model.Permission;
+import org.apache.directory.fortress.core.model.Session;
+import org.apache.directory.fortress.core.model.User;
+import org.apache.directory.fortress.core.model.UserRole;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.directory.fortress.core.AccelMgr;
-import org.apache.directory.fortress.core.model.Permission;
-import org.apache.directory.fortress.core.model.Session;
-import org.apache.directory.fortress.core.impl.TestUtils;
-import org.apache.directory.fortress.core.model.User;
-import org.apache.directory.fortress.core.model.UserRole;
-
-import static org.junit.Assert.*;
 
 public class TestAccelerator
 {
@@ -83,8 +86,8 @@ public class TestAccelerator
             // positive test case:
             user.setUserId( "rbacuser1" );
             user.setPassword( "secret".toCharArray() );
-            user.setRole( "rbacrole1" );
-            user.setRole( "rbacrole2" );
+            user.setRoleName( "rbacrole1" );
+            user.setRoleName( "rbacrole2" );
             session = accelMgr.createSession( user, false );
             assertNotNull( session );
             assertTrue( session.isAuthenticated() );
@@ -188,7 +191,7 @@ public class TestAccelerator
             // positive test case:
             user.setUserId( "rbacuser1" );
             user.setPassword( "secret".toCharArray() );
-            user.setRole( "rbacrole1" );
+            user.setRoleName( "rbacrole1" );
             //user.setRole( "rbacrole2" );
             session = accelMgr.createSession( user, false );
             assertNotNull( session );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/95f172c8/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
b/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
index 0e889c4..1ecd077 100755
--- a/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
+++ b/src/test/java/org/apache/directory/fortress/core/samples/CreateSessionSample.java
@@ -19,23 +19,24 @@
  */
 package org.apache.directory.fortress.core.samples;
 
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
 import org.apache.directory.fortress.core.AccessMgr;
 import org.apache.directory.fortress.core.AccessMgrFactory;
+import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.PasswordException;
 import org.apache.directory.fortress.core.SecurityException;
-import org.apache.directory.fortress.core.GlobalErrIds;
 import org.apache.directory.fortress.core.impl.TestUtils;
-import org.apache.directory.fortress.core.model.User;
 import org.apache.directory.fortress.core.model.Session;
+import org.apache.directory.fortress.core.model.User;
 import org.apache.directory.fortress.core.model.UserRole;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.List;
-
 /**
  * CreateSessionSample JUnit Test. Fortress Sessions are modeled on the RBAC specification.
 Each Session
  * may contain User attributes plus all of their activated Roles.  The Session will also
contain pw policy
@@ -230,7 +231,7 @@ public class CreateSessionSample extends TestCase
             for (String roleName : roles)
             {
                 // Add the Role name to list of Roles to be activated on Session.
-                user.setRole(roleName);
+                user.setRoleName(roleName);
             }
 
             // The API will verify User is good and perform Role activations.  Request will
fail if User is locked out of ldap for any reason.


Mime
View raw message