Java Doc for ThreadTest.java in  » Apache-Harmony-Java-SE » java-package » java » lang » 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 » Apache Harmony Java SE » java package » java.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.ThreadTest

ThreadTest
public class ThreadTest extends TestCase (Code)
This class provides an implementation of J2SE v. 1.5 API Specification of unit.java.lang.ThreadTest class.

Inner Class :static class ThreadRunning extends Thread
Inner Class :class Square implements Runnable
Inner Class :class ExceptionHandler implements Thread.UncaughtExceptionHandler

Field Summary
final static  intCOUNT
    
volatile  intbase
    


Method Summary
public  voidtestActiveCount()
    
public  voidtestCheckAccess()
    
public  voidtestCurrentThread()
    
public  voidtestCurrentThread_Main()
    
public  voidtestDestroy()
    
public  voidtestEnumerate()
    
public  voidtestGetAllStackTraces()
    
public  voidtestGetContextClassLoader()
    
public  voidtestGetContextClassLoader_Main()
    
public  voidtestGetIdUnchanged()
    
public  voidtestGetIdUnique()
    
public  voidtestGetName()
     Verify the getName() method for a thread created with the given name.
public  voidtestGetNameDefault()
     Verify the getName() method for a thread created with the default name.
public  voidtestGetPriority()
     Verify the getPriority() method for a newly created thread.
public  voidtestGetStackTrace()
     Get the stack trace of a thread.
public  voidtestGetStateBlocked()
     Get the state of a blocked thread.
public  voidtestGetStateNew()
     Get the state of a new thread.
public  voidtestGetStateNew1()
     Get the state of a new thread.
public  voidtestGetStateRunnable()
     Get the state of a runnable thread.
public  voidtestGetStateRunnable1()
     Get the state of a runnable thread.
public  voidtestGetStateTerminated()
     Get the state of a terminated thread.
public  voidtestGetStateTerminated1()
     Get the state of a terminated thread.
public  voidtestGetStateTimedWaiting()
     Get the state of a timed waiting thread.
public  voidtestGetStateWaiting()
     Get the state of a waiting thread.
public  voidtestGetThreadGroup()
     Get the thread group of a thread created in the current thread's thread group.
public  voidtestGetThreadGroup1()
     Get the thread group of a thread created in the specified thread group.
public  voidtestGetThreadGroup_DeadThread()
     Get the thread group of a dead thread.
public  voidtestGetUncaughtExceptionHandler()
    
public  voidtestGetUncaughtExceptionHandler_Null()
    
public  voidtestHoldsLock_False()
    
public  voidtestHoldsLock_Null()
    
public  voidtestHoldsLock_True()
    
public  voidtestInterrupt_CurrentThread()
    
public  voidtestInterrupt_Joining()
    
public  voidtestInterrupt_New()
    
public  voidtestInterrupt_RunningThread()
    
public  voidtestInterrupt_Sleeping()
    
public  voidtestInterrupt_Staging()
     Check that interrupt and notify happen exactly once for each notify() and interrupt() call.
public  voidtestInterrupt_Terminated()
    
public  voidtestInterrupt_Waiting()
    
public  voidtestInterrupted()
    
public  voidtestIsAlive()
    
public  voidtestIsAlive1()
    
public  voidtestIsAlive2()
    
public  voidtestIsAliveCurrent()
    
public  voidtestIsDaemonFalse()
    
public  voidtestIsDaemonTrue()
    
public  voidtestIsInterrupted()
    
public  voidtestJoinlong()
    
public  voidtestJoinlongint()
    
public  voidtestRun()
     Test for run().
public  voidtestRun_Runnable()
     Test for run().
public  voidtestSetContextClassLoader()
    
public  voidtestSetDaemon()
    
public  voidtestSetDaemonDeadThread()
    
public  voidtestSetDaemonLiveThread()
    
public  voidtestSetDefaultUncaughtExceptionHandler()
    
public  voidtestSetDefaultUncaughtExceptionHandler_Null()
    
public  voidtestSetName()
    
public  voidtestSetNameNull()
    
public  voidtestSetName_CheckAccess()
     Verify the setName() method when a SecurityManager is set.
