@@ -168,8 +168,8 @@ public void testApplicationLifetimeMonitor(Class schedulerParameter)
168168          rm .sendAMLaunched (app1 .getCurrentAppAttempt ().getAppAttemptId ());
169169      am1 .registerAppAttempt ();
170170      rm .waitForState (app1 .getApplicationId (), RMAppState .KILLED );
171-       assertTrue (
172-          ( System . currentTimeMillis () -  app1 . getSubmitTime ()) >  10000 ,  "Application killed before lifetime value" );
171+       assertTrue (( System . currentTimeMillis () -  app1 . getSubmitTime ()) >  10000 , 
172+           "Application killed before lifetime value" );
173173
174174      Map <ApplicationTimeoutType , String > updateTimeout  =
175175          new  HashMap <ApplicationTimeoutType , String >();
@@ -197,8 +197,8 @@ public void testApplicationLifetimeMonitor(Class schedulerParameter)
197197      long  afterUpdate  =
198198          applicationTimeouts .get (ApplicationTimeoutType .LIFETIME );
199199
200-       assertTrue (
201-          afterUpdate  >  beforeUpdate ,  "Application lifetime value not updated" );
200+       assertTrue (afterUpdate  >  beforeUpdate , 
201+           "Application lifetime value not updated" );
202202
203203      // verify for application report. 
204204      RecordFactory  recordFactory  =
@@ -209,17 +209,16 @@ public void testApplicationLifetimeMonitor(Class schedulerParameter)
209209      Map <ApplicationTimeoutType , ApplicationTimeout > appTimeouts  = rm 
210210          .getRMContext ().getClientRMService ().getApplicationReport (appRequest )
211211          .getApplicationReport ().getApplicationTimeouts ();
212-       assertTrue (
213-          !appTimeouts .isEmpty (), "Application Timeout are empty." );
212+       assertTrue (!appTimeouts .isEmpty (), "Application Timeout are empty." );
214213      ApplicationTimeout  timeout  =
215214          appTimeouts .get (ApplicationTimeoutType .LIFETIME );
216-       assertTrue (
217-          timeout . getRemainingTime () >  0 ,  "Application remaining time is incorrect" );
215+       assertTrue (timeout . getRemainingTime () >  0 , 
216+           "Application remaining time is incorrect" );
218217
219218      rm .waitForState (app2 .getApplicationId (), RMAppState .KILLED );
220219      // verify for app killed with updated lifetime 
221-       assertTrue (
222-          app2 . getFinishTime () >  afterUpdate ,  "Application killed before lifetime value" );
220+       assertTrue (app2 . getFinishTime () >  afterUpdate , 
221+           "Application killed before lifetime value" );
223222
224223      if  (scheduler .equals (CapacityScheduler .class )) {
225224        // Supported only on capacity scheduler 
@@ -229,11 +228,10 @@ public void testApplicationLifetimeMonitor(Class schedulerParameter)
229228        // so killed after queue max lifetime. 
230229        rm .waitForState (app4 .getApplicationId (), RMAppState .KILLED );
231230        long  totalTimeRun  = app4 .getFinishTime () - app4 .getSubmitTime ();
232-         assertTrue (
233-            totalTimeRun  > (maxLifetime  * 1000 ), "Application killed before lifetime value" );
234-         assertTrue (
235-         
236-            totalTimeRun  < ((maxLifetime  + 10L ) * 1000 ), "Application killed before lifetime value "  + totalTimeRun );
231+         assertTrue (totalTimeRun  > (maxLifetime  * 1000 ),
232+             "Application killed before lifetime value" );
233+         assertTrue (totalTimeRun  < ((maxLifetime  + 10L ) * 1000 ),
234+             "Application killed before lifetime value "  + totalTimeRun );
237235      }
238236    } finally  {
239237      stopRM (rm );
@@ -314,9 +312,8 @@ public void testApplicationLifetimeOnRMRestart(Class schedulerParameter) throws
314312
315313    // wait for app life time and application to be in killed state. 
316314    rm2 .waitForState (recoveredApp1 .getApplicationId (), RMAppState .KILLED );
317-     assertTrue (
318-        recoveredApp1 .getFinishTime () > (recoveredApp1 .getSubmitTime ()
319-             + appLifetime  * 1000 ), "Application killed before lifetime value" );
315+     assertTrue (recoveredApp1 .getFinishTime () > (recoveredApp1 .getSubmitTime ()
316+         + appLifetime  * 1000 ), "Application killed before lifetime value" );
320317  }
321318
322319  @ Timeout (value  = 60 )
@@ -382,21 +379,21 @@ public synchronized void updateApplicationStateInternal(
382379        fail ("Update application should fail." );
383380      } catch  (YarnException  e ) {
384381        // expected 
385-         assertTrue (
386-            e . getMessage (). contains ( app1 . getApplicationId (). toString ()),  "State-store exception does not containe appId" );
382+         assertTrue (e . getMessage (). contains ( app1 . getApplicationId (). toString ()), 
383+             "State-store exception does not containe appId" );
387384      }
388385
389386      applicationTimeouts  = app1 .getApplicationTimeouts ();
390387      // has old timeout time 
391388      long  afterUpdate  =
392389          applicationTimeouts .get (ApplicationTimeoutType .LIFETIME );
393390
394-       assertEquals (beforeUpdate 
395- ,             afterUpdate ,  "Application timeout is updated" );
391+       assertEquals (beforeUpdate ,  afterUpdate , 
392+           "Application timeout is updated" );
396393      rm1 .waitForState (app1 .getApplicationId (), RMAppState .KILLED );
397394      // verify for app killed with updated lifetime 
398-       assertTrue (
399-          app1 . getFinishTime () >  afterUpdate ,  "Application killed before lifetime value" );
395+       assertTrue (app1 . getFinishTime () >  afterUpdate , 
396+           "Application killed before lifetime value" );
400397    } finally  {
401398      stopRM (rm1 );
402399    }
@@ -446,21 +443,20 @@ public void testInheritAppLifetimeFromParentQueue(Class schedulerParameter) thro
446443        rm .waitForState (app1 .getApplicationId (), RMAppState .KILLED );
447444        long  totalTimeRun  = app1 .getFinishTime () - app1 .getSubmitTime ();
448445        // Child queue should have inherited parent max and default lifetimes. 
449-         assertEquals (
450-            maxRootLifetime 
451- ,               csched . getQueue ( CQ1 ). getMaximumApplicationLifetime (),  "Child queue max lifetime should have overridden" 
446+         assertEquals (maxRootLifetime , 
447+              csched . getQueue ( CQ1 ). getMaximumApplicationLifetime (), 
448+             "Child queue max lifetime should have overridden" 
452449            + " parent value" );
453-         assertEquals (
454-            defaultRootLifetime 
455- ,               csched . getQueue ( CQ1 ). getDefaultApplicationLifetime (),  "Child queue default lifetime should have" 
450+         assertEquals (defaultRootLifetime , 
451+              csched . getQueue ( CQ1 ). getDefaultApplicationLifetime (), 
452+             "Child queue default lifetime should have" 
456453            + "  overridden parent value" );
457454        // app1 (run in the 'child1' queue) should have run longer than the 
458455        // default lifetime but less than the max lifetime. 
459-         assertTrue (
460-            totalTimeRun  > (defaultRootLifetime  * 1000 ), "Application killed before default lifetime value" );
461-         assertTrue (
462-         
463-            totalTimeRun  < (maxRootLifetime  * 1000 ), "Application killed after max lifetime value "  + totalTimeRun );
456+         assertTrue (totalTimeRun  > (defaultRootLifetime  * 1000 ),
457+             "Application killed before default lifetime value" );
458+         assertTrue (totalTimeRun  < (maxRootLifetime  * 1000 ),
459+             "Application killed after max lifetime value "  + totalTimeRun );
464460      }
465461    } finally  {
466462      stopRM (rm );
@@ -514,14 +510,12 @@ public void testOverrideParentQueueMaxAppLifetime(Class schedulerParameter) thro
514510        rm .waitForState (app1 .getApplicationId (), RMAppState .KILLED );
515511        long  totalTimeRun  = app1 .getFinishTime () - app1 .getSubmitTime ();
516512        // Child queue's max lifetime can override parent's and be larger. 
517-         assertTrue (
518-            (maxRootLifetime  < maxChildLifetime )
519-               && (totalTimeRun  > (maxChildLifetime  * 1000 )), "Application killed before default lifetime value" );
520-         assertEquals (
521-            maxRootLifetime 
522- ,             csched .getRootQueue ().getMaximumApplicationLifetime (), "Root queue max lifetime property set incorrectly" );
523-         assertEquals (maxChildLifetime 
524- ,             csched .getQueue (CQ1 ).getMaximumApplicationLifetime (), "Child queue max lifetime should have overridden" 
513+         assertTrue ((maxRootLifetime  < maxChildLifetime ) && (totalTimeRun  > (maxChildLifetime  * 1000 )),
514+             "Application killed before default lifetime value" );
515+         assertEquals (maxRootLifetime , csched .getRootQueue ().getMaximumApplicationLifetime (),
516+             "Root queue max lifetime property set incorrectly" );
517+         assertEquals (maxChildLifetime , csched .getQueue (CQ1 ).getMaximumApplicationLifetime (),
518+             "Child queue max lifetime should have overridden" 
525519            + " parent value" );
526520      }
527521    } finally  {
@@ -577,18 +571,16 @@ public void testOverrideParentQueueDefaultAppLifetime(
577571        long  totalTimeRun  = app1 .getFinishTime () - app1 .getSubmitTime ();
578572        // app1 (run in 'child1' queue) should have overridden the parent's 
579573        // default lifetime. 
580-         assertTrue (
581-            totalTimeRun  > ( defaultChildLifetime  *  1000 ),  "Application killed before default lifetime value" );
574+         assertTrue (totalTimeRun  > ( defaultChildLifetime  *  1000 ), 
575+             "Application killed before default lifetime value" );
582576        // Root and child queue's max lifetime should be -1. 
583-         assertEquals (
584-            maxRootLifetime 
585- ,             csched .getRootQueue ().getMaximumApplicationLifetime (), "Root queue max lifetime property set incorrectly" );
586-         assertEquals (
587-            maxChildLifetime 
588- ,             csched .getQueue (CQ1 ).getMaximumApplicationLifetime (), "Child queue max lifetime property set incorrectly" );
577+         assertEquals (maxRootLifetime , csched .getRootQueue ().getMaximumApplicationLifetime (),
578+             "Root queue max lifetime property set incorrectly" );
579+         assertEquals (maxChildLifetime , csched .getQueue (CQ1 ).getMaximumApplicationLifetime (),
580+             "Child queue max lifetime property set incorrectly" );
589581        // 'child1' queue's default lifetime should have overridden parent's. 
590-         assertEquals (defaultChildLifetime 
591- ,               csched . getQueue ( CQ1 ). getDefaultApplicationLifetime (),  "Child queue default lifetime should have" 
582+         assertEquals (defaultChildLifetime ,  csched . getQueue ( CQ1 ). getDefaultApplicationLifetime (), 
583+             "Child queue default lifetime should have" 
592584            + " overridden parent value" );
593585      }
594586    } finally  {
0 commit comments