Java Doc for TestInvocStore.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » content » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.midp.content 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
final static  String[]ARGS1
     First args array; empty.
final static  String[]ARGS2
     First args array; 1 string.
final static  String[]ARGS3
     First args array; longer, 2 strings.
final static  String[]ARGS4
     First args array; different two.
final static  String[]ARGS5
     First args array; shorter, 1 string.
final static  String[]ARGS6
     First args array; empty again.
static  String[]LONG_ARGUMENTS
     Long argument list to test with.
final static  StringLONG_STRING
     A Long string to test against.
final static  intMAX_ARGUMENTS
     Maximum number of ARGUMENTS supported.
final static  intNUM_APPLICATION_IDS
     Number of application ids to test in stress test.
final static  intNUM_CONTENT_HANDLERS
     Number of content handlers per application to stress test.
final static  StringSTRING1
     First test string; empty.
final static  StringSTRING2
     Second test string; short.
final static  StringSTRING3
     Third test string; longer.
final static  StringSTRING4
     Fourth test string; equal length.
final static  StringSTRING5
    
final static  StringSTRING6
    
final static  intSUITE_ID
     A suite Id to test against.
 AppProxyappl
     The application.

Constructor Summary
public  TestInvocStore()
     Create a new Invocation test case.

Method Summary
 voidassertEmpty()
     Check that there are no Invocations pending; none should be.
 voidfillInvocation(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).
 InvocationImplnewMaxInvocation()
     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.
 StringnextString(String string)
     Sequence through the test strings; can start anywhere but typically start/end with null.
public  voidrunTests()
     Run the tests.
 voidtest001()
     Verify that each field of an com.sun.midp.content.InvocationImpl can be set, put into the store and retrieved and verified.
 voidtest002()
     Verify that each field of an com.sun.midp.content.InvocationImpl can be set, put into the store and retrieved and verified.
 voidtest003()
     Test that for a large number of inserts the order is maintained when multiple entries have the same ID, classname.
 voidtest004()
     Test exhausting the native heap storage with Invocations.
 voidtest005()
     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.
 voidtest006()
     Test that get requests can be interrupted with the cancel method.
 voidtest007()
     Test that get by tid works.
 voidtest008()
     Test that setParams can correctly set and reset all parameters and not result in and not result in any leaks.
 voidtest009()
     Test that getByTid handles next, equals, and previous correctly.
 voidtest010()
     Stress test using multiple threads to pound on the queue.

Field Detail
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.



appl
AppProxy appl(Code)
The application.




Constructor Detail
TestInvocStore
public TestInvocStore()(Code)
Create a new Invocation test case.




Method Detail
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.



test005
void test005()(Code)
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. Then the active status value is verified. Each test expects the results to come back in a particular order and verifies it.



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



Fields inherited from com.sun.midp.content.ExtendedTestCase
String classname(Code)(Java Doc)

Methods inherited from com.sun.midp.content.ExtendedTestCase
public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc)
public void assertEquals(String msg, InvocationImpl expected, InvocationImpl actual)(Code)(Java Doc)
public void assertEquals(String msg, String[] s1, String[] s2)(Code)(Java Doc)
public void assertEquals(String msg, byte[] expected, byte[] actual)(Code)(Java Doc)
RegistryImpl getRegistry()(Code)(Java Doc)
public static void sleep(long millis)(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.