public  voidtestSetPriorityDeadThread()
     Verify the setPriority() method to a dead thread.
public  voidtestSetPriorityGreaterMax()
     Verify the setPriority() method with new priority higher than the maximum permitted priority for the thread's group.
public  voidtestSetPriorityLower()
     Verify the setPriority() method with new priority lower than the current one.
public  voidtestSetPriorityOutOfRange()
     Verify the setPriority() method with new priority out of the legal range.
public  voidtestSetPriority_CheckAccess()
     Verify the setPriority() method when a SecurityManager is set.
public  voidtestSetUncaughtExceptionHandler()
    
public  voidtestSetUncaughtExceptionHandler_Null()
    
public  voidtestSleeplong()
    
public  voidtestSleeplongint()
    
public  voidtestStart_Finished()
    
public  voidtestStart_Started()
    
public  voidtestThread()
    
public  voidtestThreadRunnable()
    
public  voidtestThreadRunnableString()
    
public  voidtestThreadRunnableString_NullNotNull()
    
public  voidtestThreadString()
    
public  voidtestThreadStringNull()
     Verify creating a thread with the null name.
public  voidtestThreadThreadGroupRunnable()
    
public  voidtestThreadThreadGroupRunnableString()
    
public  voidtestThreadThreadGroupRunnableString_NullNotNullNotNull()
    
public  voidtestThreadThreadGroupRunnableString_NullNullNotNull()
    
public  voidtestThreadThreadGroupRunnableString_NullNullNull()
    
public  voidtestThreadThreadGroupRunnableStringlong()
    
public  voidtestThreadThreadGroupRunnableStringlong_Long_MAX_VALUE()
    
public  voidtestThreadThreadGroupRunnable_NullNull()
    
public  voidtestThreadThreadGroupString()
    
public  voidtestThread_Daemon()
    
public  voidtestThread_NotDaemon()
    
public  voidtestToString()
     Verify that the toString() method displays the thread's name, priority and thread group.
public  voidtestYield()
    

Field Detail
COUNT
final static int COUNT(Code)



base
volatile int base(Code)





Method Detail
testActiveCount
public void testActiveCount()(Code)
Get active threads count; should be > 0



testCheckAccess
public void testCheckAccess()(Code)
Test for checkAccess when there is a SecurityManager



testCurrentThread
public void testCurrentThread()(Code)
Verify currentThread()



testCurrentThread_Main
public void testCurrentThread_Main()(Code)
Verify currentThread()



testDestroy
public void testDestroy()(Code)



testEnumerate
public void testEnumerate()(Code)



testGetAllStackTraces
public void testGetAllStackTraces()(Code)
Verify getAllStackTraces()



testGetContextClassLoader
public void testGetContextClassLoader()(Code)
Get context ClassLoader of a newly created thread



testGetContextClassLoader_Main
public void testGetContextClassLoader_Main()(Code)
Get context ClassLoader of main thread



testGetIdUnchanged
public void testGetIdUnchanged()(Code)
Check that ID of a thread does not change



testGetIdUnique
public void testGetIdUnique()(Code)
Check that IDs of different threads differ



testGetName
public void testGetName()(Code)
Verify the getName() method for a thread created with the given name.



testGetNameDefault
public void testGetNameDefault()(Code)
Verify the getName() method for a thread created with the default name. It should start with "Thread-".



testGetPriority
public void testGetPriority()(Code)
Verify the getPriority() method for a newly created thread.



testGetStackTrace
public void testGetStackTrace()(Code)
Get the stack trace of a thread. Should be empty for new and terminated threads. Should not be empty for running threads.



testGetStateBlocked
public void testGetStateBlocked()(Code)
Get the state of a blocked thread.



testGetStateNew
public void testGetStateNew()(Code)
Get the state of a new thread.



testGetStateNew1
public void testGetStateNew1()(Code)
Get the state of a new thread.



testGetStateRunnable
public void testGetStateRunnable()(Code)
Get the state of a runnable thread.



testGetStateRunnable1
public void testGetStateRunnable1()(Code)
Get the state of a runnable thread.



testGetStateTerminated
public void testGetStateTerminated()(Code)
Get the state of a terminated thread.



