| java.lang.Object com.sun.midp.i3test.TestCase com.sun.midp.content.ExtendedTestCase com.sun.midp.content.TestInvocStore
TestInvocStore | public class TestInvocStore extends ExtendedTestCase (Code) | | Test that InvocationImpl instances with a wide range of values
can be stored in the InvocationStore and retrieved.
The tested functions of Invocation are:
- The settable fields of Invocation can be retrieved and verified.
|
Constructor Summary | |
public | TestInvocStore() Create a new Invocation test case. |
Method Summary | |
void | assertEmpty() Check that there are no Invocations pending;
none should be. | void | fillInvocation(InvocationImpl invoc, String string, String[] args) Fill in the invocation with the next data case. | InvocationImpl[] | genEachStatus() Setup and put an Invocation with each status value
from Invocation.INIT (1) to Invocation.INITIATED (8). | InvocationImpl | newMaxInvocation() Make a new maximum size Invocation. | String[] | nextArgs(String[] args) Generate the next array to test.
The sequence is null, 0, 1, 2, 2, 1, 0; back to null.
Parameters: args - an String array; may be null. | String | nextString(String string) Sequence through the test strings; can start anywhere
but typically start/end with null. | public void | runTests() Run the tests. | void | test001() Verify that each field of an
com.sun.midp.content.InvocationImpl can be set,
put into the store and retrieved and verified. | void | test002() Verify that each field of an
com.sun.midp.content.InvocationImpl can be set,
put into the store and retrieved and verified. | void | test003() Test that for a large number of inserts the order
is maintained when multiple entries have the same ID, classname. | void | test004() Test exhausting the native heap storage with Invocations. | void | test005() Test that the selection based on request/response values works.
Both the
com.sun.midp.content.InvocationStore.get and
com.sun.midp.content.InvocationStore.listen are tested at the same time.
Every status is put into the queue and then the response
status values are retrieved and verified. | void | test006() Test that get requests can be interrupted with the cancel method. | void | test007() Test that get by tid works. | void | test008() Test that setParams can correctly set and reset all
parameters and not result in and not result in any leaks. | void | test009() Test that getByTid handles next, equals, and previous correctly. | void | test010() Stress test using multiple threads to pound on the queue. |
ARGS1 | final static String[] ARGS1(Code) | | First args array; empty.
|
ARGS2 | final static String[] ARGS2(Code) | | First args array; 1 string.
|
ARGS3 | final static String[] ARGS3(Code) | | First args array; longer, 2 strings.
|
ARGS4 | final static String[] ARGS4(Code) | | First args array; different two.
|
ARGS5 | final static String[] ARGS5(Code) | | First args array; shorter, 1 string.
|
ARGS6 | final static String[] ARGS6(Code) | | First args array; empty again.
|
LONG_ARGUMENTS | static String[] LONG_ARGUMENTS(Code) | | Long argument list to test with.
|
LONG_STRING | final static String LONG_STRING(Code) | | A Long string to test against.
|
MAX_ARGUMENTS | final static int MAX_ARGUMENTS(Code) | | Maximum number of ARGUMENTS supported.
|
NUM_APPLICATION_IDS | final static int NUM_APPLICATION_IDS(Code) | | Number of application ids to test in stress test.
|
NUM_CONTENT_HANDLERS | final static int NUM_CONTENT_HANDLERS(Code) | | Number of content handlers per application to stress test.
|
STRING1 | final static String STRING1(Code) | | First test string; empty.
|
STRING2 | final static String STRING2(Code) | | Second test string; short.
|
STRING3 | final static String STRING3(Code) | | Third test string; longer.
|
STRING4 | final static String STRING4(Code) | | Fourth test string; equal length.
|
STRING5 | final static String STRING5(Code) | | Fifth test string; shorter (forced to be different from string2.)
|
STRING6 | final static String STRING6(Code) | | Sixth test string; shorter (forced to be different from string1.)
|
SUITE_ID | final static int SUITE_ID(Code) | | A suite Id to test against.
|
TestInvocStore | public TestInvocStore()(Code) | | Create a new Invocation test case.
|
assertEmpty | void assertEmpty()(Code) | | Check that there are no Invocations pending;
none should be.
|
fillInvocation | void fillInvocation(InvocationImpl invoc, String string, String[] args)(Code) | | Fill in the invocation with the next data case.
The same data is used in every field in the Invocation.
The args are initialized with the string as appropriate.
The data is filled from the string if non-null.
Parameters: invoc - Invocation Parameters: string - to fill into Invocation fields and args and data Parameters: args - a prototype args array to fill |
genEachStatus | InvocationImpl[] genEachStatus()(Code) | | Setup and put an Invocation with each status value
from Invocation.INIT (1) to Invocation.INITIATED (8).
Vector of posted InvocationImpls |
newMaxInvocation | InvocationImpl newMaxInvocation()(Code) | | Make a new maximum size Invocation.
a new InvocationImpl |
nextArgs | String[] nextArgs(String[] args)(Code) | | Generate the next array to test.
The sequence is null, 0, 1, 2, 2, 1, 0; back to null.
Parameters: args - an String array; may be null. the next args array; not filled with anything in particular |
nextString | String nextString(String string)(Code) | | Sequence through the test strings; can start anywhere
but typically start/end with null.
Parameters: string - the current string in the sequence the nextt string in the sequence |
runTests | public void runTests()(Code) | | Run the tests.
|
test001 | void test001()(Code) | | Verify that each field of an
com.sun.midp.content.InvocationImpl can be set,
put into the store and retrieved and verified.
The only test is if the field is saved and restored
correctly for values of null and non-null .
|
test002 | void test002()(Code) | | Verify that each field of an
com.sun.midp.content.InvocationImpl can be set,
put into the store and retrieved and verified.
The only test is if the field is saved and restored
correctly for values of null and non-null .
|
test003 | void test003()(Code) | | Test that for a large number of inserts the order
is maintained when multiple entries have the same ID, classname.
A dataset is generated with only the TID differing.
The verification fetches them and verifies the order.
|
test004 | void test004()(Code) | | Test exhausting the native heap storage with Invocations.
Max size invocations are created, saved and put in the Invocation
store until put throws OutOfMemoryError.
All of the Invocations are read back and compared.
|
test006 | void test006()(Code) | | Test that get requests can be interrupted with the cancel method.
Check that cancel doesn't corrupt the queue or loose requests.
drain(); cancel(); get(); cancel(); put(); get(); cancel();
|
test007 | void test007()(Code) | | Test that get by tid works.
An instance of each status is created and then they are
fetched by tid.
|
test008 | void test008()(Code) | | Test that setParams can correctly set and reset all
parameters and not result in and not result in any leaks.
An invocation is put into the store and then a series of
setParams calls are used to modify the parameters.
After each modification the request is retrieved and
compared with the expected modified request.
|
test009 | void test009()(Code) | | Test that getByTid handles next, equals, and previous correctly.
|
test010 | void test010()(Code) | | Stress test using multiple threads to pound on the queue.
Each thread performs a series of gets and puts with
pseudo random choices of target id, classname, and status
|
Methods inherited from com.sun.midp.i3test.TestCase | public void assertEquals(Object expected, Object actual)(Code)(Java Doc) public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) public void assertEquals(int expected, int actual)(Code)(Java Doc) public void assertEquals(String message, int expected, int actual)(Code)(Java Doc) public void assertFalse(boolean condition)(Code)(Java Doc) public void assertFalse(String message, boolean condition)(Code)(Java Doc) public void assertNotNull(Object object)(Code)(Java Doc) public void assertNotNull(String message, Object object)(Code)(Java Doc) public void assertNotSame(Object expected, Object actual)(Code)(Java Doc) public void assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertNull(Object object)(Code)(Java Doc) public void assertNull(String message, Object object)(Code)(Java Doc) public void assertSame(Object expected, Object actual)(Code)(Java Doc) public void assertSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertTrue(String message, boolean condition)(Code)(Java Doc) public void assertTrue(boolean condition)(Code)(Java Doc) public void declare(String testName)(Code)(Java Doc) public void fail()(Code)(Java Doc) public void fail(String message)(Code)(Java Doc) protected SecurityToken getSecurityToken()(Code)(Java Doc) protected boolean getVerbose()(Code)(Java Doc) public void info(String s)(Code)(Java Doc) abstract public void runTests() throws Throwable(Code)(Java Doc)
|
|
|