промежуточный. в таблицах пакетов открытие текущего пакета по 2 клику

This commit is contained in:
2024-09-26 21:31:18 +03:00
parent 45fcf9b585
commit 1be569e294
9 changed files with 85 additions and 35 deletions

10
.idea/workspace.xml generated
View File

@@ -8,8 +8,14 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackage_json.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/RemoteDVMTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/RemoteDVMTestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackageDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackageDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforConfiguration/SapforConfigurationDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackageDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforPackage/SapforPackageDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/TestPass.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -1288,18 +1288,6 @@ public class Utils {
System.out.println(new Date(dates.lastElement())); System.out.println(new Date(dates.lastElement()));
return dates.firstElement(); return dates.firstElement();
} }
//методы работают только с непустыми запакованными данными
public static Vector<Integer> unpackIntegers(String packed, String separator) {
Vector<Integer> ids = new Vector<>();
String[] data = packed.split(separator);
if (data.length > 0) {
for (String s : data) {
if (!s.isEmpty())
ids.add(Integer.parseInt(s));
}
}
return ids;
}
public static Vector<String> unpack_s(String packed, String separator) { public static Vector<String> unpack_s(String packed, String separator) {
Vector<String> ids = new Vector<>(); Vector<String> ids = new Vector<>();
String[] data = packed.split(separator); String[] data = packed.split(separator);

View File

@@ -168,20 +168,21 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Test test; Test test;
int test_id; int test_id;
switch (code) { switch (code) {
//TODO запрос на принудительное автоматическое тестирование заданной версии сапфор.
case PerformAutoSapforTesting: case PerformAutoSapforTesting:
Print("Запустить автоматическое тестирование SAPFOR"); Print("Запустить автоматическое тестирование SAPFOR");
TextLog Log = new TextLog(); TextLog Log = new TextLog();
tryAutoSapforTesting(Log); tryAutoSapforTesting(Log);
response = new ServerExchangeUnit_2021(ServerCode.OK); response = new ServerExchangeUnit_2021(ServerCode.OK);
if (!Log.isEmpty()) { EmailMessage message = Log.isEmpty()?
EmailMessage message = new EmailMessage( new EmailMessage(
"Не удалось запустить автоматическое тестирование системы SAPFOR", "Запущено автоматической тестирование версии "+request.arg+" системы SAPFOR",
"", new Vector<>()):
new EmailMessage(
"Не удалось запустить автоматическое тестирование версии "+request.arg+" системы SAPFOR",
Log.toString(), Log.toString(),
new Vector<>() new Vector<>()
); );
Email(message); Email(message);
}
break; break;
case DownloadTest: case DownloadTest:
Print("Отправить клиенту тест " + request.arg); Print("Отправить клиенту тест " + request.arg);
@@ -640,5 +641,19 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
afterPublishAction(target); afterPublishAction(target);
//-- //--
} }
/*
public void PATCH(){
for (SapforPackage sapforPackage: db.sapforPackages.Data.values()){
try {
sapforPackage.readJson();
sapforPackage.state=sapforPackage.package_json.getState();
db.Update(sapforPackage);
}
catch (Exception ex){
ex.printStackTrace();
}
}
}
*/
} }

View File

@@ -7,6 +7,8 @@ import Common.UI.UI;
import Common.UI.VisualCache.PackageCache; import Common.UI.VisualCache.PackageCache;
import Common.UI.VisualCache.VisualCache; import Common.UI.VisualCache.VisualCache;
import Common.UI.VisualCache.VisualCaches; import Common.UI.VisualCache.VisualCaches;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
@@ -60,6 +62,10 @@ public class DVMPackageDBTable extends iDBTable<DVMPackage> {
Global.testingServer.db.dvmRunTasks.ShowNoPackage(); Global.testingServer.db.dvmRunTasks.ShowNoPackage();
UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison(); UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison();
} }
@Override
public void MouseAction2() throws Exception {
Pass_2021.passes.get(PassCode_2021.DownloadDVMPackage).Do();
}
}; };
} }
@Override @Override

View File

@@ -137,4 +137,11 @@ public class SapforConfigurationDBTable extends iDBTable<SapforConfiguration> {
} }
return res; return res;
} }
//патч.потом удалить.
public SapforConfiguration getConfigurationByDescription(String description){
for (SapforConfiguration sapforConfiguration: Data.values())
if (sapforConfiguration.description.equals(description))
return sapforConfiguration;
return null;
}
} }

View File

