Package COM. testauditing; import Java. util. iterator; import Org. apache. log4j. logger; import COM. filenet. API. collection. eventset; import COM. filenet. API. collection. versionableset; import COM. filenet. API. core. connection; import COM. filenet. API. core. document; import COM. filenet. API. core. factory; import COM. filenet. API. core. objectStore; import COM. filenet. API. core. versionable; import COM. filenet. API. events. event; Import COM. filenet. API. util. ID; import COM. util. cehelper; import JUnit. framework. testcase; public class auditingtest extends testcase {logger = logger. getlogger (auditingtest. class. tostring ();/*** auditing the getcontent, checkout, checkin, and other events of a document. * once the current version of a document (A1) is checkin to another main version (A2) then, checkin is auditing to version A2. */Public void testretrive () {connection conn = cehelper. getconnection (); cehelper. pushsubject (Conn, "Administrator", "filenet"); ObjectStore OS = cehelper. getobjectstore (conn); document DOC = factory. document. fetchinstance (OS, new ID ("{413083cb-9d09-4666-a348-9d4b3ac135d1}"), null); eventset events = Doc. get_auditedevents (); iterator <event> iter = events. iterator (); event E = NULL; while (ITER. hasnext () {e = (event) ITER. next (); logger.info ("e. get_creator () = "+ E. get_creator (); logger.info ("e. get_eventstatus () = "+ E. get_eventstatus (); logger.info ("e. get_classdescription (). get_displayname () = "+ E. get_classdescription (). get_displayname (); logger.info ("e. get_datecreated () = "+ E. get_datecreated (); logger.info ("e. get_name () = "+ E. get_name ();} document doc1 = factory. document. fetchinstance (OS, new ID ("{region}"), null); eventset events1 = doc1.get _ auditedevents (); iterator <event> iter1 = events1.iterator (); event e1 = NULL; while (iter1.hasnext () {e1 = (event) iter1.next (); logger.info ("e1.get _ creator () =" + e1.get _ creator ()); logger.info ("e1.get _ eventstatus () =" + e1.get _ eventstatus (); logger.info ("e1.get _ classdescription (). get_displayname () = "+ e1.get _ classdescription (). get_displayname (); logger.info ("e1.get _ datecreated () =" + e1.get _ datecreated (); logger.info ("e1.get _ name () = "+ e1.get _ name ();} cehelper. popsubject ();}/*** get the versions of this document by using an ID, after converting the corresponding version to document, you can obtain the auditing */Public void testversions () {connection conn = cehelper. getconnection (); cehelper. pushsubject (Conn, "Administrator", "filenet"); ObjectStore OS = cehelper. getobjectstore (conn); document DOC = factory. document. fetchinstance (OS, new ID ("{157be333-70ab-4b85-8f0e-9ac587e26ff2}"), null); versionableset versions = Doc. get_versions (); iterator <versionable> iter = versions. iterator (); document doc_temp = NULL; event e1 = NULL; while (ITER. hasnext () {doc_temp = (document) ITER. next (); eventset events = doc_temp.get_auditedevents (); logger.info ("doc_temp.get_id (). tostring () = "+ doc_temp.get_id (). tostring (); iterator <event> iter1 = events. iterator (); While (iter1.hasnext () {e1 = (event) iter1.next (); logger.info ("e1.get _ creator () =" + e1.get _ creator ()); logger.info ("e1.get _ eventstatus () =" + e1.get _ eventstatus (); logger.info ("e1.get _ classdescription (). get_displayname () = "+ e1.get _ classdescription (). get_displayname (); logger.info ("e1.get _ datecreated () =" + e1.get _ datecreated (); logger.info ("e1.get _ name () = "+ e1.get _ name () ;}} cehelper. popsubject ();} public void testdeletion (){}}