org.opensubsystems.security.persist.db
Class SecureDatabaseTestUtils

java.lang.Object
  extended by org.opensubsystems.security.persist.db.SecureDatabaseTestUtils

public class SecureDatabaseTestUtils
extends java.lang.Object

This class is used to setup environment for secure test. It creates default user and domain and setup the call context.

Version:
$Id: SecureDatabaseTestUtils.java,v 1.12 2007/01/28 06:54:40 bastafidli Exp $
Author:
Miroslav Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
static java.lang.String DEFAULT_USER_PASSWORD
          Password used for default user.
protected  org.opensubsystems.security.persist.DomainFactory m_domainFactory
          Factory to manage domains.
protected  org.opensubsystems.security.persist.ExternalSessionFactory m_externalSessionFactory
          Factory to manage external sessions.
protected  org.opensubsystems.security.persist.InternalSessionFactory m_internalSessionFactory
          Factory to manage internal sessions.
protected  org.opensubsystems.security.persist.UserFactory m_userFactory
          Factory to manage user.
 
Constructor Summary
SecureDatabaseTestUtils()
          Create new SecureDatabaseTestUtils.
 
Method Summary
 void setUpGuestUser(java.lang.String strTestClassName, java.lang.String strTestName)
          Setup the database with brand new domain and brand new guest user so we can run tests in simulated secure environment.
 void setUpSecurity(java.lang.String strTestClassName, java.lang.String strTestName)
          Setup the database with brand new domain and brand new user so we can run tests in simulated secure environment.
 void setUpSecuritySafely(java.lang.String strTestClassName, java.lang.String strTestName)
          Setup the call context so we can run in simulated secure environment.
 void tearDown()
          Tear down method that will destroy test domain, user and its sessions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_USER_PASSWORD

public static final java.lang.String DEFAULT_USER_PASSWORD
Password used for default user.

See Also:
Constant Field Values

m_domainFactory

protected org.opensubsystems.security.persist.DomainFactory m_domainFactory
Factory to manage domains.


m_userFactory

protected org.opensubsystems.security.persist.UserFactory m_userFactory
Factory to manage user.


m_internalSessionFactory

protected org.opensubsystems.security.persist.InternalSessionFactory m_internalSessionFactory
Factory to manage internal sessions.


m_externalSessionFactory

protected org.opensubsystems.security.persist.ExternalSessionFactory m_externalSessionFactory
Factory to manage external sessions.

Constructor Detail

SecureDatabaseTestUtils

public SecureDatabaseTestUtils()
                        throws java.lang.Exception
Create new SecureDatabaseTestUtils.

Throws:
java.lang.Exception - - an error has occured
Method Detail

setUpSecurity

public void setUpSecurity(java.lang.String strTestClassName,
                          java.lang.String strTestName)
                   throws java.lang.Exception
Setup the database with brand new domain and brand new user so we can run tests in simulated secure environment.

Parameters:
strTestClassName - - name of the class running this test
strTestName - - name of the test being executed
Throws:
java.lang.Exception - - problem setting up test case

setUpGuestUser

public void setUpGuestUser(java.lang.String strTestClassName,
                           java.lang.String strTestName)
                    throws java.lang.Exception
Setup the database with brand new domain and brand new guest user so we can run tests in simulated secure environment.

Parameters:
strTestClassName - - name of the class running this test
strTestName - - name of the test being executed
Throws:
java.lang.Exception - - problem setting up test case

setUpSecuritySafely

public void setUpSecuritySafely(java.lang.String strTestClassName,
                                java.lang.String strTestName)
                         throws java.lang.Exception
Setup the call context so we can run in simulated secure environment. New domain and user will be created only if one doesn't exists.

Parameters:
strTestClassName - - name of the class running this test
strTestName - - name of the test being executed
Throws:
java.lang.Exception - - problem setting up test case

tearDown

public void tearDown()
              throws java.lang.Exception
Tear down method that will destroy test domain, user and its sessions.

Throws:
java.lang.Exception - - error occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.