@@ -25,6 +25,7 @@ import java.util.LinkedHashMap;
import java.util.Vector; import java.util.Vector;
public class SapforPackage extends TestingPackage<SapforPackage_json> { public class SapforPackage extends TestingPackage<SapforPackage_json> {
public int sapforId = Constants.Nan; // так как сапфор на машине. public int sapforId = Constants.Nan; // так как сапфор на машине.
//--------------
public SapforPackage() { public SapforPackage() {
} }
public SapforPackage(SapforPackage sapforPackage) { public SapforPackage(SapforPackage sapforPackage) {

View File

@@ -6,6 +6,8 @@ import Common.UI.VisualCache.ConfigurationCache;
import Common.UI.VisualCache.PackageCache; import Common.UI.VisualCache.PackageCache;
import Common.UI.VisualCache.VisualCaches; import Common.UI.VisualCache.VisualCaches;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor; import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
import javax.security.auth.login.CredentialNotFoundException; import javax.security.auth.login.CredentialNotFoundException;
import java.util.Arrays; import java.util.Arrays;
@@ -47,6 +49,10 @@ public class SapforPackageDBTable extends iDBTable<SapforPackage> {
columns.get(9).setRenderer(RendererDate); columns.get(9).setRenderer(RendererDate);
columns.get(10).setRenderer(RendererStatusEnum); columns.get(10).setRenderer(RendererStatusEnum);
} }
@Override
public void MouseAction2() throws Exception {
Pass_2021.passes.get(PassCode_2021.CompareSapforPackages).Do();
}
}; };
} }
@Override @Override

View File

@@ -261,6 +261,8 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
//-- //--
UpdateSapforState(ServerSapforState.Done); UpdateSapforState(ServerSapforState.Done);
EmailSapforAssembly(current_version, true, sapforOut, sapforErr); EmailSapforAssembly(current_version, true, sapforOut, sapforErr);
//запуск автоматического тестирования.
ServerCommand(ServerCode.PerformAutoSapforTesting, String.valueOf(sapfor.id));
} else { } else {
UpdateSapforState(ServerSapforState.DoneWithErrors); UpdateSapforState(ServerSapforState.DoneWithErrors);
EmailSapforAssembly(current_version, false, sapforOut, sapforErr); EmailSapforAssembly(current_version, false, sapforOut, sapforErr);

View File

@@ -1,20 +1,39 @@
package Visual_DVM_2021.Passes.All; package Visual_DVM_2021.Passes.All;
import Common.Current; import Common.Global;
import Repository.Server.ServerCode; import Common.Utils.Utils;
import Repository.Server.ServerExchangeUnit_2021; import TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import TestingSystem.SAPFOR.ServerSapfor.ServerSapfor; import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
import Visual_DVM_2021.Passes.Server.TestingSystemPass; import Visual_DVM_2021.Passes.Pass_2021;
public class TestPass extends TestingSystemPass<ServerSapfor> {
@Override import java.util.LinkedHashMap;
protected boolean canStart(Object... args) throws Exception { import java.util.Vector;
if (Current.Check(Log, Current.ServerSapfor)) { public class TestPass extends Pass_2021 {
target = Current.getServerSapfor(); /*
return true; LinkedHashMap<Integer,SapforConfiguration> unpackConfigurationsOld(SapforPackage sapforPackage){
} LinkedHashMap<Integer,SapforConfiguration> res = new LinkedHashMap<>();
return false; Vector<String> names = Utils.unpack_s(sapforPackage.configurationsNames,";");
for (String name: names) {
SapforConfiguration configuration = Global.testingServer.db.sapforConfigurations.getConfigurationByDescription(name);
if ((configuration!=null)&&!res.containsKey(configuration.id)){
res.put(configuration.id,configuration);
}
}
return res;
} }
@Override @Override
protected void ServerAction() throws Exception { protected void body() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.PerformAutoSapforTesting, String.valueOf(target.id) )); // LinkedHashMap<Integer>
for (SapforPackage sapforPackage: Global.testingServer.db.sapforPackages.Data.values()){
LinkedHashMap<Integer,SapforConfiguration> configurations = unpackConfigurationsOld(sapforPackage);
sapforPackage.saveConfigurationsAsJson(new Vector<>(configurations.values()));
Global.testingServer.db.Update(sapforPackage);
}
}
*/
@Override
protected void body() throws Exception {
for (SapforPackage sapforPackage: Global.testingServer.db.sapforPackages.Data.values()){
}
} }
} }