Subversion Repositories DevTools

Rev

Rev 892 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 892 Rev 896
Line 27... Line 27...
27
   */
27
   */
28
  private static final Logger mLogger = Logger.getLogger(MasterThread.class);
28
  private static final Logger mLogger = Logger.getLogger(MasterThread.class);
29
 
29
 
30
   /**constructor
30
   /**constructor
31
   */
31
   */
32
  public MasterThread(int rtag_id, int rcon_id, String gbebuildfilter)
32
  public MasterThread(int rtag_id, int rcon_id, String unitTest)
33
  {
33
  {
34
    mLogger.warn("MasterThread rtag_id " + rtag_id + " rcon_id " + rcon_id);
34
    mLogger.warn("MasterThread rtag_id " + rtag_id + " rcon_id " + rcon_id);
35
    mRtagId = rtag_id;
35
    mRtagId = rtag_id;
36
    mRconId = rcon_id;
36
    mRconId = rcon_id;
-
 
37
    if ( unitTest == null )
-
 
38
    {
37
    mGbebuildfilter = gbebuildfilter;
39
      unitTest = new String();
-
 
40
    }
-
 
41
    mUnitTest = unitTest;
38
  }
42
  }
39
 
43
 
40
  /**implements the sequence diagrams coordinate slave threads, generate build files, allowed to proceed, check environment
44
  /**implements the sequence diagrams coordinate slave threads, generate build files, allowed to proceed, check environment
41
   */
45
   */
42
  public void run()
46
  public void run()
Line 62... Line 66...
62
          mLogger.warn("run is interrupted");
66
          mLogger.warn("run is interrupted");
63
          // unit test technique
67
          // unit test technique
64
          throw new ExitException();
68
          throw new ExitException();
65
        }
69
        }
66
        
70
        
67
        if ( mGbebuildfilter.compareTo("unit test spawn thread") == 0)
71
        if ( mUnitTest.compareTo("unit test spawn thread") == 0)
68
        {
72
        {
69
          throw new Exception();
73
          throw new Exception();
70
        }
74
        }
71
 
75
 
72
        MutableString buildFileContent = new MutableString();
76
        MutableString buildFileContent = new MutableString();
73
        
77
        
74
        if ( mGbebuildfilter.compareTo("unit test check environment") != 0)
78
        if ( mUnitTest.compareTo("unit test check environment") != 0)
75
        {
79
        {
76
          if ( mGbebuildfilter.compareTo("unit test generate build files") != 0)
80
          if ( mUnitTest.compareTo("unit test generate build files") != 0)
77
          {
81
          {
78
            if ((mGbebuildfilter.compareTo("unit test allowed to proceed") != 0) &&
82
            if ((mUnitTest.compareTo("unit test allowed to proceed") != 0) &&
79
                (mGbebuildfilter.compareTo("unit test not allowed to proceed") != 0) &&
83
                (mUnitTest.compareTo("unit test not allowed to proceed") != 0) &&
80
                (mGbebuildfilter.compareTo("unit test exit") != 0))
84
                (mUnitTest.compareTo("unit test exit") != 0))
81
            {
85
            {
82
              // coordinate slave threads
86
              // coordinate slave threads
83
              mLogger.warn("run coordinate slave threads");
87
              mLogger.warn("run coordinate slave threads");
84
 
88
 
85
              mRunLevel = RunLevel.WAITING;
89
              mRunLevel = RunLevel.WAITING;
Line 130... Line 134...
130
                while (moreRunLevelsConfigured && allSlaveThreadsWaiting);
134
                while (moreRunLevelsConfigured && allSlaveThreadsWaiting);
131
          
135
          
132
                if ( !allSlaveThreadsWaiting )
136
                if ( !allSlaveThreadsWaiting )
133
                {
137
                {
134
                  // to do, sleep for periodicMs
138
                  // to do, sleep for periodicMs
135
                  if ( mGbebuildfilter.compareTo("unit test coordinate slave threads") == 0 )
139
                  if ( mUnitTest.compareTo("unit test coordinate slave threads") == 0 )
136
                  {
140
                  {
137
                    Thread.currentThread().interrupt();
141
                    Thread.currentThread().interrupt();
138
                  }
142
                  }
139
                  else
143
                  else
140
                  {
144
                  {
Line 151... Line 155...
151
                    mLogger.info("run sleep returned");
155
                    mLogger.info("run sleep returned");
152
                  }
156
                  }
153
                }
157
                }
154
              }
158
              }
155
              
159
              
156
              if ( mGbebuildfilter.compareTo("unit test coordinate slave threads") == 0 )
160
              if ( mUnitTest.compareTo("unit test coordinate slave threads") == 0 )
157
              {
161
              {
158
                throw new ExitException();
162
                throw new ExitException();
159
              }
163
              }
160
              
164
              
161
              // DEVI 50527
165
              // DEVI 50527
Line 282... Line 286...
282
                    throw new Exception("an error occurred publishing to ClearCase or Release Manager");
286
                    throw new Exception("an error occurred publishing to ClearCase or Release Manager");
283
                  }
287
                  }
284
                }
288
                }
