Subversion Repositories DevTools

Rev

Rev 7163 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6914 dpurdie 1
package com.erggroup.buildtool.utf;
2
 
3
 
4
import java.sql.SQLException;
5
import java.util.Date;
7082 dpurdie 6
import java.util.Iterator;
6914 dpurdie 7
 
8
import com.erggroup.buildtool.daemon.BuildDaemon;
9
import com.erggroup.buildtool.daemon.BuildThread;
10
import com.erggroup.buildtool.daemon.MasterThread;
11
import com.erggroup.buildtool.daemon.SlaveThread;
12
import com.erggroup.buildtool.ripple.BuildFile;
13
import com.erggroup.buildtool.ripple.BuildFile.BuildFileState;
14
import com.erggroup.buildtool.ripple.BuildStandard;
15
import com.erggroup.buildtool.ripple.ReleaseConfig;
16
import com.erggroup.buildtool.ripple.ReleaseManager;
17
import com.erggroup.buildtool.ripple.Package;
7186 dpurdie 18
import com.erggroup.buildtool.ripple.PackageCollection;
6914 dpurdie 19
import com.erggroup.buildtool.ripple.RippleEngine;
20
import com.erggroup.buildtool.ripple.RunLevelData;
21
import com.erggroup.buildtool.ripple.RunLevel.BuildState;
22
 
7033 dpurdie 23
import org.slf4j.Logger;
24
import org.slf4j.LoggerFactory;
6914 dpurdie 25
import org.junit.AfterClass;
26
import org.junit.BeforeClass;
27
import org.junit.After;
28
import org.junit.Before;
29
import org.junit.Test;
30
import org.junit.runner.JUnitCore;
31
 
32
import static org.junit.Assert.*;
33
 
34
/**
35
 * container of Build Daemon test methods
36
 */
