|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.Time issrg.pba.rbac.Clock issrg.test.rbac.PermisRBACTest
public class PermisRBACTest
This class is an application that processes a batch of user/target/action requests in a fashion very similar to SamleAEF. It outputs the results of processing the batch line by line. It is possible to compare the results of processing with different versions of PERMIS RBAC. If the results differ, then the code changed inconsistently.
The batch file has the following format:
# comments
# and empty lines are allowed
[instruction]: [what to do]
An instruction can be: "inc" - include another batch file; "ini" - initialise Permis RBAC, "env" - set an environmental parameter, "usr" - getCreds for the given user, "arg" - set an argument, "act" - set an action name, "tgt" - set a target name, "..." - same instruction as above, which is used to group multi-line settings.
E.g.:
env: clock=2005-10-23T0:0
...: balance=0
env: clock=2005-01-01T0:0
In the above example the first two environmental settings relate to the same environment. The third line is in another environment. Later the application will try both environments individually.
The application will try the specified environments, users, actions and targets in the sequence that the file states them.
The algorithm of processing the batch is as follows:
"ini:", "env:" and "arg:"+"act:" are multi-line settings. The settings
are grouped into one collection as described above for "ini:". Other settings
are one-line, and are collected irrespective of whether they are grouped or
not. The settings between one "ini:" group and another "ini:" group are
treated as a single test suite.
Field Summary | |
---|---|
static java.io.PrintWriter |
out
|
Fields inherited from class issrg.pba.rbac.Time |
---|
log, s_defaultTimeZone, TIME_TYPE |
Constructor Summary | |
---|---|
PermisRBACTest()
|
Method Summary | |
---|---|
java.util.Date |
getTime()
This method returns the time returned by the last call to latch, so all calculations will be consistent. |
PermisRBAC |
init(java.util.Map setup,
java.io.File parentDir)
This method is called to create a PermisRBAC object using the current setup. |
java.util.Date |
latch()
The time is stopped forever, so the latch returns the same as getTime() |
static void |
main(java.lang.String[] args)
|
void |
process(java.lang.String[] args,
java.lang.String encoding)
|
void |
setInitValue(java.util.Map setup,
java.lang.String var,
java.lang.String val)
This method is called to set init values for Permis RBAC in this test. |
void |
setTime(java.util.Date time)
This method sets the current time. |
static void |
test(java.lang.String[] args,
PermisRBACTest pt,
boolean append)
|
static java.util.Date |
toTime(java.lang.String timeString)
This method returns the time encoded as a string. |
Methods inherited from class issrg.pba.rbac.Clock |
---|
getEvaluationTime |
Methods inherited from class issrg.pba.rbac.Time |
---|
calendarToTime, calendarToTime, compareTo, equals, getDefaultTimeZone, parse, register, setDefaultTimeZone, setDefaultTimeZone, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.io.PrintWriter out
Constructor Detail |
---|
public PermisRBACTest()
Method Detail |
---|
public static void main(java.lang.String[] args)
public static void test(java.lang.String[] args, PermisRBACTest pt, boolean append)
public void process(java.lang.String[] args, java.lang.String encoding)
public PermisRBAC init(java.util.Map setup, java.io.File parentDir) throws java.lang.Exception
setup
- the Map of values collected prior to initparentDir
- the directory in which the config file is located
and all relative paths should be computed relative to it
java.lang.Exception
public void setInitValue(java.util.Map setup, java.lang.String var, java.lang.String val) throws PbaException
PbaException
public java.util.Date latch()
latch
in class Clock
public java.util.Date getTime()
Clock
getTime
in class Clock
public static java.util.Date toTime(java.lang.String timeString) throws java.lang.IllegalArgumentException
timeString
- - the time to set; the format is the same as the string representation of time in the policy, e.g. "2005-09-25T23:59:59"
java.lang.IllegalArgumentException
public void setTime(java.util.Date time)
time
- - the time to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |