cancel
Showing results for 
Search instead for 
Did you mean: 

How to "simulate" days passing, for audit test purposes? Temper with OS date?

nicolasraoul
Star Contributor
Star Contributor

I must write tests for an Alfresco auditing application (based on Alfresco audit) that lets administrators search for audit data per day. For instance, an administrator can ask for today's audit records, or yesterday's audit records.

So, a naive test for the "yesterday" feature would be: "Perform action X. Come back the next day and check whether it appears in yesterday's audit records."

Unfortunately, all tests must be performed in a single day on the customer's test environment.

Question: How can I "simulate" activity for yesterday? Or make Alfresco believe that we are tomorrow already?

I have thought about tempering with the operating system date, but would that make Alfresco behave unpredictably, thus making the test results worthless?

Thanks a lot!

Nicolas Raoul

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Changing the OS clock is about the only thing you can do to speed up such tests. The primary thing you need to keep in mind is that you can only advance the system clock and should never revert it during the tests. If you are done with testing, you should restore the DB to a state taking before the tests so you can safely revert the system clock to the correct time.

View answer in original post

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

Changing the OS clock is about the only thing you can do to speed up such tests. The primary thing you need to keep in mind is that you can only advance the system clock and should never revert it during the tests. If you are done with testing, you should restore the DB to a state taking before the tests so you can safely revert the system clock to the correct time.