issrg.test.universal.soa
Class SimpleTesting

java.lang.Object
  extended by issrg.test.universal.soa.SimpleTesting

public class SimpleTesting
extends java.lang.Object

This class is designed as the ancester class for universal soa testing and oblgiation testing based on plain text policies and credentials.

Subclass might reimplemented constructSubject and prepareTestCases functions to suite the testing requirement.

constructSubject is where we construct a permis subject based on the credentials held by the requesters. The default one use plain text to specify the credentials.

The prepareTestCases is the function where test cases are specified. Test cases care stored in 5 arrays, which are m_users, m_roles,m_issuers, m_actions, m_targets.

test funciton is actually the function that is responsible for implementing the test control flow, where it control the system to read from the input, write results into the output, and control every individual testing case.


Field Summary
protected  java.lang.String[] m_actions
          array to hold action names
protected  java.lang.String[] m_issuers
          array to hold the issuer ldap dn names of attributes
protected  java.lang.String[] m_roles
          array to hold roles
protected  java.lang.String[] m_targets
          array to hold target ldap dn names
protected  java.lang.String[] m_users
          array to hold the user ldap dn names
 
Constructor Summary
SimpleTesting()
          Creates a new instance of SimpleTesting
 
Method Summary
 boolean constructAction(java.lang.String actionName)
           
 boolean constructADF()
          Contruct the Authorization Decision Function object.
 boolean constructSubject(java.lang.String userDN, java.lang.String roleValue, java.lang.String issuerLDAPDN)
          Construct a permis subject object that represents the subject who is going to perform the action
 boolean constructTarget(java.lang.String targetDN)
           
 Response consult()
           
 boolean loadPolicy(java.lang.String pathNameofPolicy)
          This function loads the specified policy from an plain xml file.
 void prepareTestCases(java.lang.String[] users, java.lang.String[] roles, java.lang.String[] issuers, java.lang.String[] actions, java.lang.String[] targets)
           
 void test(java.lang.String policyfileName, java.lang.String outputResult)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_users

protected java.lang.String[] m_users
array to hold the user ldap dn names


m_roles

protected java.lang.String[] m_roles
array to hold roles


m_issuers

protected java.lang.String[] m_issuers
array to hold the issuer ldap dn names of attributes


m_actions

protected java.lang.String[] m_actions
array to hold action names


m_targets

protected java.lang.String[] m_targets
array to hold target ldap dn names

Constructor Detail

SimpleTesting

public SimpleTesting()
Creates a new instance of SimpleTesting

Method Detail

loadPolicy

public boolean loadPolicy(java.lang.String pathNameofPolicy)
This function loads the specified policy from an plain xml file.

Parameters:
pathNameofPolicy - - The Full file name of the policy file. The file name shall include the path to allow java vm to locate the file.

constructADF

public boolean constructADF()
Contruct the Authorization Decision Function object. This shall be after the policy is loaded.

Returns:
True -- when sucessfully construct the ADF. Otherwise false.

constructSubject

public boolean constructSubject(java.lang.String userDN,
                                java.lang.String roleValue,
                                java.lang.String issuerLDAPDN)
Construct a permis subject object that represents the subject who is going to perform the action

Parameters:
userDN - user's DN
roleValue - the value of user's permisRole attribute
issuerLDAPDN - the DN of the issuer of the role

constructAction

public boolean constructAction(java.lang.String actionName)

constructTarget

public boolean constructTarget(java.lang.String targetDN)

consult

public Response consult()
                 throws PbaException
Throws:
PbaException

prepareTestCases

public void prepareTestCases(java.lang.String[] users,
                             java.lang.String[] roles,
                             java.lang.String[] issuers,
                             java.lang.String[] actions,
                             java.lang.String[] targets)

test

public void test(java.lang.String policyfileName,
                 java.lang.String outputResult)
Parameters:
policyfileName - the file name of the policy file. It must be suffice for the system to locate the file on the file system, either in relative path format or in full path format.
outputResult - the finle name of the output file. It must be suffice for the system to locate the file on the file system, either in relative path format or in full path format. All testing outputs are writting to this file. If the file exists before this testing, the content of the file will be wipped off.