| Line 219... |
Line 219... |
| 219 |
* exits the while forever loop
|
219 |
* exits the while forever loop
|
| 220 |
* - ReleaseManager::queryReleaseConfig, queryRunLevelSchedule, queryDirectedRunLevel methods return true
|
220 |
* - ReleaseManager::queryReleaseConfig, queryRunLevelSchedule, queryDirectedRunLevel methods return true
|
| 221 |
* - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
|
221 |
* - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
|
| 222 |
* 3 calls run on the MasterThread object
|
222 |
* 3 calls run on the MasterThread object
|
| 223 |
* 4 checks the first persisted run level is DB_IDLE
|
223 |
* 4 checks the first persisted run level is DB_IDLE
|
| - |
|
224 |
* 5 checks the second persisted run level is DB_IDLE
|
| 224 |
* 5 checks the third persisted run level is DB_WAITING
|
225 |
* 6 checks the third persisted run level is DB_WAITING
|
| 225 |
* 6 checks no further run levels were persisted
|
226 |
* 7 checks no further run levels were persisted
|
| 226 |
*/
|
227 |
*/
|
| 227 |
@Test
|
228 |
@Test
|
| 228 |
public void TestAllowedToProceed()
|
229 |
public void TestAllowedToProceed()
|
| 229 |
{
|
230 |
{
|
| 230 |
mLogger.debug("TestAllowedToProceed");
|
231 |
mLogger.debug("TestAllowedToProceed");
|
| Line 232... |
Line 233... |
| 232 |
MasterThread masterThread = new MasterThread(1, 1, "unit test allowed to proceed");
|
233 |
MasterThread masterThread = new MasterThread(1, 1, "unit test allowed to proceed");
|
| 233 |
masterThread.run();
|
234 |
masterThread.run();
|
| 234 |
Integer persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 0 );
|
235 |
Integer persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 0 );
|
| 235 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
236 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
| 236 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 1 );
|
237 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 1 );
|
| - |
|
238 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
| - |
|
239 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 2 );
|
| 237 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_WAITING );
|
240 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_WAITING );
|
| 238 |
boolean caughtOOB = false;
|
241 |
boolean caughtOOB = false;
|
| 239 |
|
242 |
|
| 240 |
try
|
243 |
try
|
| 241 |
{
|
244 |
{
|
| Line 259... |
Line 262... |
| 259 |
* - ReleaseManager::queryReleaseConfig method returns true
|
262 |
* - ReleaseManager::queryReleaseConfig method returns true
|
| 260 |
* - ReleaseManager::queryRunLevelSchedule method returns false
|
263 |
* - ReleaseManager::queryRunLevelSchedule method returns false
|
| 261 |
* - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
|
264 |
* - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
|
| 262 |
* 3 calls run on the MasterThread object
|
265 |
* 3 calls run on the MasterThread object
|
| 263 |
* 4 checks the first persisted run level is DB_IDLE
|
266 |
* 4 checks the first persisted run level is DB_IDLE
|
| - |
|
267 |
* 5 checks the second persisted run level is DB_IDLE
|
| 264 |
* 5 checks the third persisted run level is DB_PAUSED
|
268 |
* 6 checks the third persisted run level is DB_PAUSED
|
| 265 |
* 6 checks no further run levels were persisted
|
269 |
* 7 checks no further run levels were persisted
|
| 266 |
* nb cannot check only one thread is running,
|
270 |
* nb cannot check only one thread is running,
|
| 267 |
* a Timer thread, though having run to completion, may still be "active"
|
271 |
* a Timer thread, though having run to completion, may still be "active"
|
| 268 |
*/
|
272 |
*/
|
| 269 |
@Test
|
273 |
@Test
|
| 270 |
public void TestNotAllowedToProceed()
|
274 |
public void TestNotAllowedToProceed()
|
| Line 274... |
Line 278... |
| 274 |
MasterThread masterThread = new MasterThread(1, 1, "unit test not allowed to proceed");
|
278 |
MasterThread masterThread = new MasterThread(1, 1, "unit test not allowed to proceed");
|
| 275 |
masterThread.run();
|
279 |
masterThread.run();
|
| 276 |
Integer persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 0 );
|
280 |
Integer persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 0 );
|
| 277 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
281 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
| 278 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 1 );
|
282 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 1 );
|
| - |
|
283 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_IDLE );
|
| - |
|
284 |
persistedRunLevel = (Integer)ReleaseManager.mPersistedRunLevelCollection.get( 2 );
|
| 279 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_PAUSED );
|
285 |
assertTrue( persistedRunLevel.intValue() == ReleaseManager.DB_PAUSED );
|
| 280 |
boolean caughtOOB = false;
|
286 |
boolean caughtOOB = false;
|
| 281 |
|
287 |
|
| 282 |
try
|
288 |
try
|
| 283 |
{
|
289 |
{
|