testGetStateTerminated1
public void testGetStateTerminated1()(Code)
Get the state of a terminated thread.



testGetStateTimedWaiting
public void testGetStateTimedWaiting()(Code)
Get the state of a timed waiting thread.



testGetStateWaiting
public void testGetStateWaiting()(Code)
Get the state of a waiting thread.



testGetThreadGroup
public void testGetThreadGroup()(Code)
Get the thread group of a thread created in the current thread's thread group.



testGetThreadGroup1
public void testGetThreadGroup1()(Code)
Get the thread group of a thread created in the specified thread group.



testGetThreadGroup_DeadThread
public void testGetThreadGroup_DeadThread()(Code)
Get the thread group of a dead thread.



testGetUncaughtExceptionHandler
public void testGetUncaughtExceptionHandler()(Code)
Test for getUncaughtExceptionHandler()



testGetUncaughtExceptionHandler_Null
public void testGetUncaughtExceptionHandler_Null()(Code)
Test getUncaughtExceptionHandler() for a terminated thread



testHoldsLock_False
public void testHoldsLock_False()(Code)
Test for holdsLock(Object obj)



testHoldsLock_Null
public void testHoldsLock_Null()(Code)
Test for holdsLock(null)



testHoldsLock_True
public void testHoldsLock_True()(Code)
Test for holdsLock(Object obj)



testInterrupt_CurrentThread
public void testInterrupt_CurrentThread()(Code)
Interrupt the current thread



testInterrupt_Joining
public void testInterrupt_Joining()(Code)
Interrupt a joining thread



testInterrupt_New
public void testInterrupt_New()(Code)
Interrupt a newly created thread



testInterrupt_RunningThread
public void testInterrupt_RunningThread()(Code)
Interrupt a running thread



testInterrupt_Sleeping
public void testInterrupt_Sleeping()(Code)
Interrupt a sleeping thread



testInterrupt_Staging
public void testInterrupt_Staging()(Code)
Check that interrupt and notify happen exactly once for each notify() and interrupt() call.



testInterrupt_Terminated
public void testInterrupt_Terminated()(Code)
Interrupt a terminated thread



testInterrupt_Waiting
public void testInterrupt_Waiting()(Code)
Interrupt a waiting thread



testInterrupted
public void testInterrupted()(Code)
Verify that interrupt status is cleared by the interrupted()



testIsAlive
public void testIsAlive()(Code)
Verify that a thread is alive just after start



testIsAlive1
public void testIsAlive1()(Code)
Verify the isAlive() method for a newly created, running and finished thread



testIsAlive2
public void testIsAlive2()(Code)
Verify the isAlive() method for a few threads



testIsAliveCurrent
public void testIsAliveCurrent()(Code)
Verify that the current thread is alive



testIsDaemonFalse
public void testIsDaemonFalse()(Code)



testIsDaemonTrue
public void testIsDaemonTrue()(Code)



testIsInterrupted
public void testIsInterrupted()(Code)
Check that interrupt status is not affected by isInterrupted()



testJoinlong
public void testJoinlong()(Code)
Test for void join(long)



testJoinlongint
public void testJoinlongint()(Code)
Test for void join(long, int)



testRun
public void testRun()(Code)
Test for run(). Should do nothing.



testRun_Runnable
public void testRun_Runnable()(Code)
Test for run(). Should call run() of a Runnable object.



testSetContextClassLoader
public void testSetContextClassLoader()(Code)



testSetDaemon
public void testSetDaemon()(Code)
Make a thread daemon



testSetDaemonDeadThread
public void testSetDaemonDeadThread()(Code)
Make a dead thread daemon



testSetDaemonLiveThread
public void testSetDaemonLiveThread()(Code)
Try to make a running thread daemon



testSetDefaultUncaughtExceptionHandler
public void testSetDefaultUncaughtExceptionHandler()(Code)
Test set/get DefaultUncaughtExceptionHandler()



testSetDefaultUncaughtExceptionHandler_Null
public void testSetDefaultUncaughtExceptionHandler_Null()(Code)
Test set/get DefaultUncaughtExceptionHandler(null)



testSetName
public void testSetName()(Code)
Verify the setName() method



