• Post Reply Bookmark Topic Watch Topic
  • New Topic

Time shifted testing in enterprise applications  RSS feed

 
Pradeep Nishantha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on an enterprise application running in JBOSS application server. The application records product subscriptions and creates transactions once a month. I want to develop an automated test case in which it makes a subscription, shifts the date by 10 months and creates transactions(10 transactions need to be created).

One of the solution is to mock the System class in jdk (http://virgo47.wordpress.com/2012/06/22/changing-system-time-in-java/) but it changes the time of all the applications those are using mocked System class. Isolating the System class usage of my application to a utility and mock that utility solves the problem but there are other issues such as third party libraries can have usage of System class / there are places where the java Calender is used.

I would like to know that is there any way to achieve this time changing behavior .
 
Mansukhdeep Thind
Ranch Hand
Posts: 1163
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch Pradeep.

If I understand the use case correctly, you want to simulate this event of subscriptions and transactions with a certain delay between them using some sort of scheduling service. Is that correct? What all have you tried so far?
 
Pradeep Nishantha
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mansukhdeep

There is not a problem with the scheduling service. it works fine. What I want is shift the time of my application to couple of month ahead / backward and run the service. I was not able to shift the time of the application although the mentioned method is used.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!