Subversion Repositories DevTools

Rev

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

Rev 7231 Rev 7282
Line 1... Line 1...
1
package com.erggroup.buildtool.utf;
1
package com.erggroup.buildtool.utf;
2
 
2
 
3
 
3
 
4
import java.sql.SQLException;
4
import java.sql.SQLException;
-
 
5
import java.util.ArrayList;
5
import java.util.Iterator;
6
import java.util.Iterator;
-
 
7
import java.util.List;
6
 
8
 
-
 
9
import com.erggroup.buildtool.ripple.BuildExclusion;
7
import com.erggroup.buildtool.ripple.BuildFile;
10
import com.erggroup.buildtool.ripple.BuildFile;
8
import com.erggroup.buildtool.ripple.BuildFile.BuildFileState;
11
import com.erggroup.buildtool.ripple.BuildFile.BuildFileState;
9
import com.erggroup.buildtool.ripple.BuildStandard;
12
import com.erggroup.buildtool.ripple.BuildStandard;
10
import com.erggroup.buildtool.ripple.ReleaseManager;
13
import com.erggroup.buildtool.ripple.ReleaseManager;
11
import com.erggroup.buildtool.ripple.Package;
14
import com.erggroup.buildtool.ripple.Package;
Line 33... Line 36...
33
	RippleEngine                rippleEngine   = null;
36
	RippleEngine                rippleEngine   = null;
34
	PackageCollection testPackageCollection         = new PackageCollection();
37
	PackageCollection testPackageCollection         = new PackageCollection();
35
	PackageCollection testPackageCollectionTest     = new PackageCollection();
38
	PackageCollection testPackageCollectionTest     = new PackageCollection();
36
	PackageCollection testPackageCollectionWip      = new PackageCollection();
39
	PackageCollection testPackageCollectionWip      = new PackageCollection();
37
	PackageCollection testPackageCollectionRipple   = new PackageCollection();
40
	PackageCollection testPackageCollectionRipple   = new PackageCollection();
-
 
41
	ArrayList<BuildExclusion> mBuildExclusionCollection = new ArrayList<BuildExclusion>();
38
 
42
	        
39
	/**
43
	/**
40
	 * Init the package set
44
	 * Init the package set
41
	 */
45
	 */
42
	public void initTestPackages(String setName, int basePvid)
46
	public void initTestPackages(String setName, int basePvid)
43
	{
47
	{
Line 198... Line 202...
198
			}
202
			}
199
		}
203
		}
200
		return wip;
204
		return wip;
201
	}
205
	}
202
 
206
 
-
 
207
	/** Create a buildExclusion and add to the list for Release Manager
-
 
208
	 * 
-
 
209
	 *    @param  identifier - pvid of the package being excluded
-
 
210
	 *    @param  rootIdentifier  - pvid of the root package causing the exclusion. May be -1
-
 
211
	 *    @param  rootCause - Short (< 50 Char) string explaining the cause
-
 
212
	 *    @param  testBuildInstruction - Indicates a text build instruction
-
 
213
	 *    @return The entry that was created
-
 
214
	 */
-
 
215
	private BuildExclusion createBuildExclusion (int identifier, int rootIdentifier, String rootCause, int testBuildInstruction )
-
 
216
	{
-
 
217
	    BuildExclusion be = new BuildExclusion(identifier, rootIdentifier, rootCause, testBuildInstruction);
-
 
218
	    mBuildExclusionCollection.add(be);
-
 
219
	    return be;
-
 
220
	}
203
 
221
 
204
 
222
 
205
	/** Subclass and override key methods so that the test can control
223
	/** Subclass and override key methods so that the test can control
206
	 *  the data being used
224
	 *  the data being used
207
	 */
225
	 */
Line 282... Line 300...
282
		@Override
300
		@Override
283
		public void queryPlanControl(int mRtagId, PlanControl mPlanControl) throws Exception
