# US 2010/0250225 A1 · Date and time simulation for time-sensitive applications

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0250225 A1
- Document ID: US20100250225A1
- Status: Published application
- Kind: A1
- Application number: 12/415,908
- Filed: 2009-03-31
- Published: 2010-09-30
- Earliest claimed: 2009-03-31
- Assignees: International Business Machines Corporation
- Inventors: Trent A. Gray-Donald; Marc Warner Price
- Web page: https://patentgrep.com/patent/US20100250225A1

## CPC

- G06F 11/3696: {Methods or tools to render software testable}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A process for providing a simulated date and/or time to a time-sensitive application is disclosed herein. Such a process may include detecting the invocation of a time handler method configured to retrieve system time. Upon detecting the invocation, the contents of a call stack may be captured and analyzed to determine which requester method initiated the invocation. The process may then determine whether the requester method should receive a real or simulated system time. A real system time may be returned to the requester method in the event it should receive the real system time. A simulated system time may be returned to the requester method in the event it should receive the simulated system time. A corresponding apparatus and computer program product are also disclosed and claimed herein.

## Claims

### Claim 1

A process for providing a simulated date and/or time to a time-sensitive application, the process comprising:
detecting the invocation of a time handler method, the time handler method configured to retrieve the system time of a computing system;
capturing the contents of a call stack upon detecting the invocation;
analyzing the contents of the call stack to determine which requester method initiated the invocation;
determining whether the requester method that initiated the invocation should receive one of a real system time and a simulated system time;
returning a real system time in the event the requester method is intended to receive the real system time; and
returning a simulated system time in the event the requester method is intended to receive the simulated system time.

### Claim 2 (depends on 1)

The process of claim 1, wherein analyzing the contents of the call stack further comprises walking the call stack until reaching the requester method that initiated the invocation.

### Claim 3 (depends on 2)

The process of claim 2, wherein walking the call stack further comprises ignoring intermediate methods that did not initiate the invocation.

### Claim 4 (depends on 1)

The process of claim 1, wherein determining which requester method initiated the invocation comprises reading a configuration file listing requester methods that should receive a simulated time.

### Claim 5 (depends on 1)

The process of claim 1, wherein returning the real system time comprises calling an operating system service that returns the real system time.

### Claim 6 (depends on 1)

The process of claim 1, wherein returning the simulated system time comprises calling a time/date simulation application that returns the simulated system time.

### Claim 7 (depends on 1)

The process of claim 1, wherein the requester method is a java requester method.

### Claim 8

An apparatus for providing a simulated date and/or time to a time-sensitive application, the apparatus comprising:
a detection module to detect the invocation of a time handler method, the time handler method configured to retrieve the system time of a computing system;
a capture module to capture the contents of a call stack once the invocation is detected;
a stack analysis module to analyze the contents of the call stack to determine which requestor method initiated the invocation;
the stack analysis module further configured to determine whether the requester method that initiated the invocation should receive one of a real system time and a simulated system time;
a return module configured to return a real system time in the event the requester method should receive the real system time; and
the return module further configured to return a simulated system time in the event the requester method should receive the simulated system time.

### Claim 9 (depends on 8)

The apparatus of claim 8, further comprising a stack walk module to walk the call stack until reaching the requester method that initiated the invocation.

### Claim 10 (depends on 8)

The apparatus of claim 8, wherein the stack analysis module is further configured to ignore intermediate methods that did not initiate the invocation.

### Claim 11 (depends on 8)

The apparatus of claim 8, wherein the stack analysis module is further configured to reference a configuration file listing requester methods that should receive a simulated time.

### Claim 12 (depends on 8)

The apparatus of claim 8, further comprising a call module to call an operating system service that returns the real system time.

### Claim 13 (depends on 8)

The apparatus of claim 8, further comprising a call module to call a time/date simulation application that returns the simulated system time.

### Claim 14 (depends on 8)

The apparatus of claim 8, wherein the requester method is a java requester method.

### Claim 15

A computer program product for providing a simulated date and/or time to a time-sensitive application, the computer program product comprising a computer-usable medium having computer-usable program code embodied therein, the computer-usable program code comprising:
computer-usable program code to detect the invocation of a time handler method, the time handler method configured to retrieve the system time of a computing system;
computer-usable program code to capture the contents of a call stack upon detecting the invocation;
computer-usable program code to analyze the contents of the call stack to determine which requester method initiated the invocation;
computer-usable program code to determine whether the requester method that initiated the invocation should receive one of a real system time and a simulated system time;
computer-usable program code to return a real system time in the event the requester method is intended to receive the real system time; and
computer-usable program code to return a simulated system time in the event the requester method is intended to receive the simulated system time.

### Claim 16 (depends on 15)

The computer program product of claim 15, further comprising computer-usable program code to walk the call stack until reaching the requester method that initiated the invocation.

### Claim 17 (depends on 15)

The computer program product of claim 15, further comprising computer-usable program code to ignore intermediate methods that did not initiate the invocation.

### Claim 18 (depends on 15)

The computer program product of claim 15, further comprising computer-usable program code to read a configuration file listing requestor methods that should receive a simulated time.

### Claim 19 (depends on 15)

The computer program product of claim 15, further comprising computer-usable program code to call an operating system service that returns the real system time.

### Claim 20 (depends on 15)

The computer program product of claim 15, further comprising computer-usable program code to call a time/date simulation application that returns the simulated system time.