37
public class DaemonBuildTestCase
38
{
7033 dpurdie 39
    private static final Logger mLogger = LoggerFactory.getLogger(DaemonBuildTestCase.class);
7082 dpurdie 40
    myReleaseManager            releaseManager = null;
6914 dpurdie 41
    RippleEngine                rippleEngine   = null;
7186 dpurdie 42
    PackageCollection testPackageCollection   = new PackageCollection();
43
    PackageCollection testPackageCollectionWip   = new PackageCollection();
6914 dpurdie 44
 
7082 dpurdie 45
    /**
46
     * Init the package set
47
     */
48
    public void initTestPackages(String setName)
49
    {
50
        releaseManager.initTestPackages(rippleEngine, testPackageCollection, setName);
51
    }
52
 
53
    /** Create a WIP for a package in the Release
54
     * This will mark it as directlyPlanned
55
     * @param newPvId
56
     * @param alias
57
     */
58
    private Package createWip(int newPvId, String alias) {
59
 
7186 dpurdie 60
    	Package wip = testPackageCollection.contains(alias);
61
    	if (wip == null)
62
    	{
63
    		wip = ReleaseManager.NULL_PACKAGE;
64
    	}
65
    	else
66
    	{
67
            wip = new Package(newPvId, wip);
68
            wip.mDirectlyPlanned = true;
69
            testPackageCollectionWip.add(wip);
70
    	}
7082 dpurdie 71
 
72
        return wip;
73
    }
74
 
75
 
76
 
6914 dpurdie 77
    /** Subclass and override key methods so that the test can control
78
     *  the data being used
79
     */
80
    public class myReleaseManager extends ReleaseManagerUtf
81
	{
82
        int mAmyReleaseManager = 1;
7082 dpurdie 83
 
84
       public myReleaseManager(final String connectionString, final String username, final String password)
6914 dpurdie 85
		{
7082 dpurdie 86
           super(connectionString, username, password);
87
           mLogger.error("Test {}", connectionString);
6914 dpurdie 88
		}
89
 
90
		public myReleaseManager()
91
		{
92
			super();
93
		}
94
 
95
		@Override
7186 dpurdie 96
		public void queryPackageVersions(RippleEngine rippleEngine, PackageCollection packageCollection, int baseline) throws SQLException, Exception
6914 dpurdie 97
		{
7082 dpurdie 98
 
99
		    //    Filter for the packages that are in the release
100
		    for (Iterator<Package> it = testPackageCollection.iterator(); it.hasNext(); )
101
	        {
102
	            Package p = it.next();
103
	            if (!p.mDirectlyPlanned && p.mTestBuildInstruction == 0 && p.mForcedRippleInstruction == 0)
104
	            {
105
	                p.mIsNotReleased = false;
106
	                if (p.mBuildTime <= 0)
107
	                    p.mBuildTime = 90;
108
	                packageCollection.add(p);
109
	            }
110
	        }
6914 dpurdie 111
 
112
		}
7082 dpurdie 113
 
6914 dpurdie 114
		@Override
7186 dpurdie 115
        public void queryWips(RippleEngine rippleEngine, PackageCollection packageCollection, int baseline) throws SQLException, Exception
7082 dpurdie 116
        {
117
            //    Filter for the packages that are WIPs
7186 dpurdie 118
            for (Iterator<Package> it = testPackageCollectionWip.iterator(); it.hasNext(); )
7082 dpurdie 119
            {
120
                Package p = it.next();
121
                if (p.mDirectlyPlanned )
122
                {
123
                    p.mIsNotReleased = true;
124
                    p.mDirectlyPlanned = true;
125
                    p.mBuildReason = BuildReason.NewVersion;
126
                    if (p.mBuildTime <= 0)
127
                        p.mBuildTime = 100;
128
                    packageCollection.add(p);
129
                }
130
            }
131
 
132
        }
133
 
134
		@Override
7186 dpurdie 135
        public void queryTest(RippleEngine rippleEngine, PackageCollection packageCollection, int baseline) throws SQLException, Exception
7082 dpurdie 136
        {
137
		    //    Filter for the packages that are TEST builds
138
            for (Iterator<Package> it = testPackageCollection.iterator(); it.hasNext(); )
139
            {
140
    		    Package p = it.next();
141
                if (p.mTestBuildInstruction != 0 )
142
                {
143
                    p.mIsNotReleased = true;
144
                    p.mDirectlyPlanned = false;
145
                    p.mBuildReason = BuildReason.Test;
146
                    packageCollection.add(p);
147
                }
148
            }
149
 
150
        }
151
 
152
		@Override
7186 dpurdie 153
        public void queryRipples(RippleEngine rippleEngine, PackageCollection packageCollection, int baseline) throws SQLException, Exception
7082 dpurdie 154
        {
155
		    //    Filter for the packages that are forced Ripples
156
            for (Iterator<Package> it = testPackageCollection.iterator(); it.hasNext(); )
157
            {		    
158
    		    Package p = it.next();
159
                if (p.mForcedRippleInstruction != 0)
160
                {
161
                    p.mIsNotReleased = true;
162
                    p.mDirectlyPlanned = false;
7114 dpurdie 163
                    p.mBuildReason = BuildReason.Forced;
7082 dpurdie 164
                    p.mBuildTime = 3;
165
                    packageCollection.add(p);
166
                } 
167
            }
168
        }
169
 
170
		@Override
6914 dpurdie 171
		public void queryReleaseConfig(final String hostname) throws SQLException, Exception
172
		{
173
		    mReleaseConfigCollection.resetData();
174
 
175
		    if ( mConnectionString.compareTo("unit test spawn thread") == 0)
176
		    {
177
		        mLogger.info("queryReleaseConfig 3 unit test spawn thread");
178
		        // specifying a gbebuildfilter of unit test is designed to invoke a benign thread for unit test purposes
179
		        ReleaseConfig releaseConfig = new ReleaseConfig(1,1,'M', "DummyHost1","DummyTarget1", "DummyMachtype1", "Win32");
180
		        mReleaseConfigCollection.add(releaseConfig);
181
		        releaseConfig = new ReleaseConfig(2,2,'S', "DummyHost2","DummyTarget2", "DummyMachtype2", "Linux");
182
		        mReleaseConfigCollection.add(releaseConfig);
183
		    }
184
		}
185
 
186
		@Override 
187
		public boolean queryReleaseConfig(final int rtag_id, final int rcon_id,final String machine_hostname, final char daemon_mode,  final long threadStartTime) throws SQLException, Exception
188
		 {
189
		     boolean retVal = false;
190
 
191
		     if ( mConnectionString.compareTo("unit test exit") != 0 )
192
		     {
193
		         retVal = true;
194
		     }
195
		     return retVal;
196
		 }
197
 
198
		@Override
199
		 public void queryRunLevel(final int rtag_id) throws SQLException, Exception
200
		 {
201
		     if ( mConnectionString.compareTo("unit test coordinate slave threads") == 0)
202
		     {
203
 
204
		         if ( mRunLevelCollection.size() == 0)
205
		         {
206
		             // first time not all slave threads are waiting
207
		             RunLevelData runLevel = new RunLevelData(1, BuildState.DB_WAITING, 'S',0);
208
		             mRunLevelCollection.add(runLevel);
209
		             runLevel = new RunLevelData(2, BuildState.DB_IDLE, 'S',0);
210
		             mRunLevelCollection.add(runLevel);
211
		         }
212
		         else
213
		         {
214
		             // subsequent times all slave threads are waiting
215
		             mRunLevelCollection.clear();
216
		             RunLevelData runLevel = new RunLevelData(1, BuildState.DB_WAITING, 'S',0);
217
		             mRunLevelCollection.add(runLevel);
218
		             runLevel = new RunLevelData(2, BuildState.DB_WAITING, 'S',0);
219
		             mRunLevelCollection.add(runLevel);
220
		         }
221
		     }
222
		 }
223
 
224
		 public boolean queryRunLevelSchedule(Date resumeTime, boolean recover) throws SQLException, Exception
225
		 {
226
		     boolean retVal = true;
227
 
228
		     if ( mConnectionString.compareTo("unit test not allowed to proceed") == 0 )
229
		     {
230
		         // schedule a 100ms max wait
231
		         resumeTime.setTime( resumeTime.getTime() + 100 );
232
		         retVal = false;
233
		     }
234
		     return retVal;
235
		 }
7082 dpurdie 236
 
237
		 /** Build a single package collection
238
		     * It will be split up when requested by the classes under test 
239
		     * 
240
		     * @param packageCollection
241
		     */
7186 dpurdie 242
		    private void initTestPackages(RippleEngine rippleEngine, PackageCollection packageCollection, String setName)
7082 dpurdie 243
		    {
244
		        packageCollection.clear();
245
 
246
		        /* a highly unlikely set of packages
247
		         * planned info
248
		         * pv_id pkg_id pkg_name                     v_ext pkg_vcs_tag                            change_type
249
		         * 0     76     UncommonDependency           .tim  0.TIM.WIP \vob\UncommonDependency           P
250
		         * 1     1011   DependencyMissingFromRelease .tim  1.TIM.WIP \vob\DependencyMissingFromRelease M
251
		         * 2     34     CommonDependency             .tim  2.TIM.WIP \vob\CommonDependency             M
252
		         * 3     908    SolarisCentricProduct        .tim  3.TIM.WIP \vob\SolarisCentricProduct        N
253
		         * 4     6      GenericProduct               .tim  4.TIM.WIP \vob\GenericProduct               P
254
		         * 5     11     Product                      .tim  5.TIM.WIP \vob\Product                      M
255
		         * 6     113    UnfinishedProduct            .tim  6.TIM.WIP \vob\UnfinishedProduct            M
256
		         * 25    45     Banana                       .tim  B.TIM.WIP \vob\Banana                       M
257
		         */
258
                 Package p;
259
 
260
		         if ( setName.compareTo("iteration1") == 0 )
261
		         {
262
		           p = new Package(76, 0, "UncommonDependency", "1.0.0000", ".tim", "UncommonDependency.tim", "CC::/vob/UncommonDependency::0.TIM.WIP", 'b', 'P');
263
		           //p.mDirectlyPlanned = true;
264
		           packageCollection.add(p);
265
		         }
266
 
267
	             p = new Package(1011, 1, "DependencyMissingFromRelease", "1.0.0000", ".tim", "DependencyMissingFromRelease.tim", "CC::/vob/DependencyMissingFromRelease::1.TIM.WIP", 'b', 'M');
268
	             //p.mDirectlyPlanned = true;
269
	             packageCollection.add(p);
270
 
271
 
272
		         if ( setName.compareTo("iteration1") == 0 
273
		           || setName.compareTo("iteration2") == 0 )
274
		         {
275
		           p = new Package(34, 2, "CommonDependency", "1.0.0000", ".tim", "CommonDependency.tim", "CC::/vob/CommonDependency::2.TIM.WIP", 'b', 'M');
276
		           //p.mDirectlyPlanned = true;
277
		           packageCollection.add(p);
278
		         }
279
 
280
		         if ( setName.compareTo("iteration1") == 0 
281
		           || setName.compareTo("iteration2") == 0
282
		           || setName.compareTo("iteration3") == 0 )
283
		         {
284
		           p = new Package(908, 3, "SolarisCentricProduct", "1.0.0000", ".tim", "SolarisCentricProduct.tim", "CC::/vob/SolarisCentricProduct::3.TIM.WIP", 'b', 'N');
285
		           //p.mDirectlyPlanned = true;
286
		           packageCollection.add(p);
287
		         }
288
 
289
		         if ( setName.compareTo("iteration1") == 0 
290
		           || setName.compareTo("iteration2") == 0
291
		           || setName.compareTo("iteration3") == 0
292
		           || setName.compareTo("iteration4") == 0 )
293
		         {
294
		           p = new Package(6, 4, "GenericProduct", "1.0.0000", ".tim", "GenericProduct.tim", "CC::/vob/GenericProduct::4.TIM.WIP", 'b', 'P');
295
		           //p.mDirectlyPlanned = true;
296
		           packageCollection.add(p);
297
		         }
298
 
299
		         if ( setName.compareTo("iteration1") == 0 
300
		           || setName.compareTo("iteration2") == 0
301
		           || setName.compareTo("iteration3") == 0
302
		           || setName.compareTo("iteration4") == 0
303
		           || setName.compareTo("iteration5") == 0 )
304
		         {
305
		           p = new Package(11, 5, "Product", "1.0.0000", ".tim", "Product.tim", "CC::/vob/Product::5.TIM.WIP", 'b', 'M');
306
		           //p.mDirectlyPlanned = true;
307
		           packageCollection.add(p);
308
		         }
309
 
310
		         p = new Package(113, 6, "UnfinishedProduct", "1.0.0000", ".tim", "UnfinishedProduct.tim", "CC::/vob/UnfinishedProduct::6.TIM.WIP", 'b', 'M');
311
		         //p.mDirectlyPlanned = true;
312
		         packageCollection.add(p);
313
 
314
		         if ( setName.compareTo("iteration1") == 0 )
315
		         {
316
		           p = new Package(45, 25, "Banana", "1.0.0000", ".tim", "Banana.tim", "CC::B.TIM.WIP/vob/Banana", 'b', 'M');
317
		           //p.mDirectlyPlanned = true;
318
		           packageCollection.add(p);
319
		         }
320
 
321
		        /* planned dependencies
322
		         * pv_id pkg_name                     v_ext
323
		         * 1     NotInTheRelease              .cots
324
		         * 2     CotsWithFunnyVersion         .cots
325
		         * 2     UncommonDependency           .tim
326
		         * 3     CommonDependency             .tim
327
		         * 4     CommonDependency             .tim
328
		         * 5     UncommonDependency           .tim
329
		         * 25    Car                          .tim
330
		         */
331
		         p = findPackage(1, packageCollection);
7163 dpurdie 332
		         p.addDependency("NotInTheRelease.cots", -1);
7082 dpurdie 333
 
334
		         if ( setName.compareTo("iteration1") == 0 
335
		           || setName.compareTo("iteration2") == 0 )
336
		         {
337
		           p = findPackage(2, packageCollection);
7163 dpurdie 338
		           p.addDependency("CotsWithFunnyVersion.cots", 7);
339
		           p.addDependency("UncommonDependency.tim", 0);
7082 dpurdie 340
		         }
341
 
342
		         if ( setName.compareTo("iteration1") == 0 
343
		           || setName.compareTo("iteration2") == 0
344
		           || setName.compareTo("iteration3") == 0 )
345
		         {
346
		           p = findPackage(3, packageCollection);
7163 dpurdie 347
		           p.addDependency("CommonDependency.tim", 2);
7082 dpurdie 348
		         }
349
 
350
		         if ( setName.compareTo("iteration1") == 0 
351
		           || setName.compareTo("iteration2") == 0
352
		           || setName.compareTo("iteration3") == 0
353
		           || setName.compareTo("iteration4") == 0 )
354
		         {
355
		           p = findPackage(4, packageCollection);
7163 dpurdie 356
		           p.addDependency("CommonDependency.tim", 2);
7082 dpurdie 357
		         }
358
 
359
		         if ( setName.compareTo("iteration1") == 0 
360
		           || setName.compareTo("iteration2") == 0
361
		           || setName.compareTo("iteration3") == 0
362
		           || setName.compareTo("iteration4") == 0
363
		           || setName.compareTo("iteration5") == 0 )
364
		         {
365
		           p = findPackage(5, packageCollection);
7163 dpurdie 366
		           p.addDependency("UncommonDependency.tim", 0);
7082 dpurdie 367
		         }
368
 
369
		         if ( setName.compareTo("iteration1") == 0 )
370
		         {
371
		           p = findPackage(25, packageCollection);
7163 dpurdie 372
		           p.addDependency("Car.tim", 24);
7082 dpurdie 373
		         }
374
 
375
 
376
 
377
		        /* planned build info
378
		         * pv_id bm_name bsa_name
379
		         * 0     Linux   Java 1.6
380
		         * 1     Linux   Debug
381
		         * 2     Linux   Debug
382
		         * 2     Solaris Production
383
		         * 2     Win32   Production and Debug
384
		         * 3     Solaris Java 1.4
385
		         * 4     Generic Java 1.5
386
		         * 5     Linux   Java 1.6
387
		         * 5     Win32   Java 1.6
388
		         * 25    Linux   Java 1.6
389
		         */
390
		         if ( setName.compareTo("iteration1") == 0 )
391
		         {
392
		           p = findPackage(0, packageCollection);
393
		           BuildStandard bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
394
		           p.mBuildStandardCollection.add(bs);
395
		         }
396
 
397
		         p = findPackage(1, packageCollection);
398
		         BuildStandard bs = new BuildStandard(rippleEngine, "Linux", "Debug");
399
		         p.mBuildStandardCollection.add(bs);
400
 
401
		         if ( setName.compareTo("iteration1") == 0 || setName.compareTo("iteration2") == 0 )
402
		         {
403
		           p = findPackage(2, packageCollection);
404
		           bs = new BuildStandard(rippleEngine, "Linux", "Debug");
405
		           p.mBuildStandardCollection.add(bs);
406
		           bs = new BuildStandard(rippleEngine, "Solaris","Production");
407
		           p.mBuildStandardCollection.add(bs);
408
		           bs = new BuildStandard(rippleEngine, "Win32", "Production and Debug");
409
		           p.mBuildStandardCollection.add(bs);
410
		         }
411
 
412
		         if ( setName.compareTo("iteration1") == 0 
413
		           || setName.compareTo("iteration2") == 0
414
		           || setName.compareTo("iteration3") == 0 )
415
		         {
416
		           p = findPackage(3, packageCollection);
417
		           bs = new BuildStandard(rippleEngine, "Solaris", "Java 1.4");
418
		           p.mBuildStandardCollection.add(bs);
419
		         }
420
 
421
		         if ( setName.compareTo("iteration1") == 0 
422
		           || setName.compareTo("iteration2") == 0
423
		           || setName.compareTo("iteration3") == 0
424
		           || setName.compareTo("iteration4") == 0 )
425
		         {
426
		           p = findPackage(4, packageCollection);
427
		           bs = new BuildStandard(rippleEngine, "Generic", "Java 1.5");
428
		           p.mBuildStandardCollection.add(bs);
429
		         }
430
 
431
		         if ( setName.compareTo("iteration1") == 0 
432
		           || setName.compareTo("iteration2") == 0
433
		           || setName.compareTo("iteration3") == 0
434
		           || setName.compareTo("iteration4") == 0
435
		           || setName.compareTo("iteration5") == 0 )
436
		         {
437
		           p = findPackage(5, packageCollection);
438
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
439
		           p.mBuildStandardCollection.add(bs);
440
		           bs = new BuildStandard(rippleEngine, "Win32", "Java 1.6");
441
		           p.mBuildStandardCollection.add(bs);
442
		         }
443
 
444
		         if ( setName.compareTo("iteration1") == 0 )
445
		         {
446
		           p = findPackage(25, packageCollection);
447
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
448
		           p.mBuildStandardCollection.add(bs);
449
		         }
450
 
451
		         /* planned unit test info
452
		         * pv_id test_type_name
453
		         * 2     Manual Test
454
		         * 2     Interactive Test
455
		         * 2     Integration Test
456
		         * 5     Autobuild UTF
457
		         */
458
		         if ( setName.compareTo("iteration1") == 0 
459
		           || setName.compareTo("iteration2") == 0
460
		           || setName.compareTo("iteration3") == 0
461
		           || setName.compareTo("iteration4") == 0
462
		           || setName.compareTo("iteration5") == 0 )
463
		         {
464
		           p = findPackage(5, packageCollection);
465
		           p.mHasAutomatedUnitTests = true;
466
		         }
467
 
468
		        /* planned build failure info
469
		         * pv_id user_email
470
		         * 3     jimmyfishcake@vixtechnology.com
471
		         * 3     rayhaddock@vixtechnology.com
472
		         * 5     timbutdim@vixtechnology.com
473
		         */
474
		         if ( setName.compareTo("iteration1") == 0 
475
		           || setName.compareTo("iteration2") == 0
476
		           || setName.compareTo("iteration3") == 0 )
477
		         {
478
		           p = findPackage(3, packageCollection);
479
		           p.addEmail("jimmyfishcake@vixtechnology.com");
480
		           p.addEmail("rayhaddock@vixtechnology.com");
481
		         }
482
 
483
		         if ( setName.compareTo("iteration1") == 0 
484
		           || setName.compareTo("iteration2") == 0
485
		           || setName.compareTo("iteration3") == 0
486
		           || setName.compareTo("iteration4") == 0
487
		           || setName.compareTo("iteration5") == 0 )
488
		         {
489
		           p = findPackage(5, packageCollection);
490
		           p.addEmail("timbutdim@vixtechnology.com");
491
		         }
492
 
493
		        /* planned advisory ripple info
494
		         * pv_id
495
		         * 0
496
		         */
497
		         if ( setName.compareTo("iteration1") == 0 )
498
		         {
499
		           p = findPackage(0, packageCollection);
500
		           p.mAdvisoryRipple = true;
501
		         }
502
 
503
		        /* released info
504
		         * pv_id pkg_id pkg_name                     pkg_version      v_ext pkg_vcs_tag                                                    ripple_field
505
		         * 7     8      CotsWithFunnyVersion         hoopla2_x.cots   .cots CotsWithFunnyVersion_hoopla2_x.cots \vob\CotsWithFunnyVersion
506
		         * 8     17     NotInAnyWayReproducible      1.0.0.tim        .tim  NA                                  NA
507
		         * 9     34     CommonDependency             1.0.0000.tim     .tim  CommonDependency_1.0.0000.tim       \vob\CommonDependency
508
		         * 10    908    SolarisCentricProduct        1.0.0000.tim     .tim  SolarisCentricProduct_1.0.0000.tim  \vob\SolarisCentricProduct m
509
		         * 11    16     LinuxCentricProduct          1.0.0000.tim     .tim  LinuxCentricProduct_1.0.0000.tim    \vob\LinuxCentricProduct
510
		         * 12    312    Win32CentricProduct          1.0.0000.tim     .tim  Win32CentricProduct_1.0.0000.tim    \vob\Win32CentricProduct
511
		         * 13    6      GenericProduct               1.0.0000.tim     .tim  GenericProduct_1.0.0000.tim         \vob\ToBeMovedFromHere     M
512
		         * 14    81     AdvisoryDependency           1.0.0000.tim     .tim  AdvisoryDependency_1.0.0000.tim     \vob\AdvisoryDependency
513
		         * 15    1      MergedProduct                1.0.0000.tim     .tim  MergedProduct_1.0.0000.tim          \vob\MergedProduct         m
514
		         * 22    45     Banana                       1.1.0000.tim     .tim  Banana_1.1.0000.tim                 \vob\Banana
515
		         * 23    18     Aardvark                     1.1.1000.tim     .tim  Aardvark_1.1.1000.tim               \vob\Aardvark
516
		         * 24    227    Car                          1.0.10000.tim    .tim  Car_1.0.10000.tim                   \vob\Car
517
		         */
518
		         if ( setName.compareTo("iteration1") != 0 )
519
		         {
520
		           p = new Package(76, 0, "UncommonDependency", "0.0.1000.tim", ".tim", "UncommonDependency.tim", "CC::/vob/UncommonDependency::UncommonDependency_0.0.1000.tim", 'x');
521
		           Package plannedPackage = findPackage(p.mAlias, packageCollection);
522
 
523
		           if ( plannedPackage == NULL_PACKAGE )
524
		           {
525
		             packageCollection.add(p);
526
		           }
527
		           else
528
		           {
529
		             plannedPackage.mVersion = "0.0.1000";
530
		           }
531
		         }
532
 
533
		         if ( setName.compareTo("iteration1") != 0 
534
		           && setName.compareTo("iteration2") != 0
535
		           && setName.compareTo("iteration3") != 0 )
536
		         {
537
		           p = new Package(908, 3, "SolarisCentricProduct", "1.1.0000.tim", ".tim", "SolarisCentricProduct.tim", "CC::/vob/SolarisCentricProduct::SolarisCentricProduct_1.1.0000.tim", 'm');
538
		           Package plannedPackage = findPackage(p.mAlias, packageCollection);
539
 
540
		           if ( plannedPackage == NULL_PACKAGE )
541
		           {
542
		             packageCollection.add(p);
543
		           }
544
		           else
545
		           {
546
		             plannedPackage.mVersion = "1.1.0000";
547
		           }
548
		         }
549
 
550
		         if ( setName.compareTo("iteration1") != 0 
551
		           && setName.compareTo("iteration2") != 0
552
		           && setName.compareTo("iteration3") != 0
553
		           && setName.compareTo("iteration4") != 0 )
554
		         {
555
		           p = new Package(6, 4, "GenericProduct", "1.0.1000.tim", ".tim", "GenericProduct.tim", "CC::/vob/GenericProduct::GenericProduct_1.0.1000.tim", 'M');
556
		           Package plannedPackage = findPackage(p.mAlias, packageCollection);
557
 
558
		           if ( plannedPackage == NULL_PACKAGE )
559
		           {
560
		             packageCollection.add(p);
561
		           }
562
		           else
563
		           {
564
		             plannedPackage.mVersion = "1.0.1000";
565
		           }
566
		         }
567
 
568
		         if ( setName.compareTo("iteration1") != 0 
569
		           && setName.compareTo("iteration2") != 0
570
		           && setName.compareTo("iteration3") != 0
571
		           && setName.compareTo("iteration4") != 0
572
		           && setName.compareTo("iteration5") != 0 )
573
		         {
574
		           p = new Package(11, 5, "Product", "1.0.0000.tim", ".tim", "Product.tim", "CC::/vob/Product::Product_1.0.0000.tim", 'M');
575
		           Package plannedPackage = findPackage(p.mAlias, packageCollection);
576
 
577
		           if ( plannedPackage == NULL_PACKAGE )
578
		           {
579
		             packageCollection.add(p);
580
		           }
581
		           else
582
		           {
583
		             plannedPackage.mVersion = "1.0.0000";
584
		           }
585
		         }
586
 
587
		         p = new Package(8, 7, "CotsWithFunnyVersion", "hoopla2_x.cots", ".cots", "CotsWithFunnyVersion.cots", "CC::/vob/CotsWithFunnyVersion::CotsWithFunnyVersion_hoopla2_x", 'x');
588
		         Package plannedPackage = findPackage(p.mAlias, packageCollection);
589
 
590
		         if ( plannedPackage == NULL_PACKAGE )
591
		         {
592
		           packageCollection.add(p);
593
		         }
594
		         else
595
		         {
596
		           plannedPackage.mVersion = "hoopla2_x";
597
		         }
598
 
599
		         p = new Package(17, 8, "NotInAnyWayReproducible", "1.0.0.tim", ".tim", "NotInAnyWayReproducible.tim", "CC::NA::NA", 'x');
600
		         plannedPackage = findPackage(p.mAlias, packageCollection);
601
 
602
		         if ( plannedPackage == NULL_PACKAGE )
603
		         {
604
		           packageCollection.add(p);
605
		         }
606
		         else
607
		         {
608
		           plannedPackage.mVersion = "1.0.0";
609
		         }
610
 
611
		         if ( setName.compareTo("iteration1") == 0 
612
		           || setName.compareTo("iteration2") == 0
613
		           || setName.compareTo("iteration3") == 0 )
614
		         {
615
		           p = new Package(908, 10, "SolarisCentricProduct", "1.0.0000.tim", ".tim", "SolarisCentricProduct.tim", "CC::/vob/SolarisCentricProduct::SolarisCentricProduct_1.0.0000.tim", 'm');
616
		           plannedPackage = findPackage(p.mAlias, packageCollection);
617
 
618
		           if ( plannedPackage == NULL_PACKAGE )
619
		           {
620
		             packageCollection.add(p);
621
		           }
622
		           else
623
		           {
624
		             plannedPackage.mVersion = "1.0.0000";
625
		           }
626
		         }
627
 
628
		         p = new Package(16, 11, "LinuxCentricProduct", "1.0.0000.tim", ".tim", "LinuxCentricProduct.tim", "CC::/vob/LinuxCentricProduct::LinuxCentricProduct_1.0.0000.tim", 'x');
629
		         plannedPackage = findPackage(p.mAlias, packageCollection);
630
 
631
		         if ( plannedPackage == NULL_PACKAGE )
632
		         {
633
		           packageCollection.add(p);
634
		         }
635
		         else
636
		         {
637
		           plannedPackage.mVersion = "1.0.0000";
638
		         }
639
 
640
		         p = new Package(312, 12, "Win32CentricProduct", "1.0.0000.tim", ".tim", "Win32CentricProduct.tim", "CC::/vob/Win32CentricProduct::Win32CentricProduct_1.0.0000.tim", 'x');
641
		         plannedPackage = findPackage(p.mAlias, packageCollection);
642
 
643
		         if ( plannedPackage == NULL_PACKAGE )
644
		         {
645
		           packageCollection.add(p);
646
		         }
647
		         else
648
		         {
649
		           plannedPackage.mVersion = "1.0.0000";
650
		         }
651
 
652
		         if ( setName.compareTo("iteration1") == 0 
653
		           || setName.compareTo("iteration2") == 0
654
		           || setName.compareTo("iteration3") == 0
655
		           || setName.compareTo("iteration4") == 0 )
656
		         {
657
		           p = new Package(6, 13, "GenericProduct", "1.0.0000.tim", ".tim", "GenericProduct.tim", "CC::/vob/ToBeMovedFromHere::GenericProduct_1.0.0000.tim", 'M');
658
		           plannedPackage = findPackage(p.mAlias, packageCollection);
659
 
660
 
661
    		         if ( plannedPackage == NULL_PACKAGE )
662
    		         {
663
    		           packageCollection.add(p);
664
    		         }
665
    		         else
666
    		         {
667
    		           plannedPackage.mVersion = "1.0.0000";
668
    		         }
669
                 }	
670
 
671
		         p = new Package(81, 14, "AdvisoryDependency", "1.0.0000.tim", ".tim", "AdvisoryDependency.tim", "CC::/vob/AdvisoryDependency::AdvisoryDependency_1.0.0000.tim", 'x');
672
		         plannedPackage = findPackage(p.mAlias, packageCollection);
673
 
674
		         if ( plannedPackage == NULL_PACKAGE )
675
		         {
676
		           packageCollection.add(p);
677
		         }
678
		         else
679
		         {
680
		           plannedPackage.mVersion = "1.0.0000";
681
		         }
682
 
683
		         if ( setName.compareTo("iteration1") == 0 
684
		           || setName.compareTo("iteration2") == 0
685
		           || setName.compareTo("iteration3") == 0
686
		           || setName.compareTo("iteration4") == 0
687
		           || setName.compareTo("iteration5") == 0
688
		           || setName.compareTo("iteration6") == 0 )
689
		         {
690
		           p = new Package(1, 15, "MergedProduct", "1.0.0000.tim", ".tim", "MergedProduct.tim", "CC::/vob/MergedProduct::MergedProduct_1.0.0000.tim", 'm');
691
		           p.mBuildTime = 9990;
692
		           plannedPackage = findPackage(p.mAlias, packageCollection);
693
		         }
694
		         else
695
		         {
696
		           p = new Package(1, 16, "MergedProduct", "1.0.0000.tim", ".tim", "MergedProduct.tim", "CC::/vob/MergedProduct::MergedProduct_1.0.0000.tim", 'm');
697
		           p.mBuildTime = 9990;
698
		           plannedPackage = findPackage(p.mAlias, packageCollection);
699
		         }
700
 
701
		         if ( plannedPackage == NULL_PACKAGE )
702
		         {
703
		           packageCollection.add(p);
704
		         }
705
		         else
706
		         {
707
		           plannedPackage.mVersion = "1.0.0000";
708
		         }
709
 
710
		         if ( setName.compareTo("iteration1") == 0 )
711
		         {
712
		           p = new Package(45, 22, "Banana", "1.1.0000.tim", ".tim", "Banana.tim", "CC::/vob/Banana::Banana_1.1.0000.tim", 'x');
713
		           plannedPackage = findPackage(p.mAlias, packageCollection);
714
 
715
		           if ( plannedPackage == NULL_PACKAGE )
716
		           {
717
		             packageCollection.add(p);
718
		           }
719
		           else
720
		           {
721
		             plannedPackage.mVersion = "1.1.0000";
722
		           }
723
 
724
		           p = new Package(18, 23, "Aardvark", "1.1.1000.tim", ".tim", "Aardvark.tim", "CC::/vob/Aardvark::Aardvark_1.1.1000.tim", 'x');
725
		           plannedPackage = findPackage(p.mAlias, packageCollection);
726
 
727
		           if ( plannedPackage == NULL_PACKAGE )
728
		           {
729
		             packageCollection.add(p);
730
		           }
731
		           else
732
		           {
733
		             plannedPackage.mVersion = "1.1.1000";
734
		           }
735
 
736
		           p = new Package(227, 24, "Car", "1.0.10000.tim", ".tim", "Car.tim", "CC::/vob/Car::Car_1.0.10000.tim", 'x');
737
		           plannedPackage = findPackage(p.mAlias, packageCollection);
738
 
739
		           if ( plannedPackage == NULL_PACKAGE )
740
		           {
741
		             packageCollection.add(p);
742
		           }
743
		           else
744
		           {
745
		             plannedPackage.mVersion = "1.0.10000";
746
		           }
747
		         }
748
 
749
		         if ( setName.compareTo("iteration1") != 0 
750
		           && setName.compareTo("iteration2") != 0 )
751
		         {
752
		           p = new Package(34, 2, "CommonDependency", "2.0.0000.tim", ".tim", "CommonDependency.tim", "CC::/vob/CommonDependency::CommonDependency_2.0.0000.tim", 'x');
753
		           plannedPackage = findPackage(p.mAlias, packageCollection);
754
 
755
		           if ( plannedPackage == NULL_PACKAGE )
756
		           {
757
		             packageCollection.add(p);
758
		           }
759
		           else
760
		           {
761
		             plannedPackage.mVersion = "2.0.0000";
762
		           }
763
		         }           
764
 
765
		         if ( setName.compareTo("iteration1") == 0 || setName.compareTo("iteration2") == 0 )
766
		         {
767
		             p = new Package(34, 9, "CommonDependency", "1.0.0000.tim", ".tim", "CommonDependency.tim", "CC::/vob/CommonDependency::CommonDependency_1.0.0000.tim", 'x');
768
		             plannedPackage = findPackage(p.mAlias, packageCollection);
769
 
770
		             if ( plannedPackage == NULL_PACKAGE )
771
		             {
772
		                 packageCollection.add(p);
773
		             }
774
		             else
775
		             {
776
		                 plannedPackage.mVersion = "1.0.0000";
777
		             }
778
		         }
779
 
780
		         /* released dependencies
781
		         * pv_id dpv_id pkg_name                     v_ext
782
		         * 8     9      CommonDependency             .tim
783
		         * 9     7      CotsWithFunnyVersion         .cots
784
		         * 10    9      CommonDependency             .tim
785
		         * 11    44     AdvisoryDependency           .tim
786
		         * 13    9      CommonDependency             .tim
787
		         * 15    99     CommonDependency             .tim
788
		         * 23    22     Banana                       .tim
789
		         * 24    23     Aardvark                     .tim
790
		         */
791
		         if ( setName.compareTo("iteration1") != 0 
792
		           && setName.compareTo("iteration2") != 0 )
793
		         {
794
		           p = findPackage(2, packageCollection);
7163 dpurdie 795
		           p.addDependency("CotsWithFunnyVersion.cots",7);
796
		           p.addDependency("UncommonDependency.tim",0);
7082 dpurdie 797
		         }
798
 
799
		         if ( setName.compareTo("iteration1") != 0 
800
		           && setName.compareTo("iteration2") != 0
801
		           && setName.compareTo("iteration3") != 0 )
802
		         {
803
		           p = findPackage(3, packageCollection);
7163 dpurdie 804
		           p.addDependency("CommonDependency.tim",2);
7082 dpurdie 805
		         }
806
 
807
		         if ( setName.compareTo("iteration1") != 0 
808
		           && setName.compareTo("iteration2") != 0
809
		           && setName.compareTo("iteration3") != 0
810
		           && setName.compareTo("iteration4") != 0 )
811
		         {
812
		           p = findPackage(4, packageCollection);
7163 dpurdie 813
		           p.addDependency("CommonDependency.tim",2);
7082 dpurdie 814
		         }
815
 
816
		         if ( setName.compareTo("iteration1") != 0 
817
		           && setName.compareTo("iteration2") != 0
818
		           && setName.compareTo("iteration3") != 0
819
		           && setName.compareTo("iteration4") != 0
820
		           && setName.compareTo("iteration5") != 0 )
821
		         {
822
		           p = findPackage(5, packageCollection);
7163 dpurdie 823
		           p.addDependency("UncommonDependency.tim",0);
7082 dpurdie 824
		         }
825
 
826
		         p = findPackage(8, packageCollection);
7163 dpurdie 827
		         p.addDependency("CommonDependency.tim",9);
7082 dpurdie 828
 
829
		         if ( setName.compareTo("iteration1") == 0 
830
		           || setName.compareTo("iteration2") == 0 )
831
		         {
832
		           p = findPackage(9, packageCollection);
7163 dpurdie 833
		           p.addDependency("CotsWithFunnyVersion.cots",7);
7082 dpurdie 834
		         }
835
 
836
		         if ( setName.compareTo("iteration1") == 0 
837
		           || setName.compareTo("iteration2") == 0
838
		           || setName.compareTo("iteration3") == 0 )
839
		         {
840
		           p = findPackage(10, packageCollection);
7163 dpurdie 841
		           p.addDependency("CommonDependency.tim",9);
7082 dpurdie 842
		         }
843
 
844
		         p = findPackage(11, packageCollection);
7163 dpurdie 845
		         p.addDependency("AdvisoryDependency.tim",44);
7082 dpurdie 846
 
847
		         if ( setName.compareTo("iteration1") == 0 
848
		           || setName.compareTo("iteration2") == 0
849
		           || setName.compareTo("iteration3") == 0
850
		           || setName.compareTo("iteration4") == 0 )
851
		         {
852
		           p = findPackage(13, packageCollection);
7163 dpurdie 853
		           p.addDependency("CommonDependency.tim",9);
7082 dpurdie 854
		         }
855
 
856
		         if ( setName.compareTo("iteration1") == 0 
857
		           || setName.compareTo("iteration2") == 0
858
		           || setName.compareTo("iteration3") == 0
859
		           || setName.compareTo("iteration4") == 0
860
		           || setName.compareTo("iteration5") == 0
861
		           || setName.compareTo("iteration6") == 0 )
862
		         {
863
		           p = findPackage(15, packageCollection);
7163 dpurdie 864
		           p.addDependency("CommonDependency.tim",99); // PVID not in the release
7082 dpurdie 865
		         }
866
		         else
867
		         {
868
		           p = findPackage(16, packageCollection);
7163 dpurdie 869
		           p.addDependency("CommonDependency.tim",2);
7082 dpurdie 870
		         }
871
 
872
		         if ( setName.compareTo("iteration1") == 0 )
873
		         {
874
		           p = findPackage(23, packageCollection);
7163 dpurdie 875
		           p.addDependency("Banana.tim", 22);
7082 dpurdie 876
 
877
		           p = findPackage(24, packageCollection);
7163 dpurdie 878
		           p.addDependency("Aardvark.tim", 23);
7082 dpurdie 879
		         }
880
 
881
		        /* released build info
882
		         * pv_id bm_name bsa_name
883
		         * 7     Solaris Debug
884
		         * 9     Linux   Debug
885
		         * 9     Solaris Debug
886
		         * 9     Win32   Production
887
		         * 10    Solaris Java 1.4
888
		         * 11    Linux   Production and Debug
889
		         * 12    Win32   Java 1.6
890
		         * 13    Generic Java 1.4
891
		         * 14    Linux   Debug
892
		         * 15    Linux   Debug
893
		         * 22    Linux   Java 1.6
894
		         * 23    Linux   Java 1.6
895
		         * 24    Linux   Java 1.6
896
		         */
897
		         if ( setName.compareTo("iteration1") != 0 )
898
		         {
899
		           p = findPackage(0, packageCollection);
900
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
901
		           p.mBuildStandardCollection.add(bs);
902
		         }
903
 
904
		         if ( setName.compareTo("iteration1") != 0 
905
		           && setName.compareTo("iteration2") != 0 )
906
		         {
907
		           p = findPackage(2, packageCollection);
908
		           bs = new BuildStandard(rippleEngine, "Linux", "Debug");
909
		           p.mBuildStandardCollection.add(bs);
910
		           bs = new BuildStandard(rippleEngine, "Solaris", "Production");
911
		           p.mBuildStandardCollection.add(bs);
912
		           bs = new BuildStandard(rippleEngine, "Win32", "Production and Debug");
913
		           p.mBuildStandardCollection.add(bs);
914
		         }
915
 
916
		         if ( setName.compareTo("iteration1") != 0 
917
		           && setName.compareTo("iteration2") != 0
918
		           && setName.compareTo("iteration3") != 0 )
919
		         {
920
		           p = findPackage(3, packageCollection);
921
		           bs = new BuildStandard(rippleEngine, "Solaris", "Java 1.4");
922
		           p.mBuildStandardCollection.add(bs);
923
		         }
924
 
925
		         if ( setName.compareTo("iteration1") != 0 
926
		           && setName.compareTo("iteration2") != 0
927
		           && setName.compareTo("iteration3") != 0
928
		           && setName.compareTo("iteration4") != 0 )
929
		         {
930
		           p = findPackage(4, packageCollection);
931
		           bs = new BuildStandard(rippleEngine, "Generic", "Java 1.5");
932
		           p.mBuildStandardCollection.add(bs);
933
		         }
934
 
935
		         if ( setName.compareTo("iteration1") != 0 
936
		           && setName.compareTo("iteration2") != 0
937
		           && setName.compareTo("iteration3") != 0
938
		           && setName.compareTo("iteration4") != 0
939
		           && setName.compareTo("iteration5") != 0 )
940
		         {
941
		           p = findPackage(5, packageCollection);
942
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
943
		           p.mBuildStandardCollection.add(bs);
944
		           bs = new BuildStandard(rippleEngine, "Win32", "Java 1.6");
945
		           p.mBuildStandardCollection.add(bs);
946
		         }
947
 
948
		         p = findPackage(7, packageCollection);
949
		         bs = new BuildStandard(rippleEngine, "Solaris", "Debug");
950
		         p.mBuildStandardCollection.add(bs);
951
 
952
		         if ( setName.compareTo("iteration1") == 0 || setName.compareTo("iteration2") == 0 )
953
		         {
954
		           p = findPackage(9, packageCollection);
955
		           bs = new BuildStandard(rippleEngine, "Linux", "Debug");
956
		           p.mBuildStandardCollection.add(bs);
957
		           bs = new BuildStandard(rippleEngine, "Solaris", "Debug");
958
		           p.mBuildStandardCollection.add(bs);
959
		           bs = new BuildStandard(rippleEngine, "Win32", "Production");
960
		           p.mBuildStandardCollection.add(bs);
961
		         }
962
 
963
		         if ( setName.compareTo("iteration1") == 0 
964
		           || setName.compareTo("iteration2") == 0
965
		           || setName.compareTo("iteration3") == 0 )
966
		         {
967
		           p = findPackage(10, packageCollection);
968
		           bs = new BuildStandard(rippleEngine, "Solaris", "Java 1.4");
969
		           p.mBuildStandardCollection.add(bs);
970
		         }
971
 
972
		         p = findPackage(11, packageCollection);
973
		         bs = new BuildStandard(rippleEngine, "Linux", "Production and Debug");
974
		         p.mBuildStandardCollection.add(bs);
975
 
976
		         p = findPackage(12, packageCollection);
977
		         bs = new BuildStandard(rippleEngine, "Win32", "Java 1.6");
978
		         p.mBuildStandardCollection.add(bs);
979
 
980
		         if ( setName.compareTo("iteration1") == 0 
981
		           || setName.compareTo("iteration2") == 0
982
		           || setName.compareTo("iteration3") == 0
983
		           || setName.compareTo("iteration4") == 0 )
984
		         {
985
		           p = findPackage(13, packageCollection);
986
		           bs = new BuildStandard(rippleEngine, "Generic", "Java 1.4");
987
		           p.mBuildStandardCollection.add(bs);
988
		         }
989
 
990
		         p = findPackage(14, packageCollection);
991
		         bs = new BuildStandard(rippleEngine, "Linux", "Debug");
992
		         p.mBuildStandardCollection.add(bs);
993
 
994
		         if ( setName.compareTo("iteration1") == 0 
995
		           || setName.compareTo("iteration2") == 0
996
		           || setName.compareTo("iteration3") == 0
997
		           || setName.compareTo("iteration4") == 0
998
		           || setName.compareTo("iteration5") == 0
999
		           || setName.compareTo("iteration6") == 0 )
1000
		         {
1001
		           p = findPackage(15, packageCollection);
1002
		           bs = new BuildStandard(rippleEngine, "Linux", "Debug");
1003
		           p.mBuildStandardCollection.add(bs);
1004
		         }
1005
		         else
1006
		         {
1007
		           p = findPackage(16, packageCollection);
1008
		           bs = new BuildStandard(rippleEngine, "Linux", "Debug");
1009
		           p.mBuildStandardCollection.add(bs);
1010
		         }        
1011
 
1012
		         if ( setName.compareTo("iteration1") == 0 )
1013
		         {
1014
		           p = findPackage(22, packageCollection);
1015
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
1016
		           p.mBuildStandardCollection.add(bs);
1017
 
1018
		           p = findPackage(23, packageCollection);
1019
		           bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
1020
		           p.mBuildStandardCollection.add(bs);
1021
 
1022
		           p = findPackage(24, packageCollection);
1023
		           bs = new BuildStandard(rippleEngine, "Solaris", "Java 1.6");
1024
		           p.mBuildStandardCollection.add(bs);
1025
		         }
1026
 
1027
		         /* released package unit test info
1028
		         * pv_id tt.test_type_name
1029
		         * 9     Manual Test
1030
		         * 9     Interactive Test
1031
		         * 9     Integration Test
1032
		         * 11    Autobuild UTF
1033
		         */
1034
		         if ( setName.compareTo("iteration1") != 0 
1035
		           && setName.compareTo("iteration2") != 0
1036
		           && setName.compareTo("iteration3") != 0
1037
		           && setName.compareTo("iteration4") != 0
1038
		           && setName.compareTo("iteration5") != 0 )
1039
		         {
1040
		           p = findPackage(5, packageCollection);
1041
		           p.mHasAutomatedUnitTests = true;
1042
		         }
1043
 
1044
		         p = findPackage(11, packageCollection);
1045
		         p.mHasAutomatedUnitTests = true;
1046
 
1047
		        /* released build failure email info
1048
		         * pv_id user_email
1049
		         * 10    jimmyfishcake@vixtechnology.com
1050
		         */
1051
		         if ( setName.compareTo("iteration1") != 0 
1052
		           && setName.compareTo("iteration2") != 0
1053
		           && setName.compareTo("iteration3") != 0 )
1054
		         {
1055
		           p = findPackage(3, packageCollection);
1056
		           p.addEmail("jimmyfishcake@vixtechnology.com");
1057
		           p.addEmail("rayhaddock@vixtechnology.com");
1058
		         }
1059
 
1060
		         if ( setName.compareTo("iteration1") != 0 
1061
		           && setName.compareTo("iteration2") != 0
1062
		           && setName.compareTo("iteration3") != 0
1063
		           && setName.compareTo("iteration4") != 0
1064
		           && setName.compareTo("iteration5") != 0 )
1065
		         {
1066
		           p = findPackage(5, packageCollection);
1067
		           p.addEmail("timbutdim@vixtechnology.com");
1068
		         }
1069
 
1070
		         if ( setName.compareTo("iteration1") == 0 
1071
		           || setName.compareTo("iteration2") == 0
1072
		           || setName.compareTo("iteration3") == 0 )
1073
		         {
1074
		           p = findPackage(10, packageCollection);
1075
		           p.addEmail("jimmyfishcake@vixtechnology.com");
1076
		         }
1077
 
1078
		        /* released advisory ripple info
1079
		         * pv_id
1080
		         * 14
1081
		         */
1082
		         if ( setName.compareTo("iteration1") != 0 )
1083
		         {
1084
		           p = findPackage(0, packageCollection);
1085
		           p.mAdvisoryRipple = true;
1086
		         }
1087
 
1088
		         p = findPackage(14, packageCollection);
1089
		         p.mAdvisoryRipple = true;
1090
 
1091
		         // Insert sequence for later sorting
1092
		         Package.setSequence(packageCollection);
1093
 
1094
		    }
6914 dpurdie 1095
	}
1096
 
1097
 
1098
    public DaemonBuildTestCase()
1099
    {
1100
        mLogger.debug("DaemonBuildTestCase");
1101
    }
1102
 
1103
    /**
1104
     * Test Case main line
1105
     */
1106
    public static void main(String[] args)
1107
    {
1108
        mLogger.debug("main");
1109
        JUnitCore.main("com.erggroup.buildtool.utf.DaemonBuildTestCase");
1110
    }
1111
 
1112
    /**
1113
     * set up performed prior to any test method
1114
     */
1115
    @BeforeClass
1116
    public static void TestCaseSetUp()
1117
    {
1118
        mLogger.debug("TestCaseSetUp");
1119
    }
1120
 
1121
    /**
1122
     * tear down performed after test methods
1123
     */
1124
    @AfterClass
1125
    public static void TestCaseTearDown()
1126
    {
1127
        mLogger.debug("TestCaseTearDown");
1128
    }
1129
 
1130
    /**
1131
     * set up performed prior to each test method
1132
     */
1133
    @Before
1134
    public void TestSetUp()
1135
    {
1136
        mLogger.debug("TestSetUp");
1137
        System.setProperty("vix.utf.name", "DaemonBuildTestCase");
1138
        Package.mGenericMachtype = "win32";
1139
        Package.mGbeDpkg = ".";
1140
    }
1141
 
1142
    /**
1143
     * tear down performed after each test method
1144
     */
1145
    @After
1146
    public void TestTearDown()
1147
    {
1148
        mLogger.debug("TestTearDown");
1149
    }
1150
 
1151
    /**
1152
     * test method designed primarily to test the sequence diagram spawn thread
1153
     * also tests thread control out of necessity:
1154
     * 1 constructs a BuildDaemon object, passing a connectionString of "unit test spawn thread"
1155
     * this utilises the following unit test hooks in the codebase:
1156
     * - BuildDaemon::BuildDaemon connectionString of "unit test spawn thread" exits while forever loop
1157
     * - BuildDaemon constructor, isActive and cleanUp made public for unit test use
1158
     * - ReleaseManager::queryReleaseConfig instantiates 2 ReleaseConfig objects
1159
     * with rcon_id's of 1 and 2, daemon_modes of 'M' and 'S' respectively, and gbebuildfilters of
1160
     * "unit test spawn thread"
1161
     * - MasterThread::run gbebuildfilter of "unit test spawn thread" limits method to sleep in while forever loop
1162
     * - SlaveThread::run gbebuildfilter of "unit test spawn thread" limits method to sleep in while forever loop
1163
     * 2 checks the number of threads in the thread group is 3 (mainline thread + MasterThread + SlaveThread)
1164
     * 3 checks isActive on the BuildDaemon object returns true when passed an rcon_id of 1
1165
     * 4 checks isActive on the BuildDaemon object returns true when passed an rcon_id of 2
1166
     * 5 checks isActive on the BuildDaemon object returns false when passed an rcon_id of 3
1167
     * 6 calls cleanUp on the BuildDaemon object
1168
     * 7 checks the number of threads in the thread group is 1 (mainline thread)
1169
     * 8 checks isActive on the BuildDaemon object returns false when passed an rcon_id of 1
1170
     * 9 checks isActive on the BuildDaemon object returns false when passed an rcon_id of 2
1171
     * 10 checks isActive on the BuildDaemon object returns false when passed an rcon_id of 3
1172
     */
1173
    @Test
1174
    public void TestSpawnThread()
1175
    {
1176
        mLogger.debug("TestSpawnThread");
1177
        int tcount;
1178
        releaseManager = new myReleaseManager("unit test spawn thread", "not used", "not used");
1179
        BuildDaemon buildDaemon = new BuildDaemon(releaseManager);
1180
        tcount = BuildThread.mThreadGroup.activeCount();
1181
        System.out.println("TestSpawnThread. tCount:" + tcount);
1182
        assertTrue(tcount == 2);
1183
        assertTrue(buildDaemon.isActive(1));
1184
        assertTrue(buildDaemon.isActive(2));
1185
        assertFalse(buildDaemon.isActive(3));
1186
        buildDaemon.cleanUp();
1187
        tcount = BuildThread.mThreadGroup.activeCount();
1188
        System.out.println("TestSpawnThread Cleanup. tCount:" + tcount);
1189
        assertTrue(tcount == 0);
1190
        assertFalse(buildDaemon.isActive(1));
1191
        assertFalse(buildDaemon.isActive(2));
1192
        assertFalse(buildDaemon.isActive(3));
1193
    }
1194
 
1195
    /**
1196
     * test method designed to test the sequence diagram coordinate slave thread:
1197
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test coordinate slave threads"
1198
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit test coordinate slave threads"
1199
     * this utilises the following unit test hooks in the codebase:
1200
     * - MasterThread constructor made public for unit test use
1201
     * - MasterThread::run gbebuildfilter of "unit test coordinate slave threads" limits method to the sequence diagram
1202
     * interrupts the thread if, on one pass, at least one RunLevel object does not have a run level DB_WAITING
1203
     * exits the while forever loop if, on one pass, all RunLevel objects have a run level DB_WAITING
1204
     * - ReleaseManager::queryRunLevel connectionString of "unit test coordinate slave threads" instantiates 2 RunLevel
1205
     * objects
1206
     * initially with run levels of waiting and idle
1207
     * subsequently with run levels both waiting
1208
     * 3 calls run on the MasterThread object
1209
     * 4 checks its thread has been interrupted
1210
     */
1211
    @Test
1212
    public void TestCoordinateSlaveThreads()
1213
    {
1214
        mLogger.debug("TestCoordinateSlaveThreads");
1215
        ReleaseManager releaseManager = new myReleaseManager("unit test coordinate slave threads", "not used", "not used");
1216
        MasterThread masterThread = new MasterThread(1, 1, releaseManager ,"unit test coordinate slave threads");
1217
        assertFalse(Thread.interrupted());
1218
        masterThread.run();
1219
        // interrupted checks and importantly clears the interrupted status of this thread for subsequent tests
1220
        assertTrue(Thread.interrupted());
1221
        assertFalse(Thread.interrupted());
1222
    }
1223
 
1224
    /**
1225
     * test method designed to test the sequence diagram generate build files
1226
     * note does not test the RippleEngine:
1227
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test generate build files"
1228
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit test generate build files"
1229
     * this utilises the following unit test hooks in the codebase:
1230
     * - MasterThread constructor made public for unit test use
1231
     * - MasterThread::run gbebuildfilter of "unit test generate build files" limits method to the sequence diagram
1232
     * exits the while forever loop
1233
     * - ReleaseManager::queryReleaseConfig instantiates 2 ReleaseConfig objects
1234
     * with rcon_id's of 1 and 2, daemon_modes of 'M' and 'S' respectively, and gbebuildfilters of
1235
     * "unit test spawn thread"
1236
     * - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
1237
     * 3 calls run on the MasterThread object
1238
     * 4 checks the first persisted run level is DB_ACTIVE
1239
     * 5 checks the second persisted run level is DB_ACTIVE
1240
     * 6 checks no further run levels were persisted
1241
     */
1242
    @Test
1243
    public void TestGenerateBuildFiles()
1244
    {
1245
        mLogger.debug("TestGenerateBuildFiles");
1246
        myReleaseManager releaseManager = new myReleaseManager("unit test generate build files", "not used", "not used");
1247
        MasterThread masterThread = new MasterThread(1, 1, releaseManager, "unit test generate build files");
1248
        masterThread.run();
1249
        assertTrue(RunLevelData.isAt(BuildState.DB_ACTIVE, releaseManager.mPersistedRunLevelCollection.get(0)));
1250
        assertTrue(RunLevelData.isAt(BuildState.DB_ACTIVE, releaseManager.mPersistedRunLevelCollection.get(1)));
1251
        assertTrue( releaseManager.mPersistedRunLevelCollection.size() == 2);
1252
    }
1253
 
1254
    /**
1255
     * test method designed to test the sequence diagram consume build files
1256
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test consume build files"
1257
     * 2 constructs a SlaveThread object, passing a gbebuildfilter of "unit test consume build files"
1258
     * this utilises the following unit test hooks in the codebase:
1259
     * - SlaveThread constructor made public for unit test use
1260
     * - SlaveThread::run gbebuildfilter of "unit test consume build files" limits method to the sequence diagram
1261
     * interrupts the thread if, on one pass, the current build file string is empty
1262
     * exits the while forever loop
1263
     * - ReleaseManager::queryRunLevel
1264
     * initially returns an empty current build file string
1265
     * subsequently returns a "unit test build file content" current build file string
1266
     * 3 calls run on the SlaveThread object
1267
     */
1268
     @Test
1269
    public void TestConsumeBuildFiles()
1270
    {
1271
        mLogger.debug("TestConsumeBuildFiles");
1272
        ReleaseManager releaseManager = new myReleaseManager("unit test consume build files", "not used", "not used");
1273
        SlaveThread slaveThread = new SlaveThread(1, 1, releaseManager, "unit test consume build files");
1274
        assertFalse(Thread.interrupted());
1275
        slaveThread.run();
1276
    }
1277
 
1278
    /**
1279
     * test method designed to test the sequence diagram allowed to proceed
1280
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test allowed to proceed"
1281
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit test allowed to proceed"
1282
     * this utilises the following unit test hooks in the codebase:
1283
     * - MasterThread constructor made public for unit test use
1284
     * - MasterThread::run gbebuildfilter of "unit test allowed to proceed" limits method to the sequence diagram
1285
     * exits the while forever loop
1286
     * - ReleaseManager::queryReleaseConfig, queryRunLevelSchedule, queryDirectedRunLevel methods return true
1287
     * - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
1288
     * 3 calls run on the MasterThread object
1289
     * 4 checks the first persisted run level is DB_IDLE
1290
     * 5 checks the second persisted run level is DB_IDLE
1291
     * 6 checks the third persisted run level is DB_WAITING
1292
     * 7 checks no further run levels were persisted
1293
     */
1294
    @Test
1295
    public void TestAllowedToProceed()
1296
    {
1297
        mLogger.debug("TestAllowedToProceed");
1298
        myReleaseManager releaseManager = new myReleaseManager("unit test allowed to proceed", "not used", "not used");
1299
        MasterThread masterThread = new MasterThread(1, 1, releaseManager, "unit test allowed to proceed");
1300
        masterThread.run();
1301
 
1302
        assertTrue( RunLevelData.isAt(BuildState.DB_IDLE, releaseManager.mPersistedRunLevelCollection.get(0)));
1303
        assertTrue( releaseManager.mPersistedRunLevelCollection.size() == 1);
1304
    }
1305
 
1306
    /**
1307
     * test method designed to test the sequence diagram not allowed to proceed
1308
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test not allowed to proceed"
1309
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit test not allowed to proceed"
1310
     * this utilises the following unit test hooks in the codebase:
1311
     * - MasterThread constructor made public for unit test use
1312
     * - MasterThread::run gbebuildfilter of "unit test not allowed to proceed" limits method to the sequence diagram
1313
     *   exits the while forever loop
1314
     * - ReleaseManager::queryReleaseConfig method returns true
1315
     * - ReleaseManager::queryRunLevelSchedule method returns false
1316
     * - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
1317
     * 3 calls run on the MasterThread object
1318
     * 4 checks the first persisted run level is DB_IDLE
1319
     * 5 checks the second persisted run level is DB_IDLE
1320
     * 6 checks the third persisted run level is DB_PAUSED
1321
     * 7 checks no further run levels were persisted
1322
     * nb cannot check only one thread is running,
1323
     * a Timer thread, though having run to completion, may still be "active"
1324
     */
1325
    @Test
1326
    public void TestNotAllowedToProceed()
1327
    {
1328
        mLogger.debug("TestNotAllowedToProceed");
1329
        myReleaseManager releaseManager = new myReleaseManager("unit test not allowed to proceed", "not used", "not used");
1330
        MasterThread masterThread = new MasterThread(1, 1, releaseManager, "unit test not allowed to proceed");
1331
        masterThread.run();
1332
 
1333
        assertTrue(RunLevelData.isAt(BuildState.DB_IDLE, releaseManager.mPersistedRunLevelCollection.get(0)));
1334
        assertTrue(RunLevelData.isAt(BuildState.DB_PAUSED, releaseManager.mPersistedRunLevelCollection.get(1)));
1335
        assertTrue( releaseManager.mPersistedRunLevelCollection.size() == 2);
1336
    }
1337
 
1338
    /**
1339
     * test method designed to test the sequence diagram exit
1340
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit test exit"
1341
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit test exit"
1342
     * this utilises the following unit test hooks in the codebase:
1343
     * - MasterThread constructor made public for unit test use
1344
     * - MasterThread::run gbebuildfilter of "unit test exit" limits method to the sequence diagram
1345
     * - ReleaseManager::queryReleaseConfig method returns false
1346
     * - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
1347
     * 3 calls run on the MasterThread object
1348
     * 4 checks the first persisted run level is DB_IDLE
1349
     * 5 checks no further run levels were persisted
1350
     */
1351
    @Test
1352
    public void TestExit()
1353
    {
1354
        mLogger.debug("TestExit");
1355
        myReleaseManager releaseManager = new myReleaseManager("unit test exit", "not used", "not used");
1356
        MasterThread masterThread = new MasterThread(1, 1, releaseManager, "unit test exit");
1357
        masterThread.run();
1358
 
1359
        assertTrue(RunLevelData.isAt(BuildState.DB_IDLE, releaseManager.mPersistedRunLevelCollection.get(0)));
1360
        assertTrue( releaseManager.mPersistedRunLevelCollection.size() == 1);
1361
    }
1362
 
1363
    /**
1364
     * test method designed to test the sequence diagram check environment
1365
     * 1 constructs a ReleaseManager object, passing a connectionString of "unit check environment"
1366
     * 2 constructs a MasterThread object, passing a gbebuildfilter of "unit check environment"
1367
     * this utilises the following unit test hooks in the codebase:
1368
     * - MasterThread constructor made public for unit test use
1369
     * - MasterThread::run gbebuildfilter of "unit test check environment" limits method to the sequence diagram
1370
     * exits the while forever loop
1371
     * - MasterThread::housekeep method does not call deleteDirectory
1372
     * - MasterThread::hasSufficientDiskSpace initially returns false, then true
1373
     * - ReleaseManager::updateCurrentRunLevel utilises the public mPersistedRunLevelCollection
1374
     * 3 calls run on the MasterThread object
1375
     * 4 checks the first persisted run level is DB_CANNOT_CONTINUE
1376
     * 5 checks the next persisted run level is DB_ACTIVE
1377
     * 6 checks no further run levels were persisted
1378
     */
1379
    @Test
1380
    public void TestCheckEnvironment()
1381
    {
1382
        mLogger.debug("TestCheckEnvironment");
1383
        myReleaseManager releaseManager = new myReleaseManager("unit test check environment", "not used", "not used");
1384
        MasterThread masterThread = new MasterThread(1, 1, releaseManager, "unit test check environment");
1385
        masterThread.run();
1386
        assertTrue(RunLevelData.isAt(BuildState.DB_CANNOT_CONTINUE, releaseManager.mPersistedRunLevelCollection.get(0)));
1387
        assertTrue(RunLevelData.isAt(BuildState.DB_ACTIVE, releaseManager.mPersistedRunLevelCollection.get(1)));
1388
        assertTrue( releaseManager.mPersistedRunLevelCollection.size() == 2);
1389
    }
1390
 
1391
    /**
7082 dpurdie 1392
     * I'm guessing as to the function of this test
1393
     * Test for:
1394
     *      Circular dependencies
1395
     *      Build Dependency not in the release
1396
     *      Package has no build environment
1397
     *      Package not built for configured platforms
1398
     *      A package is selected to be built
1399
     * 
6914 dpurdie 1400
     */
1401
    @Test
1402
    public void TestPlanRelease_1()
1403
    {
7082 dpurdie 1404
        mLogger.debug("TestPlanRelease - Iteration 1");
6914 dpurdie 1405
        System.out.println("TestPlanRelease - Iteration 1");
7082 dpurdie 1406
        releaseManager = new myReleaseManager("iteration1", "not used", "not used");
1407
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
1408
 
6914 dpurdie 1409
        try
1410
        {
1411
            rippleEngine.collectMetaData();
7082 dpurdie 1412
 
1413
            //  Generate basic test set and then tweak for this test
1414
            initTestPackages(releaseManager.mConnectionString);
1415
            createWip(1000, "UncommonDependency.tim");
1416
            createWip(1001, "DependencyMissingFromRelease.tim");
1417
            createWip(1002, "CommonDependency.tim");
1418
            createWip(1003, "SolarisCentricProduct.tim");
1419
            createWip(1004, "GenericProduct.tim");
1420
            createWip(1005, "Product.tim");
1421
            createWip(1006, "UnfinishedProduct.tim");
1422
            createWip(1007, "Banana.tim");
1423
 
6914 dpurdie 1424
            rippleEngine.planRelease(false);
1425
        }
1426
        catch (Exception e)
1427
        {
1428
        }
1429
 
1430
        boolean rv;
1431
        BuildFile buildFile;
1432
 
1433
        buildFile = rippleEngine.getFirstBuildFileContent();
1434
        assertTrue(buildFile != null);
1435
        assertTrue(buildFile.state != BuildFileState.Dummy);
1436
        assertTrue(buildFile.state != BuildFileState.Empty);
1437
 
1438
        rv = Utilities.checkBuildfile(buildFile.content, "daemon1");
1439
        assertTrue(rv);
1440
 
1441
        buildFile = rippleEngine.getNextBuildFileContent();
1442
        assertTrue(buildFile != null);
1443
        assertTrue(buildFile.state == BuildFileState.Empty);
1444
    }
1445
 
1446
    @Test
1447
    public void TestPlanRelease_2()
1448
    {
1449
        //
1450
        System.out.println("TestPlanRelease - Iteration 2");
1451
        releaseManager = new myReleaseManager("iteration2", "not used", "not used");
7082 dpurdie 1452
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
6914 dpurdie 1453
 
1454
        // this is all the MasterThread does
1455
        try
1456
        {
1457
            rippleEngine.collectMetaData();
7082 dpurdie 1458
            initTestPackages(releaseManager.mConnectionString);
1459
 
1460
            createWip(1001, "DependencyMissingFromRelease.tim");
1461
            createWip(1002, "CommonDependency.tim");
1462
            createWip(1003, "SolarisCentricProduct.tim");
1463
            createWip(1004, "GenericProduct.tim");
1464
            createWip(1005, "Product.tim");
1465
            createWip(1006, "UnfinishedProduct.tim");
1466
            createWip(1007, "Banana.tim");
1467
 
6914 dpurdie 1468
            rippleEngine.planRelease(false);
1469
        }
1470
        catch (Exception e)
1471
        {
1472
        }
1473
 
1474
        boolean rv;
1475
        BuildFile buildFile;
1476
 
1477
        buildFile = rippleEngine.getFirstBuildFileContent();
1478
        assertTrue(buildFile != null);
1479
        assertTrue(buildFile.state != BuildFileState.Dummy);
1480
        assertTrue(buildFile.state != BuildFileState.Empty);
1481
 
1482
        rv = Utilities.checkBuildfile(buildFile.content, "daemon2");
1483
        assertTrue(rv);
1484
 
1485
        buildFile = rippleEngine.getNextBuildFileContent();
1486
        assertTrue(buildFile != null);
1487
        assertTrue(buildFile.state == BuildFileState.Empty);
1488
    }
1489
 
1490
    @Test
1491
    public void TestPlanRelease_3()
1492
    {
1493
        //
1494
        System.out.println("TestPlanRelease - Iteration 3");
1495
        releaseManager = new myReleaseManager("iteration3", "not used", "not used");
7082 dpurdie 1496
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
1497
 
6914 dpurdie 1498
        // this is all the MasterThread does
1499
        try
1500
        {
1501
            rippleEngine.collectMetaData();
7082 dpurdie 1502
            initTestPackages(releaseManager.mConnectionString);
1503
 
1504
            createWip(1001, "DependencyMissingFromRelease.tim");
1505
            createWip(1003, "SolarisCentricProduct.tim");
1506
            createWip(1004, "GenericProduct.tim");
1507
            createWip(1005, "Product.tim");
1508
            createWip(1006, "UnfinishedProduct.tim");
1509
 
6914 dpurdie 1510
            rippleEngine.planRelease(false);
1511
        }
1512
        catch (Exception e)
1513
        {
1514
        }
1515
 
1516
        boolean rv;
1517
        BuildFile buildFile;
1518
 
1519
        buildFile = rippleEngine.getFirstBuildFileContent();
1520
        assertTrue(buildFile != null);
1521
        assertTrue(buildFile.state != BuildFileState.Dummy);
1522
        assertTrue(buildFile.state != BuildFileState.Empty);
1523
 
1524
        rv = Utilities.checkBuildfile(buildFile.content, "daemon3");
1525
        assertTrue(rv);
1526
 
1527
        buildFile = rippleEngine.getNextBuildFileContent();
1528
        assertTrue(buildFile != null);
1529
        assertTrue(buildFile.state == BuildFileState.Empty);
1530
    }
1531
 
1532
    @Test
1533
    public void TestPlanRelease_4()
1534
    {
1535
 
1536
        // 
1537
        System.out.println("TestPlanRelease - Iteration 4");
1538
        releaseManager = new myReleaseManager("iteration4", "not used", "not used");
7082 dpurdie 1539
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
6914 dpurdie 1540
 
1541
        // this is all the MasterThread does
1542
        try
1543
        {
1544
            rippleEngine.collectMetaData();
7082 dpurdie 1545
 
1546
            initTestPackages(releaseManager.mConnectionString);
1547
            createWip(1001, "DependencyMissingFromRelease.tim");
1548
            createWip(1004, "GenericProduct.tim");
1549
            createWip(1005, "Product.tim");
1550
            createWip(1006, "UnfinishedProduct.tim");
1551
 
6914 dpurdie 1552
            rippleEngine.planRelease(false);
1553
        }
1554
        catch (Exception e)
1555
        {
1556
        }
1557
 
1558
        boolean rv;
1559
        BuildFile buildFile;
1560
 
1561
        buildFile = rippleEngine.getFirstBuildFileContent();
1562
        assertTrue(buildFile != null);
1563
        assertTrue(buildFile.state != BuildFileState.Dummy);
1564
        assertTrue(buildFile.state != BuildFileState.Empty);
1565
 
1566
        rv = Utilities.checkBuildfile(buildFile.content, "daemon4");
1567
        assertTrue(rv)
1568
        ;
1569
        buildFile = rippleEngine.getNextBuildFileContent();
1570
        assertTrue(buildFile != null);
1571
        assertTrue(buildFile.state == BuildFileState.Empty);
1572
    }
1573
 
1574
    @Test
1575
    public void TestPlanRelease_5()
1576
    {
1577
 
1578
        //
1579
        System.out.println("TestPlanRelease - Iteration 5");
1580
        releaseManager = new myReleaseManager("iteration5", "not used", "not used");
7082 dpurdie 1581
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
6914 dpurdie 1582
 
1583
        // this is all the MasterThread does
1584
        try
1585
        {
1586
            rippleEngine.collectMetaData();
7082 dpurdie 1587
 
1588
            initTestPackages(releaseManager.mConnectionString);
1589
            createWip(1001, "DependencyMissingFromRelease.tim");
1590
            createWip(1005, "Product.tim");
1591
            createWip(1006, "UnfinishedProduct.tim");
1592
 
6914 dpurdie 1593
            rippleEngine.planRelease(false);
1594
        }
1595
        catch (Exception e)
1596
        {
1597
        }
1598
 
1599
        boolean rv;
1600
        BuildFile buildFile;
1601
 
1602
        buildFile = rippleEngine.getFirstBuildFileContent();
1603
        assertTrue(buildFile != null);
1604
        assertTrue(buildFile.state != BuildFileState.Dummy);
1605
        assertTrue(buildFile.state != BuildFileState.Empty);
1606
 
1607
        rv = Utilities.checkBuildfile(buildFile.content, "daemon5");
1608
        assertTrue(rv);
1609
 
1610
        buildFile = rippleEngine.getNextBuildFileContent();
1611
        assertTrue(buildFile != null);
1612
        assertTrue(buildFile.state == BuildFileState.Empty);
1613
    }
1614
 
1615
    @Test
1616
    public void TestPlanRelease_6()
1617
    {
1618
 
1619
        //
1620
        System.out.println("TestPlanRelease - Iteration 6");
1621
        releaseManager = new myReleaseManager("iteration6", "not used", "not used");
7082 dpurdie 1622
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
6914 dpurdie 1623
 
1624
        // this is all the MasterThread does
1625
        try
1626
        {
1627
            rippleEngine.collectMetaData();
7082 dpurdie 1628
 
1629
            initTestPackages(releaseManager.mConnectionString);
1630
            createWip(1001, "DependencyMissingFromRelease.tim");
1631
            createWip(1006, "UnfinishedProduct.tim");
1632
 
6914 dpurdie 1633
            rippleEngine.planRelease(false);
1634
        }
1635
        catch (Exception e)
1636
        {
1637
        }
1638
 
1639
        boolean rv;
1640
        BuildFile buildFile;
1641
 
1642
        buildFile = rippleEngine.getFirstBuildFileContent();
1643
        assertTrue(buildFile != null);
1644
        assertTrue(buildFile.state != BuildFileState.Dummy);
1645
        assertTrue(buildFile.state != BuildFileState.Empty);
1646
 
1647
        rv = Utilities.checkBuildfile(buildFile.content, "daemon6");
1648
        assertTrue(rv);
1649
 
1650
        buildFile = rippleEngine.getNextBuildFileContent();
1651
        assertTrue(buildFile != null);
1652
        assertTrue(buildFile.state == BuildFileState.Empty);
1653
    }
1654
 
1655
    @Test
1656
    public void TestPlanRelease_7()
1657
    {
1658
 
1659
        //
1660
        System.out.println("TestPlanRelease - Iteration 7");
1661
        releaseManager = new myReleaseManager("iteration7", "not used", "not used");
7082 dpurdie 1662
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
6914 dpurdie 1663
 
1664
        // this is all the MasterThread does
1665
        try
1666
        {
1667
            rippleEngine.collectMetaData();
7082 dpurdie 1668
 
1669
            initTestPackages(releaseManager.mConnectionString);
1670
            createWip(1001, "DependencyMissingFromRelease.tim");
1671
            createWip(1006, "UnfinishedProduct.tim");
1672
 
6914 dpurdie 1673
            rippleEngine.planRelease(false);
1674
        }
1675
        catch (Exception e)
1676
        {
1677
        }
1678
 
1679
        boolean rv;
1680
        BuildFile buildFile;
1681
 
1682
        buildFile = rippleEngine.getFirstBuildFileContent();
1683
        assertTrue(buildFile != null);
1684
        assertTrue(buildFile.state == BuildFileState.Dummy);
1685
 
1686
        rv = Utilities.checkBuildfile(buildFile.content, "daemon7");
1687
        assertTrue(rv);
1688
 
1689
        buildFile = rippleEngine.getNextBuildFileContent();
1690
        assertTrue(buildFile != null);
1691
        assertTrue(buildFile.state == BuildFileState.Empty);
1692
    }
1693
 
1694
}