The class T3
extends T1
class.
More...
Public Member Functions | |
T3 (JPWorld component, float sleepIntervalSec, float initialDelaySec) | |
Creates a new instance of T3. | |
void | run () |
Test procedure for T1 and T2 classes running in separate thread. | |
Private Attributes | |
String | signature = "T3: Thread 3" |
float | initialDelaySec = 0f |
The class T3
extends T1
class.
It is a test wrapper for T1
and T2
classes according to the following specification:
1. Create and start thread from class T1 2. Wait 5 seconds 3. Create and start thread from class T2 4. Wait 5 seconds 5. Pause thread from class T2 6. Wait 5 seconds 7. Activate thread from class T2 8. Wait 5 seconds 9. Kill thread from class T1 10. Wait 5 seconds 11. Kill thread from class T2
Definition at line 22 of file T3.java.
T3.T3 | ( | JPWorld | component, |
float | sleepIntervalSec, | ||
float | initialDelaySec | ||
) |
Creates a new instance of T3.
Definition at line 31 of file T3.java.
References initialDelaySec.
{ super( component, sleepIntervalSec ); this.initialDelaySec = initialDelaySec; }
void T3.run | ( | ) |
Test procedure for T1 and T2 classes running in separate thread.
Reimplemented from T1.
Definition at line 41 of file T3.java.
References JPWorld.afterTestsCompleted(), JPWorld.clearLogArea(), T2.disableThread(), T2.enableThread(), initialDelaySec, T1.interruptibleSleep(), T1.parent, JPWorld.println(), signature, T1.start(), T2.startThread(), T2.stopThread(), T1.stopThread(), and T1.T1().
{ interruptibleSleep( (int)( initialDelaySec * 1000f ) ); parent.clearLogArea (); // clear log area first parent.println( signature + ": Running..." ); interruptibleSleep( 1000 ); parent.println( "------ Creating T1" ); T1 t1 = new T1( parent, 1.0f ); parent.println( "------ Starting T1" ); t1.start (); interruptibleSleep( 5000 ); parent.println( "------ Creating T2" ); T2 t2 = new T2( parent, 1.0f ); parent.println( "------ Starting T2" ); t2.startThread (); interruptibleSleep( 5000 ); parent.println( "------ Disabling T2" ); t2.disableThread (); interruptibleSleep( 5000 ); parent.println( "------ Enabling T2" ); t2.enableThread (); interruptibleSleep( 5000 ); parent.println( "------ Killing T1" ); t1.stopThread (); interruptibleSleep( 5000 ); parent.println( "------ Killing T2" ); t2.stopThread (); parent.println( signature + ": Done." ); parent.afterTestsCompleted (); }
float T3.initialDelaySec = 0f [private] |
String T3.signature = "T3: Thread 3" [private] |