testSetNameNull
public void testSetNameNull()(Code)
Verify the setName(null) method



testSetName_CheckAccess
public void testSetName_CheckAccess()(Code)
Verify the setName() method when a SecurityManager is set.



testSetPriorityDeadThread
public void testSetPriorityDeadThread()(Code)
Verify the setPriority() method to a dead thread. NullPointerException is expected



testSetPriorityGreaterMax
public void testSetPriorityGreaterMax()(Code)
Verify the setPriority() method with new priority higher than the maximum permitted priority for the thread's group.



testSetPriorityLower
public void testSetPriorityLower()(Code)
Verify the setPriority() method with new priority lower than the current one.



testSetPriorityOutOfRange
public void testSetPriorityOutOfRange()(Code)
Verify the setPriority() method with new priority out of the legal range.



testSetPriority_CheckAccess
public void testSetPriority_CheckAccess()(Code)
Verify the setPriority() method when a SecurityManager is set.



testSetUncaughtExceptionHandler
public void testSetUncaughtExceptionHandler()(Code)
Test for setUncaughtExceptionHandler()



testSetUncaughtExceptionHandler_Null
public void testSetUncaughtExceptionHandler_Null()(Code)
Test for setUncaughtExceptionHandler(null)



testSleeplong
public void testSleeplong()(Code)
Test for void sleep(long)



testSleeplongint
public void testSleeplongint()(Code)
Test for void sleep(long, int)



testStart_Finished
public void testStart_Finished()(Code)
Start the already finished thread



testStart_Started
public void testStart_Started()(Code)
Start the already started thread



testThread
public void testThread()(Code)
Thread()



testThreadRunnable
public void testThreadRunnable()(Code)
Thread(Runnable)



testThreadRunnableString
public void testThreadRunnableString()(Code)
Thread(Runnable, String)



testThreadRunnableString_NullNotNull
public void testThreadRunnableString_NullNotNull()(Code)
Thread(Runnable, String)



testThreadString
public void testThreadString()(Code)
Thread(String)



testThreadStringNull
public void testThreadStringNull()(Code)
Verify creating a thread with the null name. NullPointerException should be thrown.



testThreadThreadGroupRunnable
public void testThreadThreadGroupRunnable()(Code)
Thread(ThreadGroup, Runnable)



testThreadThreadGroupRunnableString
public void testThreadThreadGroupRunnableString()(Code)
Thread(ThreadGroup, Runnable, String)



testThreadThreadGroupRunnableString_NullNotNullNotNull
public void testThreadThreadGroupRunnableString_NullNotNullNotNull()(Code)
Thread(ThreadGroup, Runnable, String) where ThreadGroup is null



testThreadThreadGroupRunnableString_NullNullNotNull
public void testThreadThreadGroupRunnableString_NullNullNotNull()(Code)
Thread(ThreadGroup, Runnable, String) where both ThreadGroup and Runnable are null



testThreadThreadGroupRunnableString_NullNullNull
public void testThreadThreadGroupRunnableString_NullNullNull()(Code)
Thread(ThreadGroup, Runnable, String) where all arguments are null



testThreadThreadGroupRunnableStringlong
public void testThreadThreadGroupRunnableStringlong()(Code)
Thread(ThreadGroup, Runnable, String, long)



testThreadThreadGroupRunnableStringlong_Long_MAX_VALUE
public void testThreadThreadGroupRunnableStringlong_Long_MAX_VALUE()(Code)
Thread(ThreadGroup, Runnable, String, long)



testThreadThreadGroupRunnable_NullNull
public void testThreadThreadGroupRunnable_NullNull()(Code)
Thread(ThreadGroup, Runnable) where both arguments are null



testThreadThreadGroupString
public void testThreadThreadGroupString()(Code)
Thread(ThreadGroup, String)



testThread_Daemon
public void testThread_Daemon()(Code)
Verify that a thread created by a daemon thread is daemon



testThread_NotDaemon
public void testThread_NotDaemon()(Code)
Verify that a thread created by a non-daemon thread is not daemon



testToString
public void testToString()(Code)
Verify that the toString() method displays the thread's name, priority and thread group.



testYield
public void testYield()(Code)
Test for void yield()



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