Enhance unit test for PermissionUtil to cover more group permission scenarios.

Reduce duplication of code in Permission constructors.
This commit is contained in:
David M. Carr
2011-01-07 17:11:24 -05:00
parent 2b74b1c825
commit 5f29c02ce6
2 changed files with 40 additions and 19 deletions

View File

@@ -69,6 +69,7 @@ public class Permission implements Serializable
*/
public Permission(String name)
{
this();
this.name = name;
}
@@ -81,7 +82,7 @@ public class Permission implements Serializable
*/
public Permission(String name, PermissionType type)
{
this.name = name;
this(name);
this.type = type;
}
@@ -90,14 +91,13 @@ public class Permission implements Serializable
*
*
* @param name
* @param groupPermission
* @param type
* @param groupPermission
*/
public Permission(String name, boolean groupPermission, PermissionType type)
public Permission(String name, PermissionType type, boolean groupPermission)
{
this.name = name;
this(name, type);
this.groupPermission = groupPermission;
this.type = type;
}
//~--- get methods ----------------------------------------------------------