рефакторинг сборки Сапфора. Перевел ее в планировщик задач тестирования сапфора. осталось при проверке бд это отобразить.
This commit is contained in:
@@ -244,6 +244,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
Print("Получить первую активную версию Sapfor для сборки");
|
||||
GetSapforForCompilation();
|
||||
break;
|
||||
case GetMaxSapforVersion:
|
||||
Print("Получить максимальную установленную версию Sapfor");
|
||||
GetSapforMaxVersion();
|
||||
break;
|
||||
default:
|
||||
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
||||
}
|
||||
@@ -333,6 +337,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = db.getSapforCopyForCompilation();
|
||||
}
|
||||
void GetSapforMaxVersion() throws Exception{
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = db.getInstalledSapforMaxVersion();
|
||||
}
|
||||
void UpdateActiveDVMPackages() throws Exception {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
Vector<Pair<Integer, Long>> keys_pairs = (Vector<Pair<Integer, Long>>) request.object;
|
||||
|
||||
@@ -284,4 +284,20 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public Integer getInstalledSapforMaxVersion() {
|
||||
int max_version=Constants.Nan;
|
||||
|
||||
for (ServerSapfor sapfor : serverSapfors.Data.values()) {
|
||||
if (sapfor.state.equals(ServerSapforState.Done)) {
|
||||
int version=Constants.Nan;
|
||||
try {
|
||||
version = Integer.parseInt(sapfor.version);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (version > max_version) max_version = version;
|
||||
}
|
||||
}
|
||||
return max_version;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user