Subversion Repositories DevTools

Rev

Rev 7082 | Go to most recent revision | 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
import java.sql.SQLException;
4
import java.util.ArrayList;
5
import java.util.List;
6
 
7
import com.erggroup.buildtool.ripple.BuildExclusion;
8
import com.erggroup.buildtool.ripple.BuildFile;
9
import com.erggroup.buildtool.ripple.Package;
7169 dpurdie 10
import com.erggroup.buildtool.ripple.PlanControl;
6914 dpurdie 11
import com.erggroup.buildtool.ripple.ReleaseManager;
12
import com.erggroup.buildtool.ripple.RippleEngine;
13
import com.erggroup.buildtool.ripple.ReleaseConfig;
14
import com.erggroup.buildtool.ripple.RunLevelData;
15
import com.erggroup.buildtool.ripple.RunLevel.BuildState;
16
 
17
 
18
/** Subclass and override key methods so that the test can control
19
 *  the data being used
20
 */
21
public class ReleaseManagerUtf extends ReleaseManager 
22
{
23
    int mAreleaseManagerUtf = 2;
24
 
25
    /** Container of persisted run levels for unit test usage
26
     * @attribute
27
     */
28
    public List<Integer> mPersistedRunLevelCollection = new ArrayList<Integer>();
29
 
30
 
31
    public ReleaseManagerUtf(final String connectionString, final String username, final String password)
32
    {
33
        super(connectionString, username, password);
7046 dpurdie 34
        mUseDatabase = false;
6914 dpurdie 35
    }
36
 
37
    public ReleaseManagerUtf()
38
    {
39
        super();
7046 dpurdie 40
        mUseDatabase = false;
6914 dpurdie 41
    }
42
 
43
    //
44
    //  Used by Slave
45
    //      Set a single run level entry
46
    //
47
    @Override
48
    public void querySingleRunLevel(final int rconId, String hostname, char daemonMode) throws SQLException, Exception
49
    {
50
        mRunLevelCollection.clear();
51
        RunLevelData runLevel = new RunLevelData(rconId, BuildState.DB_ACTIVE, 'S', 1);
52
        mRunLevelCollection.add(runLevel);
53
    }
54
 
55
    //
56
    //  Used by Master
57
    //
58
    @Override
59
    public void queryRunLevel(final int rtag_id) throws SQLException, Exception
60
    {
61
        // Nothing to do here
62
    }
63
 
64
    // Used by Master and Slave
65
    @Override
66
    public int queryMasterCount(final int rtag_id) throws SQLException, Exception
67
    {
68
        return 1;
69
    }
70
 
71
    @Override
72
    public void queryReleaseConfig(final int rtag_id) throws SQLException, Exception
73
    {
74
        mReleaseConfigCollection.resetData();
75
 
76
        ReleaseConfig releaseConfig = new ReleaseConfig(1,1,'M', "LinuxHost","BuildLinux", "linux_i386", "Linux");
77
        mReleaseConfigCollection.add(releaseConfig);
78
 
79
        releaseConfig = new ReleaseConfig(1,2,'S', "SparcHost","BuildSparc", "sparc", "Solaris");
80
        mReleaseConfigCollection.add(releaseConfig);
81
 
82
        releaseConfig = new ReleaseConfig(1,3,'S', "Sparc10X86Host","BuildSparc10X86", "solaris10_x86", "Solaris");
83
        mReleaseConfigCollection.add(releaseConfig);
84
 
85
    }
86
 
87
    @Override
88
    public String queryMailServer() throws SQLException, Exception
89
    {
90
        return "dummyEmailServer.vixtechnology.com";
91
    }
92
 
93
    @Override
94
    public String queryMailSender() throws SQLException, Exception
95
    {
96
        return "dummyEmailSender.vixtechnology.com";
97
    }
98
 
99
    @Override
100
    public String queryGlobalAddresses() throws SQLException, Exception
101
    {
102
        return "dummyEmailSender.vixtechnology.com";
103
    }
104
 
105
    @Override
106
    public String queryBaselineName(int baseline) throws SQLException, Exception
107
    {
108
        return "TIMBUKTU (TIM) > R7";
109
    }
110
 
111
    @Override
112
    public List<String> queryProjectEmail(int baseline) throws SQLException
113
    {
114
        ArrayList<String> emailCollection = new ArrayList<String>();
115
        emailCollection.add("global1@vixtechnology.com");
116
        emailCollection.add("global2@vixtechnology.com");
117
        emailCollection.add("global1@vixtechnology.com");
118
        return emailCollection;
119
    }
120
 
121
    @Override
122
    public void connect()
123
    {
124
        // Nothing to do here
125
    }
126
 
127
    @Override
128
    public void disconnect()
129
    {
130
        // Nothing to do here
131
    }
132
 
133
    @Override
134
    public void queryBuildExclusions(List<BuildExclusion> buildExclusionCollection, int baseline)
135
            throws SQLException, Exception
136
    {
137
        //  Nothing to do here
138
    }
139
 
140
    @Override
141
    public void queryPackageVersions(RippleEngine rippleEngine, ArrayList<Package> packageCollection,
142
            int baseline) throws SQLException, Exception
143
    {
144
        // Nothing to do here
145
    }
146
 
147
    @Override
7082 dpurdie 148
    public void queryWips(RippleEngine rippleEngine, ArrayList<Package> packageCollection, int baseline) throws SQLException, Exception
149
    {
150
    }
151
 
152
    @Override
153
    public void queryTest(RippleEngine rippleEngine, ArrayList<Package> packageCollection, int baseline) throws SQLException, Exception
154
    {
155
    }
156
 
157
    @Override
158
    public void queryRipples(RippleEngine rippleEngine, ArrayList<Package> packageCollection, int baseline) throws SQLException, Exception
159
    {
160
    }
161
 
162
    @Override
7169 dpurdie 163
    public void queryPlanControl(int mRtagId, PlanControl mPlanControl) throws Exception
164
    {
165
    }
166
 
167
    @Override
6914 dpurdie 168
    public int queryRtagIdForSbom(int sbomId) throws SQLException
169
    {
170
        return 123456;
171
    }
172
 
173
    @Override
174
    public void updateCurrentRunLevel(final int rconId, final int runLevel) throws SQLException, Exception
175
    {
176
        Integer i = Integer.valueOf(runLevel);
177
        mPersistedRunLevelCollection.add(i);
178
    }
179
 
180
    @Override
181
    public long currentTimeMillis()
182
    {
183
        return 123456789;
184
    }
185
 
186
    @Override
187
    public String getMajorVersionNumber()
188
    {
189
        return "11";
190
    }
191
 
192
    @Override
193
    public void publishBuildFile(int rtag_id, BuildFile buildFile) throws SQLException, Exception
194
    {
195
    }
196
}
197
 
198