|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jwalk.test.StackProxy
public class StackProxy
StackProxy is a proxy for a fixed-length, bounded push-down Stack.
This is a standard test class, provided with the JWalk tool suite.
The StackProxy has no local state, but forwards all requests to another
Stack, linked by reference. Method interactions cannot change the local
state of the StackProxy, which appears constant. However, changing the
depth to which object states are compared may alter this.
This test class can be used to demonstrate the ability of an AlgebraWalker
to discover the algebraic structure of a data type, whose state is held
at one remove from the tested object. In the standard configuration of
the JWalkTester tool, all paths are pruned after test cycle 1, because no
state-changes are observed. By setting the custom configuration parameter
"state depth" to a value greater than zero, the walker is able to grow paths
past test cycle 1.
This test class can also be used to demonstrate the ability of a
StateSpaceWalker to discover the high-level states of a data type, whose
concrete state is held at one remove from the tested object. In the
standard configuration, the JWalkTester tool will report failure to find
all the expected states (paths are pruned, if they cause no state change).
By setting the custom configuration parameter "state depth" to a value
greater than zero, the walker is able to identify state changes at one
remove, and so discover all expected high-level states.
Constructor Summary | |
---|---|
StackProxy()
Creates a StackProxy whose remote Stack has the capacity for five elements. |
Method Summary | |
---|---|
boolean |
isEmpty()
Reports if this StackProxy is empty. |
boolean |
isFull()
Reports if this StackProxy is full. |
void |
pop()
Pops an object off this StackProxy. |
void |
push(java.lang.Object item)
Pushes an object onto this StackProxy. |
int |
size()
Reports the dynamic size of this StackProxy. |
java.lang.Object |
top()
Returns the top object on this StackProxy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackProxy()
Method Detail |
---|
public void push(java.lang.Object item)
item
- an object.
java.lang.ArrayIndexOutOfBoundsException
- if the remote Stack is full.public void pop()
EmptyStackException,
- if the remote Stack is empty.public java.lang.Object top()
EmptyStackException,
- if the remote Stack is empty.public int size()
public boolean isEmpty()
public boolean isFull()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |