рефакторинг сборки Сапфора. Перевел ее в планировщик задач тестирования сапфора. осталось при проверке бд это отобразить.

This commit is contained in:
2024-05-08 01:56:17 +03:00
parent 468bfc027d
commit 8a4371fc86
5 changed files with 80 additions and 1 deletions

View File

@@ -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;

View File

@@ -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;
}
}