Assertion component in environment services patterns
First Claim
1. A method for testing successfulness of an operation having pre-conditions and post-conditions that must be satisfied for an operation to be successful, comprising the steps of:
- (a) providing two types of assertion classes, wherein one of the assertion classes implements assertion-checking logic and the other assertion class implements only null operations, wherein one of the assertion classes is selected to be raised;
(b) raising a first assertion asserting a pre-condition that must evaluate to true if the operation is successful;
(c) executing the operation;
(d) raising a second assertion asserting a post-condition that must evaluate to true if the operation is successful; and
(e) outputting an error message upon failure of at least one of the assertions, where the at least one assertion implements assertion-checking logic.
4 Assignments
0 Petitions
Accused Products
Abstract
A system and method are provided for testing successfulness of an operation having pre-conditions and post-conditions that must be satisfied for the operation to be successful. Two types of assertion classes are provided, where one of the of the assertion classes implements assertion-checking logic and the other assertion class implements only null operations, and one of the assertion classes is selected to be raised. A first assertion is raised asserting a pre-condition that must evaluate to true if the operation is successful. The operation is then executed. A second assertion is raised asserting a post-condition that must evaluate to true if the operation is successful. An error message is outputted upon failure of at least one of the assertions, where the failed assertion implements assertion-checking logic.
545 Citations
15 Claims
-
1. A method for testing successfulness of an operation having pre-conditions and post-conditions that must be satisfied for an operation to be successful, comprising the steps of:
-
(a) providing two types of assertion classes, wherein one of the assertion classes implements assertion-checking logic and the other assertion class implements only null operations, wherein one of the assertion classes is selected to be raised;
(b) raising a first assertion asserting a pre-condition that must evaluate to true if the operation is successful;
(c) executing the operation;
(d) raising a second assertion asserting a post-condition that must evaluate to true if the operation is successful; and
(e) outputting an error message upon failure of at least one of the assertions, where the at least one assertion implements assertion-checking logic. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer program embodied on a computer readable medium for testing successfulness of an operation having pre-conditions and post-conditions that must be satisfied for the operation to be successful, comprising:
-
(a) a code segment that provides two types of assertion classes, wherein one of the assertion classes implements assertion-checking logic and the other assertion class implements only null operations, wherein one of the assertion classes is selected to be raised;
(b) a code segment that raises a first assertion asserting a pre-condition that must evaluate to true if the operation is successful;
(c) a code segment that executes the operation;
(d) a code segment that raises a second assertion asserting a post-condition that must evaluate to true if the operation is successful; and
(e) a code segment that outputs an error message upon failure of at least one of the assertions, where the at least one assertion implements assertion-checking logic. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A system for testing successfulness of an operation having pre-conditions and post-conditions that must be satisfied for the operation to be successful, comprising:
-
(a) logic that provides two types of assertion classes, wherein one of the assertion classes implements assertion-checking logic and the other assertion class implements only null operations, wherein one of the assertion classes is selected to be raised;
(b) logic that raises a first assertion asserting a pre-condition that must evaluate to true if the operation is successful;
(c) logic that executes the operation;
(d) logic that raises a second assertion asserting a post-condition that must evaluate to true if the operation is successful; and
(e) logic that outputs an error message upon failure of at least one of the assertions, where the at least one assertion implements assertion-checking logic. - View Dependent Claims (12, 13, 14, 15)
-
Specification