// Path: src/main/java/com/raibledesigns/Constants.java
// public final class Constants {
// 
//     private Constants() {
//         // hide me
//     }
//     //~ Static fields/initializers =============================================
// 
//     /**
//      * Assets Version constant
//      */
//     public static final String ASSETS_VERSION = "assetsVersion";
//     /**
//      * The name of the ResourceBundle used in this application
//      */
//     public static final String BUNDLE_KEY = "ApplicationResources";
// 
//     /**
//      * File separator from System properties
//      */
//     public static final String FILE_SEP = System.getProperty("file.separator");
// 
//     /**
//      * User home from System properties
//      */
//     public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;
// 
//     /**
//      * The name of the configuration hashmap stored in application scope.
//      */
//     public static final String CONFIG = "appConfig";
// 
//     /**
//      * Session scope attribute that holds the locale set by the user. By setting this key
//      * to the same one that Struts uses, we get synchronization in Struts w/o having
//      * to do extra work or have two session-level variables.
//      */
//     public static final String PREFERRED_LOCALE_KEY = "org.apache.struts2.action.LOCALE";
// 
//     /**
//      * The request scope attribute under which an editable user form is stored
//      */
//     public static final String USER_KEY = "userForm";
// 
//     /**
//      * The request scope attribute that holds the user list
//      */
//     public static final String USER_LIST = "userList";
// 
//     /**
//      * The request scope attribute for indicating a newly-registered user
//      */
//     public static final String REGISTERED = "registered";
// 
//     /**
//      * The name of the Administrator role, as specified in web.xml
//      */
//     public static final String ADMIN_ROLE = "ROLE_ADMIN";
// 
//     /**
//      * The name of the User role, as specified in web.xml
//      */
//     public static final String USER_ROLE = "ROLE_USER";
// 
//     /**
//      * The name of the user's role list, a request-scoped attribute
//      * when adding/editing a user.
//      */
//     public static final String USER_ROLES = "userRoles";
// 
//     /**
//      * The name of the available roles list, a request-scoped attribute
//      * when adding/editing a user.
//      */
//     public static final String AVAILABLE_ROLES = "availableRoles";
// 
//     /**
//      * The name of the CSS Theme setting.
//      * @deprecated No longer used to set themes.
//      */
//     public static final String CSS_THEME = "csstheme";
// }
// 
// Path: src/main/java/com/raibledesigns/model/Role.java
// @Entity
// @Table(name = "role")
// @NamedQueries({
//         @NamedQuery(
//                 name = "findRoleByName",
//                 query = "select r from Role r where r.name = :name "
//         )
// })
// public class Role extends BaseObject implements Serializable, GrantedAuthority {
//     private static final long serialVersionUID = 3690197650654049848L;
//     private Long id;
//     private String name;
//     private String description;
// 
//     /**
//      * Default constructor - creates a new instance with no values set.
//      */
//     public Role() {
//     }
// 
//     /**
//      * Create a new instance and set the name.
//      *
//      * @param name name of the role.
//      */
//     public Role(final String name) {
//         this.name = name;
//     }
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     public Long getId() {
//         return id;
//     }
// 
//     /**
//      * @return the name property (getAuthority required by Acegi's GrantedAuthority interface)
//      * @see org.springframework.security.core.GrantedAuthority#getAuthority()
//      */
//     @Transient
//     public String getAuthority() {
//         return getName();
//     }
// 
//     @Column(length = 20)
//     public String getName() {
//         return this.name;
//     }
// 
//     @Column(length = 64)
//     public String getDescription() {
//         return this.description;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (!(o instanceof Role)) {
//             return false;
//         }
// 
//         final Role role = (Role) o;
// 
//         return !(name != null ? !name.equals(role.name) : role.name != null);
// 
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public int hashCode() {
//         return (name != null ? name.hashCode() : 0);
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public String toString() {
//         return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
//                 .append(this.name)
//                 .toString();
//     }
// }


import com.raibledesigns.Constants;
import com.raibledesigns.model.Role;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.transaction.Transactional;
import static org.junit.Assert.*;
package com.raibledesigns.dao;




@Transactional
public class RoleDaoTest extends BaseDaoTestCase {
    @Autowired
    private RoleDao dao;

    @Test
    public void testGetRoleInvalid() throws Exception {
        Role role = dao.getRoleByName("badrolename");
        assertNull(role);
    }

    @Test
    public void testGetRole() throws Exception {
// Path: src/main/java/com/raibledesigns/Constants.java
// public final class Constants {
// 
//     private Constants() {
//         // hide me
//     }
//     //~ Static fields/initializers =============================================
// 
//     /**
//      * Assets Version constant
//      */
//     public static final String ASSETS_VERSION = "assetsVersion";
//     /**
//      * The name of the ResourceBundle used in this application
//      */
//     public static final String BUNDLE_KEY = "ApplicationResources";
// 
//     /**
//      * File separator from System properties
//      */
//     public static final String FILE_SEP = System.getProperty("file.separator");
// 
//     /**
//      * User home from System properties
//      */
//     public static final String USER_HOME = System.getProperty("user.home") + FILE_SEP;
// 
//     /**
//      * The name of the configuration hashmap stored in application scope.
//      */
//     public static final String CONFIG = "appConfig";
// 
//     /**
//      * Session scope attribute that holds the locale set by the user. By setting this key
//      * to the same one that Struts uses, we get synchronization in Struts w/o having
//      * to do extra work or have two session-level variables.
//      */
//     public static final String PREFERRED_LOCALE_KEY = "org.apache.struts2.action.LOCALE";
// 
//     /**
//      * The request scope attribute under which an editable user form is stored
//      */
//     public static final String USER_KEY = "userForm";
// 
//     /**
//      * The request scope attribute that holds the user list
//      */
//     public static final String USER_LIST = "userList";
// 
//     /**
//      * The request scope attribute for indicating a newly-registered user
//      */
//     public static final String REGISTERED = "registered";
// 
//     /**
//      * The name of the Administrator role, as specified in web.xml
//      */
//     public static final String ADMIN_ROLE = "ROLE_ADMIN";
// 
//     /**
//      * The name of the User role, as specified in web.xml
//      */
//     public static final String USER_ROLE = "ROLE_USER";
// 
//     /**
//      * The name of the user's role list, a request-scoped attribute
//      * when adding/editing a user.
//      */
//     public static final String USER_ROLES = "userRoles";
// 
//     /**
//      * The name of the available roles list, a request-scoped attribute
//      * when adding/editing a user.
//      */
//     public static final String AVAILABLE_ROLES = "availableRoles";
// 
//     /**
//      * The name of the CSS Theme setting.
//      * @deprecated No longer used to set themes.
//      */
//     public static final String CSS_THEME = "csstheme";
// }
// 
// Path: src/main/java/com/raibledesigns/model/Role.java
// @Entity
// @Table(name = "role")
// @NamedQueries({
//         @NamedQuery(
//                 name = "findRoleByName",
//                 query = "select r from Role r where r.name = :name "
//         )
// })
// public class Role extends BaseObject implements Serializable, GrantedAuthority {
//     private static final long serialVersionUID = 3690197650654049848L;
//     private Long id;
//     private String name;
//     private String description;
// 
//     /**
//      * Default constructor - creates a new instance with no values set.
//      */
//     public Role() {
//     }
// 
//     /**
//      * Create a new instance and set the name.
//      *
//      * @param name name of the role.
//      */
//     public Role(final String name) {
//         this.name = name;
//     }
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     public Long getId() {
//         return id;
//     }
// 
//     /**
//      * @return the name property (getAuthority required by Acegi's GrantedAuthority interface)
//      * @see org.springframework.security.core.GrantedAuthority#getAuthority()
//      */
//     @Transient
//     public String getAuthority() {
//         return getName();
//     }
// 
//     @Column(length = 20)
//     public String getName() {
//         return this.name;
//     }
// 
//     @Column(length = 64)
//     public String getDescription() {
//         return this.description;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public boolean equals(Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (!(o instanceof Role)) {
//             return false;
//         }
// 
//         final Role role = (Role) o;
// 
//         return !(name != null ? !name.equals(role.name) : role.name != null);
// 
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public int hashCode() {
//         return (name != null ? name.hashCode() : 0);
//     }
// 
//     /**
//      * {@inheritDoc}
//      */
//     public String toString() {
//         return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
//                 .append(this.name)
//                 .toString();
//     }
// }


// Path: src/test/java/com/raibledesigns/dao/RoleDaoTest.java
import com.raibledesigns.Constants;
import com.raibledesigns.model.Role;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.transaction.Transactional;
import static org.junit.Assert.*;

package com.raibledesigns.dao;




@Transactional
public class RoleDaoTest extends BaseDaoTestCase {
    @Autowired
    private RoleDao dao;

    @Test
    public void testGetRoleInvalid() throws Exception {
        Role role = dao.getRoleByName("badrolename");
        assertNull(role);
    }

    @Test
    public void testGetRole() throws Exception {
        Role role = dao.getRoleByName(Constants.USER_ROLE);