org.apache.commons.chain.web
Class MockPrincipal

java.lang.Object
  extended by org.apache.commons.chain.web.MockPrincipal
All Implemented Interfaces:
Principal

public class MockPrincipal
extends Object
implements Principal

Mock Principal object for low-level unit tests.


Field Summary
protected  String name
           
protected  String[] roles
           
 
Constructor Summary
MockPrincipal()
           
MockPrincipal(String name)
           
MockPrincipal(String name, String[] roles)
           
 
Method Summary
 boolean equals(Object o)
           
 String getName()
           
 int hashCode()
           
 boolean isUserInRole(String role)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Field Detail

name

protected String name

roles

protected String[] roles
Constructor Detail

MockPrincipal

public MockPrincipal()

MockPrincipal

public MockPrincipal(String name)

MockPrincipal

public MockPrincipal(String name,
                     String[] roles)
Method Detail

getName

public String getName()
Specified by:
getName in interface Principal

isUserInRole

public boolean isUserInRole(String role)

equals

public boolean equals(Object o)
Specified by:
equals in interface Principal
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Principal
Overrides:
hashCode in class Object


Copyright © 2003-2010 The Apache Software Foundation. All Rights Reserved.