Subversion Repositories DevTools

Rev

Rev 7033 | Rev 7163 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7033 Rev 7082
Line 37... Line 37...
37
    }
37
    }
38
	  
38
	  
39
    /** Subclass and override key methods so that the test can control
39
    /** Subclass and override key methods so that the test can control
40
     *  the data being used
40
     *  the data being used
41
     */
41
     */
42
    public class myReleaseManager extends ReleaseManagerUtf
42
    public class MyReleaseManager extends ReleaseManagerUtf
43
	{
43
	{
44
		public myReleaseManager(final String connectionString, final String username, final String password)
44
		public MyReleaseManager(final String connectionString, final String username, final String password)
45
		{
45
		{
46
			super(connectionString, username, password);
46
			super(connectionString, username, password);
47
		}
47
		}
48
 
48
 
-
 
49
		@Override
49
		public String queryBaselineName(int baseline) throws SQLException, Exception
50
		public String queryBaselineName(int baseline) throws SQLException, Exception
50
		{
51
		{
51
			return "Unbuildable Package Test";
52
			return "Unbuildable Package Test";
52
		}
53
		}
53
 
54
 
54
 
55
		@Override
55
		public void queryPackageVersions(RippleEngine rippleEngine, ArrayList<Package> packageCollection,
56
		public void queryPackageVersions(RippleEngine rippleEngine, ArrayList<Package> packageCollection,
56
				int baseline) throws SQLException, Exception
57
				int baseline) throws SQLException, Exception
57
		{
58
		{
58
			BuildStandard	bs = null;
59
			BuildStandard	bs = null;
59
			Package p = null;
60
			Package p = null;
60
		
61
		
61
			//	Flag packages in the full release - by pv_id
62
			//	Flag packages in the full release - by pv_id
62
			rippleEngine.mReleasedPvIDCollection.add(1);
-
 
63
			rippleEngine.mReleasedPvIDCollection.add(2);
-
 
64
			
63
			
65
			p = new Package(76, 1, "Package1", "1.0.0000", ".p1","Package1.p1", "Package1_vcstag", 'b', 'P');
64
			p = new Package(76, 1, "Package1", "1.0.0000", ".p1","Package1.p1", "Package1_vcstag", 'b', 'P');
66
			//p.mDirectlyPlanned = true;
-
 
67
			bs = new BuildStandard(rippleEngine, "Win32", "Java 1.6");
65
			bs = new BuildStandard(rippleEngine, "Win32", "Java 1.6");
68
			p.mBuildStandardCollection.add(bs);
66
			p.mBuildStandardCollection.add(bs);
69
			packageCollection.add(p);
67
			packageCollection.add(p);
70
			
68
			
71
 
69
 
72
			p = new Package(1011, 2, "Package2", "2.0.0000", ".p2","Package2.p1", "Package2_vcstag", 'b', 'P');
70
			p = new Package(1011, 2, "Package2", "2.0.0000", ".p2","Package2.p1", "Package2_vcstag", 'b', 'P');
73
			//p.mDirectlyPlanned = true;
-
 
74
			bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
71
			bs = new BuildStandard(rippleEngine, "Linux", "Java 1.6");
75
			p.mBuildStandardCollection.add(bs);
72
			p.mBuildStandardCollection.add(bs);
76
			packageCollection.add(p);
73
			packageCollection.add(p);
77
			
74
			
78
			
-
 
79
			//	Planned dependencies
75
			//	Planned dependencies
80
			//		p2 depends on p1
76
			//		p2 depends on p1
81
			p = findPackage(2, packageCollection);
77
			p = findPackage(2, packageCollection);
82
			p.mDependencyCollection.add("Package1.p1");
78
			p.mDependencyCollection.add("Package1.p1");
83
			p.mDependencyIDCollection.add(1);
79
			p.mDependencyIDCollection.add(1);
Line 88... Line 84...
88
	/**
84
	/**
89
	 * @throws java.lang.Exception
85
	 * @throws java.lang.Exception
90
	 */
86
	 */
91
	@Before
87
	@Before
92
	public void setUp() throws Exception {
88
	public void setUp() throws Exception {
93
		releaseManager = new myReleaseManager("UnbuildablePackageRipple", "not used", "not used");
89
		releaseManager = new MyReleaseManager("UnbuildablePackageRipple", "not used", "not used");
94
		rippleEngine = new RippleEngine(releaseManager, 11111, true);
90
		rippleEngine = new RippleEngine(releaseManager, 11111, true);
95
 
91
 
96
		// Force a known machtype
92
		// Force a known machtype
97
		Package.mGenericMachtype = "win32";
93
		Package.mGenericMachtype = "win32";
98
 
94
 
99
		try {
95
		try {
100
			rippleEngine.collectMetaData();
96
			rippleEngine.collectMetaData();
101
			rippleEngine.planRelease(false);
97
			rippleEngine.planRelease(false);
102
		} catch (Exception e) {
98
		} catch (Exception e) {
-
 
99
		    //    Keep quiet about this exception
103
		}
100
		}
104
	}
101
	}
105
 
102
 
106
	/**
103
	/**
107
	 * @throws java.lang.Exception
104
	 * @throws java.lang.Exception
108
	 */
105
	 */
109
	@After
106
	@After
110
	public void tearDown() throws Exception {
107
	public void tearDown() throws Exception {
-
 
108
	    // Nothing to do here
111
	}
109
	}
112
 
110
 
113
	@Test
111
	@Test
114
	public void test() {
112
	public void test() {
115
 
113
 
116
		boolean rv;
114
		boolean rv;
117
		BuildFile buildFile;
115
		BuildFile buildFile;
118
		System.out.println("Working Directory = " +               System.getProperty("user.dir"));
116
		System.out.println("Working Directory = " + System.getProperty("user.dir"));
119
		
117
		
120
		buildFile = rippleEngine.getFirstBuildFileContent();
118
		buildFile = rippleEngine.getFirstBuildFileContent();
121
        assertTrue(buildFile != null);
119
        assertTrue(buildFile != null);
122
        assertTrue(buildFile.state != BuildFileState.Empty);
120
        assertTrue(buildFile.state != BuildFileState.Empty);
123
 
121