Subversion Repositories DevTools

Rev

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