301
		public void queryPlanControl(int mRtagId, PlanControl mPlanControl) throws Exception
284
		{
302
		{
285
			mPlanControl.setThreshold(20);
303
			mPlanControl.setThreshold(20);
286
		}
304
		}
-
 
305
		
-
 
306
	    @Override
-
 
307
	    public void queryBuildExclusions(List<BuildExclusion> buildExclusionCollection, int baseline) throws SQLException, Exception
-
 
308
	    {
-
 
309
	        buildExclusionCollection.addAll(mBuildExclusionCollection);
-
 
310
	    }
287
 
311
 
288
	}
312
	}
289
 
313
 
290
 
314
 
291
	public DaemonRippleTestCase()
315
	public DaemonRippleTestCase()
Line 1498... Line 1522...
1498
        catch (Exception e)
1522
        catch (Exception e)
1499
        {
1523
        {
1500
        }
1524
        }
1501
 
1525
 
1502
        checkBuildFile(tName);
1526
        checkBuildFile(tName);
1503
 
-
 
1504
    }
1527
    }
1505
 
1528
 
-
 
1529
    /**
-
 
1530
     *  Create a mesh of packages
-
 
1531
     *  Mark bottom as being rippled - so that it will build
-
 
1532
     *  Create a WIP for the package
-
 
1533
     *  Create a Build Exclusion for the WIP - it failed to build
-
 
1534
     *  
-
 
1535
     *  Expect nothing to build
-
 
1536
     *  
-
 
1537
     */
-
 
1538
    @Test
-
 
1539
    public void RippleTest_22()
-
 
1540
    {
-
 
1541
        String tName = "ripple22";
-
 
1542
        mLogger.debug("RippleTest {}", tName);
-
 
1543
        System.out.println("RippleTest " + tName);
-
 
1544
        releaseManager = new myReleaseManager(tName, "not used", "not used");
-
 
1545
        rippleEngine = new RippleEngine(releaseManager, 11111, true);
-
 
1546
 
-
 
1547
        try
-
 
1548
        {
-
 
1549
            rippleEngine.collectMetaData();
-
 
1550
 
-
 
1551
            //  Generate basic test set and then tweak for this test
-
 
1552
            /*    A basic set of packages
-
 
1553
             */
-
 
1554
            Package  p1 = createPackage(1, "p1");
-
 
1555
            Package  p2 = createPackage(2, "p2");
-
 
1556
            Package  p3 = createPackage(3, "p3");
-
 
1557
            Package  p4 = createPackage(4, "p4");
-
 
1558
            Package  p5 = createPackage(5, "p5");
-
 
1559
            Package  p6 = createPackage(6, "p6");
-
 
1560
            
-
 
1561
            testPackageCollection.add(p1);
-
 
1562
            testPackageCollection.add(p2);
-
 
1563
            testPackageCollection.add(p3);
-
 
1564
            testPackageCollection.add(p4);
-
 
1565
            testPackageCollection.add(p5);
-
 
1566
            testPackageCollection.add(p6);
-
 
1567
            
-
 
1568
            p2.addDependency(p1);
-
 
1569
            p3.addDependency(p2);
-
 
1570
            p4.addDependency(p3);
-
 
1571
            p5.addDependency(p4);            
-
 
1572
            
-
 
1573
            ripplePackage("p1.cr");
-
 
1574
            Package p2Wip = createWip(2000, "p2.cr");
-
 
1575
            createBuildExclusion(p2Wip.mId, -1, null, 0);
-
 
1576
            
-
 
1577
            // Force some output
-
 
1578
            requestRipple("p6.cr");
-
 
1579
            
-
 
1580
            rippleEngine.planRelease(false);
-
 
1581
        }
-
 
1582
        catch (Exception e)
-
 
1583
        {
-
 
1584
        }
-
 
1585
 
-
 
1586
        checkBuildFile(tName);
-
 
1587
    }
1506
}
1588
}