начал перестройку под бд пользователя.
This commit is contained in:
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
@@ -7,10 +7,15 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Current.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Current.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforConfigurationsMenuBar/SapforConfigurationsMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/SapforConfigurationsMenuBar/SapforConfigurationsMenuBar.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackagesDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackagesDBTable.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage_info.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SPF_CreateParallelVariant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTestsOnServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -3,7 +3,7 @@ import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class SapforConfigurationsMenuBar extends DataMenuBar {
|
||||
public SapforConfigurationsMenuBar() {
|
||||
super("конфигурации", PassCode_2021.StartSapforTestsOnServer,
|
||||
super("конфигурации", PassCode_2021.StartSapforTests,
|
||||
PassCode_2021.PublishSapforConfiguration,
|
||||
PassCode_2021.EditSapforConfiguration,
|
||||
PassCode_2021.DeleteSapforConfiguration
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Database.nDBObject;
|
||||
import TestingSystem.TasksPackage.TasksPackageState;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class SapforTasksPackage extends iDBObject {
|
||||
public class SapforTasksPackage extends nDBObject {
|
||||
@Description("DEFAULT ''")
|
||||
public String testsNames = "";//имена тестов через ; для отображения
|
||||
//---
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package SapforTestingSystem.SapforTasksPackage;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.Database.DBTable;
|
||||
import Common.UI.DataSetControlForm;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static Common.UI.Tables.TableRenderers.RendererDate;
|
||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class SapforTasksPackagesDBTable extends iDBTable<SapforTasksPackage> {
|
||||
public class SapforTasksPackagesDBTable extends DBTable<String, SapforTasksPackage> {
|
||||
public SapforTasksPackagesDBTable() {
|
||||
super(SapforTasksPackage.class);
|
||||
super(String.class, SapforTasksPackage.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class SapforTasksPackage_info implements Serializable {
|
||||
@Expose
|
||||
public String email = "";
|
||||
@Expose
|
||||
public int sapforId = Constants.Nan; //файл с сапфором
|
||||
@Expose
|
||||
|
||||
@@ -2,6 +2,7 @@ package TestingSystem;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Global;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackagesDBTable;
|
||||
import TestingSystem.TSetting.TSetting;
|
||||
import TestingSystem.TSetting.TSettingsDBTable;
|
||||
import TestingSystem.TaskKey.TaskKey_2022;
|
||||
@@ -28,10 +29,8 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
public TestCompilationTasksDBTable testCompilationTasks;
|
||||
public TestRunTasksDBTable testRunTasks;
|
||||
PreparedStatement selectPackageRunTasks = null;
|
||||
// PreparedStatement selectSapforPackageSapforTasks = null;
|
||||
//----------
|
||||
// public SapforTasksPackagesDBTable sapforTasksPackages;
|
||||
// public SapforTasksDBTable sapforTasks = null;
|
||||
public SapforTasksPackagesDBTable sapforTasksPackages;
|
||||
//---------
|
||||
public TasksDatabase(String email) {
|
||||
super(Paths.get(Global.DataDirectory.getAbsolutePath(), email + "_" + tests_db_name + ".sqlite").toFile());
|
||||
@@ -50,10 +49,7 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
addTable(testRunTasks = new TestRunTasksDBTable());
|
||||
addTable(packagesToKill = new TasksPackageToKillDBTable());
|
||||
//-----------
|
||||
/*
|
||||
addTable(sapforTasksPackages = new SapforTasksPackagesDBTable());
|
||||
addTable(sapforTasks = new SapforTasksDBTable());
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
@@ -68,7 +64,6 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
public void prepareTablesStatements() throws Exception {
|
||||
super.prepareTablesStatements();
|
||||
selectPackageRunTasks = conn.prepareStatement("SELECT * FROM TestRunTask WHERE taskspackage_id = ?");
|
||||
// selectSapforPackageSapforTasks = conn.prepareStatement("SELECT * FROM SapforTask WHERE sapfortaskspackage_id = ?");
|
||||
}
|
||||
@Override
|
||||
protected void disconnect() throws Exception {
|
||||
@@ -76,12 +71,6 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
selectPackageRunTasks.close();
|
||||
selectPackageRunTasks = null;
|
||||
}
|
||||
/*
|
||||
if (selectSapforPackageSapforTasks != null) {
|
||||
selectSapforPackageSapforTasks.close();
|
||||
selectSapforPackageSapforTasks = null;
|
||||
}
|
||||
*/
|
||||
super.disconnect();
|
||||
}
|
||||
public LinkedHashMap<Long, TestRunTask> getPackageRunTasks(String package_id) throws Exception {
|
||||
@@ -94,30 +83,6 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/*
|
||||
вернуть когда перенесем на сервер.
|
||||
public LinkedHashMap<Long, SapforTask> getSapforPackageTasks(String package_id) throws Exception {
|
||||
LinkedHashMap<Long, SapforTask> res = new LinkedHashMap<>();
|
||||
selectSapforPackageSapforTasks.setString(1, package_id);
|
||||
resSet = selectSapforPackageSapforTasks.executeQuery();
|
||||
while (resSet.next()) {
|
||||
Pair<Long, SapforTask> record = readRecord(sapforTasks);
|
||||
res.put(record.getKey(), record.getValue());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
public LinkedHashMap<Long, SapforTask> getSapforPackageTasks(String package_id) throws Exception {
|
||||
LinkedHashMap<Long, SapforTask> res = new LinkedHashMap<>();
|
||||
for (SapforTask task : sapforTasks.Data.values()) {
|
||||
if (task.sapfortaskspackage_id.equals(package_id)) {
|
||||
res.put(task.id, task);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
//------
|
||||
public TasksPackage getFirstActivePackage() {
|
||||
TasksPackage first_active = null;
|
||||
|
||||
@@ -316,13 +316,15 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
return groups;
|
||||
}
|
||||
public void StartSapforTests(SapforTasksPackage_info sapforTasksPackage_info) throws Exception {
|
||||
SetCurrentAccountDB(sapforTasksPackage_info.email);
|
||||
//--
|
||||
SapforTasksPackage_json package_json = new SapforTasksPackage_json();
|
||||
for (String test_id : sapforTasksPackage_info.testsIds)
|
||||
package_json.tests.add(db.tests.get(test_id).description);
|
||||
//создание объекта набора задач. для бд.
|
||||
SapforTasksPackage sapforTasksPackage = new SapforTasksPackage(); //?может быть все же поменять ключ на сгенерированный из даты.
|
||||
// db.Insert(sapforTasksPackage);
|
||||
sapforTasksPackage.genName();
|
||||
account_db.Insert(sapforTasksPackage);
|
||||
//создание рабочего пространства для пакетного режима
|
||||
File packageWorkspace = new File(Global.SapforPackagesDirectory, String.valueOf(sapforTasksPackage.id));
|
||||
Utils.CheckAndCleanDirectory(packageWorkspace);
|
||||
@@ -375,7 +377,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
sapforTasksPackage.sapfor_build_date = sapfor.buildDate;
|
||||
sapforTasksPackage.testsNames = String.join(";", package_json.tests);
|
||||
sapforTasksPackage.StartDate = new Date().getTime();
|
||||
// db.Update(sapforTasksPackage);
|
||||
account_db.Update(sapforTasksPackage);
|
||||
}
|
||||
@Override
|
||||
protected void Session() throws Exception {
|
||||
|
||||
@@ -16,7 +16,7 @@ import Visual_DVM_2021.Passes.TestingSystemPass;
|
||||
import java.io.File;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class StartSapforTestsOnServer extends TestingSystemPass<SapforTasksPackage_info> {
|
||||
public class StartSapforTests extends TestingSystemPass<SapforTasksPackage_info> {
|
||||
protected int allTasksCount = 0;
|
||||
//--
|
||||
protected LinkedHashMap<String, Vector<String>> groupsTests = null;
|
||||
@@ -122,6 +122,10 @@ public class StartSapforTestsOnServer extends TestingSystemPass<SapforTasksPacka
|
||||
testsNames_lower = new Vector<>();
|
||||
allTests = new LinkedHashMap<>();
|
||||
groupsLanguages = new Vector<>();
|
||||
//-->>
|
||||
if (!Current.getAccount().CheckRegistered(Log)) {
|
||||
return false;
|
||||
}
|
||||
//проверка стартовых условий.
|
||||
if (!Current.Check(Log, Current.ServerSapfor))
|
||||
return false;
|
||||
@@ -172,6 +176,7 @@ public class StartSapforTestsOnServer extends TestingSystemPass<SapforTasksPacka
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
target = new SapforTasksPackage_info();
|
||||
target.email = Current.getAccount().email;
|
||||
target.sapforId = Current.getServerSapfor().id;
|
||||
for (Test test : allTests.values())
|
||||
target.testsIds.add(test.id);
|
||||
@@ -179,11 +184,11 @@ public class StartSapforTestsOnServer extends TestingSystemPass<SapforTasksPacka
|
||||
ShowMessage1("Создание рабочих пространств...");
|
||||
for (SapforConfiguration configuration : Global.testingServer.db.sapforConfigurations.getCheckedItems())
|
||||
target.configurationsIds.add(configuration.id);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.StartSapforTests, "", target));
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.StartSapforTests, "", target));
|
||||
}
|
||||
@Override
|
||||
protected void performFinish() throws Exception {
|
||||
super.performFinish();
|
||||
passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
//passes.get(PassCode_2021.SynchronizeTests).Do();
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public enum PassCode_2021 {
|
||||
ShowParallelVariantsCoverage,
|
||||
//-
|
||||
DeleteServerSapfor,
|
||||
StartSapforTestsOnServer,
|
||||
StartSapforTests,
|
||||
InstallServerSapfor,
|
||||
SaveProfile,
|
||||
ApplyProfile,
|
||||
@@ -316,7 +316,7 @@ public enum PassCode_2021 {
|
||||
return "Удалить сценарий SAPFOR";
|
||||
case DeleteServerSapfor:
|
||||
return "Удалить версию SAPFOR";
|
||||
case StartSapforTestsOnServer:
|
||||
case StartSapforTests:
|
||||
return "Запустить тестирование на сервере";
|
||||
case InstallServerSapfor:
|
||||
return "Собрать актуальную версию SAPFOR";
|
||||
|
||||
Reference in New Issue
Block a user