285
              }
289
              }
286
              
290
              
287
              if ( mGbebuildfilter.compareTo("unit test coordinate slave threads") == 0 )            
291
              if ( mUnitTest.compareTo("unit test coordinate slave threads") == 0 )            
288
              {
292
              {
289
                throw new ExitException();
293
                throw new ExitException();
290
              }
294
              }
291
              mLogger.info("run coordinate slave threads returned");
295
              mLogger.info("run coordinate slave threads returned");
292
            }
296
            }
Line 294... Line 298...
294
            // DEVI 51366 allowed to proceed after coordinate slave threads
298
            // DEVI 51366 allowed to proceed after coordinate slave threads
295
            mLogger.warn("run checking allowedToProceed");
299
            mLogger.warn("run checking allowedToProceed");
296
            allowedToProceed(true);
300
            allowedToProceed(true);
297
            mLogger.info("run allowedToProceed returned");
301
            mLogger.info("run allowedToProceed returned");
298
 
302
 
299
            if ( mGbebuildfilter.compareTo("unit test allowed to proceed") == 0 )            
303
            if ( mUnitTest.compareTo("unit test allowed to proceed") == 0 )            
300
            {
304
            {
301
              throw new ExitException();
305
              throw new ExitException();
302
            }
306
            }
303
            
307
            
304
            // generate build files
308
            // generate build files
Line 346... Line 350...
346
                moreBuildThreadsConfigured = mReleaseManager.getNextReleaseConfig(rconId);
350
                moreBuildThreadsConfigured = mReleaseManager.getNextReleaseConfig(rconId);
347
            }
351
            }
348
          }
352
          }
349
          while (moreBuildThreadsConfigured);
353
          while (moreBuildThreadsConfigured);
350
          
354
          
351
          if ( mGbebuildfilter.compareTo("unit test generate build files") == 0 )
355
          if ( mUnitTest.compareTo("unit test generate build files") == 0 )
352
          {
356
          {
353
            throw new ExitException();
357
            throw new ExitException();
354
          }
358
          }
355
        }
359
        }
356
        
360
        
Line 359... Line 363...
359
        // check environment
363
        // check environment
360
        mLogger.warn("run checkEnvironment");
364
        mLogger.warn("run checkEnvironment");
361
        checkEnvironment();
365
        checkEnvironment();
362
        mLogger.info("run checkEnvironment returned");
366
        mLogger.info("run checkEnvironment returned");
363
        
367
        
364
        if ( mGbebuildfilter.compareTo("unit test check environment") == 0 )
368
        if ( mUnitTest.compareTo("unit test check environment") == 0 )
365
        {
369
        {
366
          throw new ExitException();
370
          throw new ExitException();
367
        }
371
        }
368
        
372
        
369
        // deliver change to product baseline
373
        // deliver change to product baseline
Line 410... Line 414...
410
        {
414
        {
411
          try
415
          try
412
          {
416
          {
413
            // notify first
417
            // notify first
414
            // many reasons for indefinite pause, including database related, so do database last
418
            // many reasons for indefinite pause, including database related, so do database last
-
 
419
            mRecoverable = false;
-
 
420
            
-
 
421
            if ( cause.compareTo(Package.mRecoverable) == 0 )
-
 
422
            {
-
 
423
              mRecoverable = true;
-
 
424
            }
-
 
425
            
415
            indefinitePause(rippleEngine, cause);
426
            indefinitePause(rippleEngine, cause);
416
            mReleaseManager.indefinitePause();
427
            mReleaseManager.indefinitePause();
417
            // DEVI 51366 force sleep at beginning of while loop
428
            // DEVI 51366 force sleep at beginning of while loop
418
            mException = true;
429
            mException = true;
419
          }
430
          }