промежуточный. хранение инфы о конфигах, группах и тестах пакета.пока отлаживается.
This commit is contained in:
21
.idea/workspace.xml
generated
21
.idea/workspace.xml
generated
@@ -8,9 +8,26 @@
|
|||||||
<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/GlobalData/FileObject/FileObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/FileObject.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/GlobalData/FileObject/FileObjectsDataSet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/FileObjectsDataSet.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/GlobalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/GlobalProperties.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/MainMenuBar.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/VisualiserSettingsMenu/VisualiserSettingsMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/UI/Menus_2023/MainMenuBar/VisualiserSettingsMenu/VisualiserSettingsMenu.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/GlobalData/FileObject/DirInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfo.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosDataSet.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosDataSet.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosFields.form" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/FileObject/DirInfosFields.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/Settings/SettingName.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Settings/SettingName.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/GlobalData/Settings/SettingsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/GlobalData/Settings/SettingsDBTable.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPackage/TestingPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestingPackage/TestingPackage.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.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/DVM/DVMPackage/DVMPackage_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/DVM/DVMPackage/DVMPackage_json.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToDVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddTasksToDVMPackage.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/DeleteDownloadedBugReports.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/GetOldBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/GetOldBugReports.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/UpdateSetting.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/UpdateSetting.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" />
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
"Mode": "Normal",
|
"Mode": "Normal",
|
||||||
"ServerAddress": "alex-freenas.ddns.net",
|
"ServerAddress": "alex-freenas.ddns.net",
|
||||||
"ServerUserName": "testuser",
|
"ServerUserName": "testuser",
|
||||||
"ServerUserSHHPort": 2000,
|
"ServerUserSHHPort": 23,
|
||||||
"ComponentsServerPort": 7995,
|
"ComponentsServerPort": 7995,
|
||||||
"TestingServerPort": 7998,
|
"TestingServerPort": 7996,
|
||||||
"SocketTimeout": 5000,
|
"SocketTimeout": 5000,
|
||||||
"OldServer": false,
|
"OldServer": false,
|
||||||
"SMTPHost": "smtp.mail.ru",
|
"SMTPHost": "smtp.mail.ru",
|
||||||
"SMTPPort": 465,
|
"SMTPPort": 465,
|
||||||
"MailSocketPort": 465,
|
"MailSocketPort": 465,
|
||||||
"collapseCredentials": true,
|
"collapseCredentials": false,
|
||||||
"collapseFileGraphs": false,
|
"collapseFileGraphs": false,
|
||||||
"collapseFileMessages": false,
|
"collapseFileMessages": false,
|
||||||
"collapseProjectTrees": false,
|
"collapseProjectTrees": false,
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ public class GlobalProperties extends Properties {
|
|||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
public GlobalProperties() {
|
public GlobalProperties() {
|
||||||
|
|
||||||
}
|
}
|
||||||
public GlobalProperties(GlobalProperties p) {
|
public GlobalProperties(GlobalProperties p) {
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
setPreferredSize(new Dimension(0, 30));
|
setPreferredSize(new Dimension(0, 30));
|
||||||
//---
|
//---
|
||||||
|
|
||||||
|
/*
|
||||||
add(new MenuBarButton() {
|
add(new MenuBarButton() {
|
||||||
{
|
{
|
||||||
setIcon("/icons/Apply.png");
|
setIcon("/icons/Apply.png");
|
||||||
@@ -65,6 +66,7 @@ public class MainMenuBar extends VisualiserMenuBar {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
ShowProject(false);
|
ShowProject(false);
|
||||||
}
|
}
|
||||||
public void ShowUpdatesIcon() {
|
public void ShowUpdatesIcon() {
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ public class VisualiserSettingsMenu extends VisualiserMenu {
|
|||||||
SettingName.ComparsionDiffMergeOn
|
SettingName.ComparsionDiffMergeOn
|
||||||
));
|
));
|
||||||
add(Global.db.settings.get(SettingName.Workspace).getMenuItem());
|
add(Global.db.settings.get(SettingName.Workspace).getMenuItem());
|
||||||
|
add(Global.db.settings.get(SettingName.BugReportsAgeLimit).getMenuItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1280,11 +1280,36 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
public static long getNewestFileDate(File dir){
|
public static long getNewestFileDate(File dir){
|
||||||
Vector<Long> dates = new Vector<>();
|
Vector<Long> dates = new Vector<>();
|
||||||
dates.add(dir.lastModified());
|
|
||||||
get_newest_file_date_r(dir, dates);
|
get_newest_file_date_r(dir, dates);
|
||||||
Collections.sort(dates);
|
Collections.sort(dates);
|
||||||
|
if (dates.isEmpty()) {
|
||||||
|
dates.add(dir.lastModified());
|
||||||
|
}
|
||||||
System.out.println(new Date(dates.lastElement()));
|
System.out.println(new Date(dates.lastElement()));
|
||||||
return dates.firstElement();
|
return dates.firstElement();
|
||||||
}
|
}
|
||||||
|
//------------------------------------------------------->>>
|
||||||
|
public static Vector<Integer> unpack(String packed){
|
||||||
|
Vector<Integer> ids = new Vector<>();
|
||||||
|
String[] data = packed.split("\n");
|
||||||
|
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){
|
||||||
|
Vector<String> ids = new Vector<>();
|
||||||
|
String[] data = packed.split("\n");
|
||||||
|
if (data.length > 0) {
|
||||||
|
for (String s: data) {
|
||||||
|
if (!s.isEmpty())
|
||||||
|
ids.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,21 @@ import Common.Database.DBObject;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
public class FileObject extends DBObject {
|
public class DirInfo extends DBObject {
|
||||||
File file;
|
File dir;
|
||||||
public FileObject(File file_in){
|
long mdate;
|
||||||
file=file_in;
|
public DirInfo(File dir_in, long mdate_in) {
|
||||||
|
dir = dir_in;
|
||||||
|
mdate = mdate_in;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object getPK() {
|
public Object getPK() {
|
||||||
return file.getName();
|
return dir.getName();
|
||||||
}
|
}
|
||||||
public Date getDate() {
|
public Date getDate() {
|
||||||
return new Date(file.lastModified());
|
return new Date(mdate);
|
||||||
|
}
|
||||||
|
public File getFile(){
|
||||||
|
return dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Common.Database.DataSet;
|
|||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
|
|
||||||
import static Common.UI.Tables.TableRenderers.*;
|
import static Common.UI.Tables.TableRenderers.*;
|
||||||
public class FileObjectsDataSet extends DataSet<String, DirInfo> {
|
public class DirInfosDataSet extends DataSet<String, DirInfo> {
|
||||||
public FileObjectsDataSet() {
|
public DirInfosDataSet() {
|
||||||
super(String.class, DirInfo.class);
|
super(String.class, DirInfo.class);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="GlobalData.FileObject.FileObjectsFields">
|
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="GlobalData.FileObject.DirInfosFields">
|
||||||
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
|
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||||
<constraints>
|
<constraints>
|
||||||
<xy x="20" y="20" width="500" height="400"/>
|
<xy x="20" y="20" width="500" height="400"/>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Common.UI.Windows.Dialog.DialogFields;
|
|||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
public class FileObjectsFields implements DialogFields {
|
public class DirInfosFields implements DialogFields {
|
||||||
public JPanel content;
|
public JPanel content;
|
||||||
@Override
|
@Override
|
||||||
public Component getContent() {
|
public Component getContent() {
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public enum SettingName {
|
|||||||
Email, //для тестирования. потом.
|
Email, //для тестирования. потом.
|
||||||
Pause, //стоит ли тестрование на паузе.
|
Pause, //стоит ли тестрование на паузе.
|
||||||
Queue, //хз нужна ли. будет пересказ пакета в проходе.
|
Queue, //хз нужна ли. будет пересказ пакета в проходе.
|
||||||
|
BugReportsAgeLimit,
|
||||||
//---
|
//---
|
||||||
DVMPackageMaxId,
|
DVMPackageMaxId,
|
||||||
SAPFORPackageId,
|
SAPFORPackageId,
|
||||||
@@ -77,6 +78,8 @@ public enum SettingName {
|
|||||||
}
|
}
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
|
case BugReportsAgeLimit:
|
||||||
|
return "Срок хранения отчетов об ошибках (месяцы)";
|
||||||
case SaveModifications:
|
case SaveModifications:
|
||||||
return "Сохранять копию исходной версии при преобразованиях";
|
return "Сохранять копию исходной версии при преобразованиях";
|
||||||
case ComparsionDiffMergeOn:
|
case ComparsionDiffMergeOn:
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public class SettingsDBTable extends DBTable<SettingName, DBSetting> {
|
|||||||
AddSetting(new DBSetting(SettingName.FortranWrapsOn, 1, SettingType.SapforFlag, ComponentType.ComparsionOptions));
|
AddSetting(new DBSetting(SettingName.FortranWrapsOn, 1, SettingType.SapforFlag, ComponentType.ComparsionOptions));
|
||||||
AddSetting(new DBSetting(SettingName.ComparsionDiffMergeOn, 0, SettingType.SapforFlag, ComponentType.ComparsionOptions));
|
AddSetting(new DBSetting(SettingName.ComparsionDiffMergeOn, 0, SettingType.SapforFlag, ComponentType.ComparsionOptions));
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
AddSetting(new DBSetting(SettingName.BugReportsAgeLimit, 2, SettingType.IntField, ComponentType.Visualiser));
|
||||||
}
|
}
|
||||||
public Vector<DBSetting> getSettingsByOwner(ComponentType owner) {
|
public Vector<DBSetting> getSettingsByOwner(ComponentType owner) {
|
||||||
return Data.values().stream().filter(setting -> setting.Owner.equals(owner)).collect(Collectors.toCollection(Vector::new));
|
return Data.values().stream().filter(setting -> setting.Owner.equals(owner)).collect(Collectors.toCollection(Vector::new));
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
|||||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||||
@Override
|
@Override
|
||||||
public void GetVersionInfo() {
|
public void GetVersionInfo() {
|
||||||
version = 1114;
|
version = 1115;
|
||||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||||
date_text = df.format(getClassBuildTime());
|
date_text = df.format(getClassBuildTime());
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ package TestingSystem.Common.TestingPackage;
|
|||||||
import Common.Constants;
|
import Common.Constants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Database.riDBObject;
|
import Common.Database.riDBObject;
|
||||||
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
|
import TestingSystem.Common.Group.Group;
|
||||||
import TestingSystem.Common.TasksPackageState;
|
import TestingSystem.Common.TasksPackageState;
|
||||||
|
import TestingSystem.Common.Test.Test;
|
||||||
|
import TestingSystem.DVM.Configuration.Configuration;
|
||||||
import com.sun.org.glassfish.gmbal.Description;
|
import com.sun.org.glassfish.gmbal.Description;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Vector;
|
||||||
public abstract class TestingPackage<J> extends riDBObject {
|
public abstract class TestingPackage<J> extends riDBObject {
|
||||||
public String PID = "";
|
public String PID = "";
|
||||||
public int tasksCount = 0; //Общее число задач
|
public int tasksCount = 0; //Общее число задач
|
||||||
@@ -22,6 +27,14 @@ public abstract class TestingPackage<J> extends riDBObject {
|
|||||||
public long ChangeDate = 0;
|
public long ChangeDate = 0;
|
||||||
@Description("DEFAULT 0")
|
@Description("DEFAULT 0")
|
||||||
public int connectionErrosCount = 0;
|
public int connectionErrosCount = 0;
|
||||||
|
//--
|
||||||
|
@Description("DEFAULT ''")
|
||||||
|
public String packedConfigurations = "";
|
||||||
|
@Description("DEFAULT ''")
|
||||||
|
public String packedGroups = "";
|
||||||
|
@Description("DEFAULT ''")
|
||||||
|
public String packedTests = "";
|
||||||
|
//--
|
||||||
public TasksPackageState state = TasksPackageState.Draft;
|
public TasksPackageState state = TasksPackageState.Draft;
|
||||||
//--
|
//--
|
||||||
@Override
|
@Override
|
||||||
@@ -72,4 +85,94 @@ public abstract class TestingPackage<J> extends riDBObject {
|
|||||||
public void destructor() {
|
public void destructor() {
|
||||||
package_json = null;
|
package_json = null;
|
||||||
}
|
}
|
||||||
|
public Vector<Configuration> getConfigurations() {
|
||||||
|
Vector<Configuration> res = new Vector<>();
|
||||||
|
for (int o_id : Utils.unpack(packedConfigurations))
|
||||||
|
if (Global.testingServer.db.configurations.containsKey(o_id))
|
||||||
|
res.add(Global.testingServer.db.configurations.get(o_id));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
public Vector<Group> getGroups() {
|
||||||
|
Vector<Group> res = new Vector<>();
|
||||||
|
for (int o_id : Utils.unpack(packedGroups))
|
||||||
|
if (Global.testingServer.db.groups.containsKey(o_id))
|
||||||
|
res.add(Global.testingServer.db.groups.get(o_id));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
public Vector<Test> getTests() {
|
||||||
|
Vector<Test> res = new Vector<>();
|
||||||
|
for (int o_id : Utils.unpack(packedTests))
|
||||||
|
if (Global.testingServer.db.tests.containsKey(o_id))
|
||||||
|
res.add(Global.testingServer.db.tests.get(o_id));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
public void printCGT() {
|
||||||
|
try {
|
||||||
|
System.out.println("package="+id);
|
||||||
|
Vector<Configuration> configurations = getConfigurations();
|
||||||
|
System.out.println("+");
|
||||||
|
|
||||||
|
Vector<Group> groups = getGroups();
|
||||||
|
Vector<Test> tests = getTests();
|
||||||
|
Vector<String> res = new Vector<>();
|
||||||
|
res.add("конфигурации: " + configurations.size());
|
||||||
|
for (Configuration configuration : configurations)
|
||||||
|
res.add(configuration.description);
|
||||||
|
|
||||||
|
res.add("группы: " + groups.size());
|
||||||
|
for (Group group : groups)
|
||||||
|
res.add(group.description);
|
||||||
|
//--
|
||||||
|
res.add("тесты: " + tests.size());
|
||||||
|
for (Test test : tests)
|
||||||
|
res.add(test.description);
|
||||||
|
//--
|
||||||
|
res.add("-------");
|
||||||
|
System.out.println(String.join("\n", res));
|
||||||
|
}
|
||||||
|
catch (Exception ex){
|
||||||
|
System.out.println("```");
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void addConfigurations(Vector<Configuration> new_configurations){
|
||||||
|
Vector<String> res= Utils.unpack_s(packedConfigurations);
|
||||||
|
//---
|
||||||
|
System.out.println("old_configs "+res.size());
|
||||||
|
for(String id_: res){
|
||||||
|
System.out.println(Utils.Brackets(id_));
|
||||||
|
}
|
||||||
|
//---
|
||||||
|
for (Configuration configuration: new_configurations){
|
||||||
|
String id_ = String.valueOf(configuration.id);
|
||||||
|
if (!res.contains(id_))
|
||||||
|
res.add(id_);
|
||||||
|
}
|
||||||
|
packedConfigurations= String.join("\n", res );
|
||||||
|
System.out.println("new_configs="+res.size());
|
||||||
|
for(String id_: res){
|
||||||
|
System.out.println(Utils.Brackets(id_));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void addGroups(Vector<Group> new_groups){
|
||||||
|
Vector<String> res= Utils.unpack_s(packedGroups);
|
||||||
|
//---
|
||||||
|
for (Group group: new_groups){
|
||||||
|
String id_ = String.valueOf(group.id);
|
||||||
|
if (!res.contains(id_))
|
||||||
|
res.add(id_);
|
||||||
|
}
|
||||||
|
packedGroups= String.join("\n", res );
|
||||||
|
}
|
||||||
|
public void addTests(Vector<Test> new_tests){
|
||||||
|
Vector<String> res= Utils.unpack_s(packedTests);
|
||||||
|
//---
|
||||||
|
for (Test test: new_tests){
|
||||||
|
String id_ = String.valueOf(test.id);
|
||||||
|
if (!res.contains(id_))
|
||||||
|
res.add(id_);
|
||||||
|
}
|
||||||
|
packedTests= String.join("\n", res );
|
||||||
|
}
|
||||||
|
//------------------------------------------------------->>>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,4 +303,9 @@ public class TestsDatabase extends SQLiteDatabase {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
public void UnselectAllGTC(){
|
||||||
|
groups.CheckAll(false);
|
||||||
|
tests.CheckAll(false);
|
||||||
|
configurations.CheckAll(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import Common.Database.*;
|
|||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.UI.DataSetControlForm;
|
import Common.UI.DataSetControlForm;
|
||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
|
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||||
|
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -45,14 +47,37 @@ public class DVMPackageDBTable extends iDBTable<DVMPackage> {
|
|||||||
@Override
|
@Override
|
||||||
public void ShowCurrentObject() throws Exception {
|
public void ShowCurrentObject() throws Exception {
|
||||||
super.ShowCurrentObject();
|
super.ShowCurrentObject();
|
||||||
|
//--
|
||||||
Global.testingServer.db.dvmRunTasks.ShowDVMPackage(getCurrent());
|
Global.testingServer.db.dvmRunTasks.ShowDVMPackage(getCurrent());
|
||||||
UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
||||||
|
//--
|
||||||
|
System.out.println("show dvmpackage");
|
||||||
|
if (getCurrent().package_json!=null){
|
||||||
|
getCurrent().printCGT();
|
||||||
|
}
|
||||||
|
// Global.testingServer.db.UnselectAllGTC();
|
||||||
|
//отметить все группы, тесты, конфигурации, что относятся к пакету.
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (getCurrent().package_json != null) {
|
||||||
|
for (DVMCompilationTask compilationTask : getCurrent().package_json.compilationTasks) {
|
||||||
|
for (DVMRunTask runTask : compilationTask.runTasks) {
|
||||||
|
Data.put(runTask.id, runTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ShowUI();
|
||||||
|
//--
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void ShowNoCurrentObject() throws Exception {
|
public void ShowNoCurrentObject() throws Exception {
|
||||||
super.ShowNoCurrentObject();
|
super.ShowNoCurrentObject();
|
||||||
Global.testingServer.db.dvmRunTasks.ShowNoPackage();
|
Global.testingServer.db.dvmRunTasks.ShowNoPackage();
|
||||||
UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
UI.getMainWindow().getTestingWindow().DropTestRunTasksComparison();
|
||||||
|
//--
|
||||||
|
System.out.println("show no dvmpackage");
|
||||||
|
// Global.testingServer.db.UnselectAllGTC();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
package TestingSystem.DVM.DVMPackage;
|
package TestingSystem.DVM.DVMPackage;
|
||||||
|
import Common.Constants;
|
||||||
|
import Common.Global;
|
||||||
|
import TestingSystem.Common.Group.Group;
|
||||||
|
import TestingSystem.Common.Test.Test;
|
||||||
|
import TestingSystem.DVM.Configuration.Configuration;
|
||||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,21 @@ import Common.Global;
|
|||||||
import Common.UI.UI;
|
import Common.UI.UI;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import TestingSystem.Common.Group.Group;
|
import TestingSystem.Common.Group.Group;
|
||||||
|
import TestingSystem.Common.TasksPackageState;
|
||||||
import TestingSystem.Common.Test.Test;
|
import TestingSystem.Common.Test.Test;
|
||||||
import TestingSystem.DVM.Configuration.Configuration;
|
import TestingSystem.DVM.Configuration.Configuration;
|
||||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||||
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
import TestingSystem.DVM.DVMPackage.DVMPackage_json;
|
||||||
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
import TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||||
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
import TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||||
import TestingSystem.Common.TasksPackageState;
|
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
||||||
Vector<DVMCompilationTask> tasks;
|
Vector<DVMCompilationTask> tasks;
|
||||||
|
Vector<Configuration> configurations;
|
||||||
|
Vector<Group> groups;
|
||||||
|
Vector<Test> tests;
|
||||||
int tasks_count;
|
int tasks_count;
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
@@ -102,6 +105,9 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
|||||||
}
|
}
|
||||||
//---
|
//---
|
||||||
tasks = new Vector<>();
|
tasks = new Vector<>();
|
||||||
|
configurations = new Vector<>();
|
||||||
|
groups = new Vector<>();
|
||||||
|
tests = new Vector<>();
|
||||||
tasks_count = 0;
|
tasks_count = 0;
|
||||||
//-----------
|
//-----------
|
||||||
//1, Проверяем выбраны ли конфиги.
|
//1, Проверяем выбраны ли конфиги.
|
||||||
@@ -112,6 +118,7 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
|||||||
if (Global.testingServer.db.groups.getCheckedCount() > 0) {
|
if (Global.testingServer.db.groups.getCheckedCount() > 0) {
|
||||||
//2 Проверяем выбраны ли группы.
|
//2 Проверяем выбраны ли группы.
|
||||||
for (TestingSystem.DVM.Configuration.Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
for (TestingSystem.DVM.Configuration.Configuration configuration : Global.testingServer.db.configurations.getCheckedItems()) {
|
||||||
|
configurations.add(configuration);
|
||||||
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
for (Group group : Global.testingServer.db.groups.getCheckedItems()) {
|
||||||
Vector<Test> groupTests = new Vector<>();
|
Vector<Test> groupTests = new Vector<>();
|
||||||
Vector<Test> checkedGroupTests = new Vector<>();
|
Vector<Test> checkedGroupTests = new Vector<>();
|
||||||
@@ -123,15 +130,20 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!groupTests.isEmpty()) {
|
if (!groupTests.isEmpty()) {
|
||||||
|
groups.add(group);
|
||||||
if (checkedGroupTests.isEmpty()) {
|
if (checkedGroupTests.isEmpty()) {
|
||||||
for (Test test : groupTests)
|
for (Test test : groupTests) {
|
||||||
tasks.addAll(createTasksCGT(configuration, group, test));
|
tasks.addAll(createTasksCGT(configuration, group, test));
|
||||||
|
tests.add(test);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//добавляем только отмеченные.
|
//добавляем только отмеченные.
|
||||||
for (Test test : checkedGroupTests) {
|
for (Test test : checkedGroupTests) {
|
||||||
tasks.addAll(createTasksCGT(configuration, group, test));
|
tasks.addAll(createTasksCGT(configuration, group, test));
|
||||||
|
tests.add(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,8 +173,15 @@ public class AddTasksToDVMPackage extends Pass_2021<DVMPackage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
json.compilationTasks.addAll(tasks);
|
json.compilationTasks.addAll(tasks);
|
||||||
|
//--
|
||||||
|
target.addConfigurations(configurations);
|
||||||
|
target.addGroups(groups);
|
||||||
|
target.addTests(tests);
|
||||||
|
//--
|
||||||
target.tasksCount += tasks_count;
|
target.tasksCount += tasks_count;
|
||||||
Global.testingServer.db.Update(target);
|
Global.testingServer.db.Update(target);
|
||||||
|
//--
|
||||||
|
target.printCGT();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void showDone() throws Exception {
|
protected void showDone() throws Exception {
|
||||||
|
|||||||
@@ -1,40 +1,36 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
package Visual_DVM_2021.Passes.All;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.UI.UI;
|
|
||||||
import Common.UI.Windows.Dialog.Dialog;
|
import Common.UI.Windows.Dialog.Dialog;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import GlobalData.FileObject.FileObject;
|
import GlobalData.FileObject.DirInfo;
|
||||||
import GlobalData.FileObject.FileObjectsDataSet;
|
import GlobalData.FileObject.DirInfosDataSet;
|
||||||
import GlobalData.FileObject.FileObjectsFields;
|
import GlobalData.FileObject.DirInfosFields;
|
||||||
|
import GlobalData.Settings.SettingName;
|
||||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
import Visual_DVM_2021.Passes.UI.CopyProjectFields;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
public class DeleteDownloadedBugReports extends Pass_2021<Vector<File>> {
|
public class DeleteDownloadedBugReports extends Pass_2021<DirInfosDataSet> {
|
||||||
@Override
|
@Override
|
||||||
protected boolean needsAnimation() {
|
protected boolean needsAnimation() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean needsConfirmations() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target = null;
|
target = null;
|
||||||
if (passes.get(PassCode_2021.GetOldBugReports).Do()){
|
if (passes.get(PassCode_2021.GetOldBugReports).Do()){
|
||||||
target = (Vector<File>) passes.get(PassCode_2021.GetOldBugReports).target;
|
target = (DirInfosDataSet) passes.get(PassCode_2021.GetOldBugReports).target;
|
||||||
FileObjectsDataSet set = new FileObjectsDataSet();
|
if (target.Data.isEmpty()){
|
||||||
for (File file: target){
|
Log.Writeln_("Не найдено отчетов, не использовавшихся " +
|
||||||
set.put(file.getName(),new FileObject(file));
|
Global.getSetting(SettingName.BugReportsAgeLimit).toInt32() +
|
||||||
|
" месяцев и более!");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
Dialog<Object, FileObjectsFields> dialog = new Dialog<Object, FileObjectsFields>(FileObjectsFields.class) {
|
Dialog<Object, DirInfosFields> dialog = new Dialog<Object, DirInfosFields>(DirInfosFields.class) {
|
||||||
@Override
|
@Override
|
||||||
public int getDefaultHeight() {
|
public int getDefaultHeight() {
|
||||||
return 300;
|
return 300;
|
||||||
@@ -45,14 +41,16 @@ public class DeleteDownloadedBugReports extends Pass_2021<Vector<File>> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Init(Object... params) {
|
public void Init(Object... params) {
|
||||||
set.mountUI((JPanel) content);
|
target.mountUI((JPanel) content);
|
||||||
set.ShowUI();
|
target.ShowUI();
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void validateFields() {
|
public void validateFields() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (dialog.ShowDialog("Найдено "+target.size()+" загруженных проектов. Удалить?")) {
|
if (dialog.ShowDialog("Найдено "+target.size()+" отчетов, не использовавшихся " +
|
||||||
|
Global.getSetting(SettingName.BugReportsAgeLimit).toInt32()+
|
||||||
|
" месяцев и более. Удалить?")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,9 +63,9 @@ public class DeleteDownloadedBugReports extends Pass_2021<Vector<File>> {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void body() throws Exception {
|
protected void body() throws Exception {
|
||||||
for (File file : target) {
|
for (DirInfo dir : target.Data.values()) {
|
||||||
ShowMessage1(file.getName());
|
ShowMessage1(dir.getPK().toString());
|
||||||
Utils.forceDeleteWithCheck(file);
|
Utils.forceDeleteWithCheck(dir.getFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
package Visual_DVM_2021.Passes.All;
|
package Visual_DVM_2021.Passes.All;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
|
import GlobalData.FileObject.DirInfo;
|
||||||
|
import GlobalData.FileObject.DirInfosDataSet;
|
||||||
|
import GlobalData.Settings.SettingName;
|
||||||
import Visual_DVM_2021.Passes.Pass_2021;
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.Calendar;
|
||||||
public class GetOldBugReports extends Pass_2021<Vector<File>> {
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
public class GetOldBugReports extends Pass_2021<DirInfosDataSet> {
|
||||||
@Override
|
@Override
|
||||||
protected boolean canStart(Object... args) throws Exception {
|
protected boolean canStart(Object... args) throws Exception {
|
||||||
target = new Vector<>();
|
target = new DirInfosDataSet();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected boolean needsAnimation() {
|
protected boolean needsAnimation() {
|
||||||
@@ -24,7 +28,7 @@ public class GetOldBugReports extends Pass_2021<Vector<File>> {
|
|||||||
//---
|
//---
|
||||||
Calendar c = new GregorianCalendar();
|
Calendar c = new GregorianCalendar();
|
||||||
c.setTimeInMillis(System.currentTimeMillis());
|
c.setTimeInMillis(System.currentTimeMillis());
|
||||||
c.add(Calendar.MONTH, -2);
|
c.add(Calendar.MONTH, -Global.getSetting(SettingName.BugReportsAgeLimit).toInt32());
|
||||||
Date date = c.getTime();
|
Date date = c.getTime();
|
||||||
System.out.println(date);
|
System.out.println(date);
|
||||||
long border = date.getTime();
|
long border = date.getTime();
|
||||||
@@ -33,7 +37,8 @@ public class GetOldBugReports extends Pass_2021<Vector<File>> {
|
|||||||
ShowMessage2(file.getName());
|
ShowMessage2(file.getName());
|
||||||
long mdate = Utils.getNewestFileDate(file);
|
long mdate = Utils.getNewestFileDate(file);
|
||||||
if (mdate <= border) {
|
if (mdate <= border) {
|
||||||
target.add(file);
|
DirInfo d = new DirInfo(file, mdate);
|
||||||
|
target.put(d.getPK(), d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,13 @@ public class UpdateSetting extends Pass_2021<DBSetting> {
|
|||||||
if (f_.ShowDialog(target.Name.getDescription()))
|
if (f_.ShowDialog(target.Name.getDescription()))
|
||||||
NewValue = String.valueOf(f_.Result);
|
NewValue = String.valueOf(f_.Result);
|
||||||
break;
|
break;
|
||||||
|
case BugReportsAgeLimit:
|
||||||
|
min = 1;
|
||||||
|
max = 12;
|
||||||
|
SliderNumberForm fffff = new SliderNumberForm();
|
||||||
|
if (fffff.ShowDialog(target.Name.getDescription(), target.toInt32(), min, max))
|
||||||
|
NewValue = String.valueOf(fffff.Result);
|
||||||
|
break;
|
||||||
case FastAccessPassesCount:
|
case FastAccessPassesCount:
|
||||||
min = 5;
|
min = 5;
|
||||||
max = 15;
|
max = 15;
|
||||||
|
|||||||
Reference in New Issue
Block a user