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