no message
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.Common.Configuration;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Json.GroupsJson;
|
||||
import _VisualDVM.TestingSystem.Common.Settings.Json.SettingsArrayJson;
|
||||
@@ -25,6 +25,13 @@ public class Configuration extends riDBObject {
|
||||
public int autoTesting = 0;
|
||||
@Description("DEFAULT 1")
|
||||
public int kernels = 1; //ядра
|
||||
//--
|
||||
@Description("DEFAULT ''")
|
||||
public String packedGroupsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedTestsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedSettingsJson = "";
|
||||
//----
|
||||
public String printAuto() {
|
||||
return autoTesting > 0 ? "Да" : "Нет";
|
||||
@@ -36,13 +43,6 @@ public class Configuration extends riDBObject {
|
||||
return Utils_.getIcon("/Common/icons/" + (autoTesting == 1 ? "RedPick" : "NotPick") + ".png");
|
||||
}
|
||||
//--
|
||||
@Description("DEFAULT ''")
|
||||
public String packedGroupsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedTestsJson = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedSettingsJson = "";
|
||||
//--
|
||||
public void saveGroupsAsJson(Vector<Group> groups) {
|
||||
packedGroupsJson = Utils_.gson.toJson(new GroupsJson(groups));
|
||||
}
|
||||
|
||||
@@ -8,9 +8,10 @@ public class ConfigurationJson implements Serializable {
|
||||
public int id;
|
||||
@Expose
|
||||
public String description;
|
||||
public ConfigurationJson(Configuration configuration){
|
||||
id=configuration.id;
|
||||
description= configuration.description;
|
||||
public ConfigurationJson(Configuration configuration) {
|
||||
id = configuration.id;
|
||||
description = configuration.description;
|
||||
}
|
||||
public ConfigurationJson() {
|
||||
}
|
||||
public ConfigurationJson(){}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class ConfigurationsJson implements Serializable {
|
||||
@Expose
|
||||
public List<ConfigurationJson> array =new Vector<>();
|
||||
public ConfigurationsJson(){
|
||||
public List<ConfigurationJson> array = new Vector<>();
|
||||
public ConfigurationsJson() {
|
||||
}
|
||||
//при создании пакета.
|
||||
public ConfigurationsJson(Vector<? extends Configuration> configurations){
|
||||
array =new Vector<>();
|
||||
for (Configuration configuration:configurations)
|
||||
public ConfigurationsJson(Vector<? extends Configuration> configurations) {
|
||||
array = new Vector<>();
|
||||
for (Configuration configuration : configurations)
|
||||
array.add(new ConfigurationJson(configuration));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.Common.Group;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.Common.Test.TestType;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -20,35 +19,11 @@ public class Group extends riDBObject {
|
||||
public TestType type = TestType.Default;
|
||||
@Description("DEFAULT 'fortran'")
|
||||
public LanguageName language = LanguageName.fortran;
|
||||
//--
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
Global.testingServer.db.groups.applyFilters(this);
|
||||
}
|
||||
public String getSummary() {
|
||||
return description + " " + language.getDescription();
|
||||
}
|
||||
//-
|
||||
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Group g = (Group) src;
|
||||
type = g.type;
|
||||
language = g.language;
|
||||
}
|
||||
public Group(Group group) {
|
||||
this.SynchronizeFields(group);
|
||||
}
|
||||
public Group() {
|
||||
}
|
||||
@Override
|
||||
public void select(boolean flag) {
|
||||
super.select(flag);
|
||||
if (UI_.isActive())
|
||||
UI.getMainWindow().ShowCheckedTestsCount();
|
||||
}
|
||||
//--
|
||||
//-
|
||||
public static void generateForLanguage(
|
||||
@@ -94,6 +69,29 @@ public class Group extends riDBObject {
|
||||
bodies.add(module_body);
|
||||
}
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!GroupsDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
Global.testingServer.db.groups.applyFilters(this);
|
||||
}
|
||||
public String getSummary() {
|
||||
return description + " " + language.getDescription();
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Group g = (Group) src;
|
||||
type = g.type;
|
||||
language = g.language;
|
||||
}
|
||||
@Override
|
||||
public void select(boolean flag) {
|
||||
super.select(flag);
|
||||
if (UI_.isActive())
|
||||
UI.getMainWindow().ShowCheckedTestsCount();
|
||||
}
|
||||
public String GenerateMakefile(Test test, String dvm_drv, String flags_in) {
|
||||
//----->>
|
||||
LinkedHashMap<LanguageName, Vector<ProjectFile>> programs = test.getPrograms();
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.Common.Group;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.GroupFields;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
@@ -51,7 +51,6 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "группа тестов";
|
||||
@@ -138,10 +137,10 @@ public class GroupsDBTable extends iDBTable<Group> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public Group getGroupByDescription(LanguageName language_in,String description_in) {
|
||||
public Group getGroupByDescription(LanguageName language_in, String description_in) {
|
||||
for (Group group : Data.values()) {
|
||||
if (group.sender_address.equals("vmk-post@yandex.ru")&&
|
||||
group.language.equals(language_in)&&group.description.equalsIgnoreCase(description_in))
|
||||
if (group.sender_address.equals("vmk-post@yandex.ru") &&
|
||||
group.language.equals(language_in) && group.description.equalsIgnoreCase(description_in))
|
||||
return group;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package _VisualDVM.TestingSystem.Common.Group;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.AddGroupMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Group.UI.EditGroupMenu;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
public class GroupsMenuBar extends DataMenuBar {
|
||||
@@ -13,7 +13,7 @@ public class GroupsMenuBar extends DataMenuBar {
|
||||
super("группы",
|
||||
PassCode.SynchronizeTests,
|
||||
PassCode.ConvertCorrectnessTests
|
||||
);
|
||||
);
|
||||
addMenus(new AddGroupMenu(), new EditGroupMenu());
|
||||
addPasses(PassCode.DeleteGroup);
|
||||
add(new JSeparator());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.Common.Group.UI;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class AddGroupMenu extends VisualiserMenu {
|
||||
public AddGroupMenu() {
|
||||
super("", "/icons/RedAdd.png");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package _VisualDVM.TestingSystem.Common.Group.UI;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class EditGroupMenu extends VisualiserMenu {
|
||||
public EditGroupMenu() {
|
||||
super("", "/icons/Edit.png" );
|
||||
super("", "/icons/Edit.png");
|
||||
addPasses(PassCode.EditGroup, PassCode.ReplaceTestsFromFiles);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Mode;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -6,13 +6,13 @@ import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class SettingsArrayJson {
|
||||
@Expose
|
||||
public List<SettingsJson> array =new Vector<>();
|
||||
public SettingsArrayJson(){
|
||||
public List<SettingsJson> array = new Vector<>();
|
||||
public SettingsArrayJson() {
|
||||
}
|
||||
//при создании пакета.
|
||||
public SettingsArrayJson(Vector<? extends Settings> settings_in){
|
||||
array =new Vector<>();
|
||||
for (Settings settings: settings_in)
|
||||
public SettingsArrayJson(Vector<? extends Settings> settings_in) {
|
||||
array = new Vector<>();
|
||||
for (Settings settings : settings_in)
|
||||
array.add(new SettingsJson(settings));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,14 @@ import Common.Database.Objects.riDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
//предопределенный набор настроек тестируемой системы. сохраняется для упрощения.
|
||||
public abstract class Settings extends riDBObject {
|
||||
public String flags="";
|
||||
public String flags = "";
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Settings s = (Settings) src;
|
||||
flags=s.flags;
|
||||
flags = s.flags;
|
||||
}
|
||||
public boolean validate(TextLog Log) {
|
||||
return true;
|
||||
}
|
||||
public boolean validate(TextLog Log){return true;}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class TaskThread extends Thread {
|
||||
super(() -> {
|
||||
while (!task_.state.isComplete()) {
|
||||
task_.Reset();
|
||||
new PerformSapforTask().Do(task_,sapfor_drv);
|
||||
new PerformSapforTask().Do(task_, sapfor_drv);
|
||||
}
|
||||
});
|
||||
task = task_;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.Common;
|
||||
import Common.Visual.StatusEnum;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.StatusEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Vector;
|
||||
@@ -29,8 +29,7 @@ public enum TasksPackageState implements StatusEnum {
|
||||
Done,
|
||||
Aborted,
|
||||
ConnectionError,
|
||||
DoneWithErrors
|
||||
;
|
||||
DoneWithErrors;
|
||||
public boolean isActive() {
|
||||
switch (this) {
|
||||
case Inactive:
|
||||
@@ -53,7 +52,6 @@ public enum TasksPackageState implements StatusEnum {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisualiserFonts getFont() {
|
||||
switch (this) {
|
||||
@@ -115,9 +113,7 @@ public enum TasksPackageState implements StatusEnum {
|
||||
return StatusEnum.super.getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
public Vector<TasksPackageState> getHigherStates(){
|
||||
public Vector<TasksPackageState> getHigherStates() {
|
||||
return Arrays.stream(values()).filter(state -> state.ordinal() > this.ordinal()).collect(Collectors.toCollection(Vector::new));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ import java.io.Serializable;
|
||||
public class TestJson implements Serializable {
|
||||
@Expose
|
||||
public int id;
|
||||
public TestJson(Test test){
|
||||
id=test.id;
|
||||
public TestJson(Test test) {
|
||||
id = test.id;
|
||||
}
|
||||
public TestJson() {
|
||||
}
|
||||
public TestJson(){}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.ProjectData.Files.FileState;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.RepositoryRefuseException;
|
||||
import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -29,15 +29,6 @@ public class Test extends riDBObject {
|
||||
public String args = ""; //аргументы командной строки. на всякий случай поле зарезервирую. пусть будут.
|
||||
@Description("DEFAULT -1")
|
||||
public int group_id = CommonConstants.Nan;
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Test t = (Test) src;
|
||||
min_dim = t.min_dim;
|
||||
max_dim = t.max_dim;
|
||||
args = t.args;
|
||||
group_id = t.group_id;
|
||||
}
|
||||
@Description("DEFAULT ''")
|
||||
public String files = ""; //файлы теста
|
||||
//--------------------------------------------->>>
|
||||
@@ -52,6 +43,15 @@ public class Test extends riDBObject {
|
||||
public Test() {
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
Test t = (Test) src;
|
||||
min_dim = t.min_dim;
|
||||
max_dim = t.max_dim;
|
||||
args = t.args;
|
||||
group_id = t.group_id;
|
||||
}
|
||||
@Override
|
||||
public void select(boolean flag) {
|
||||
super.select(flag);
|
||||
if (UI_.isActive())
|
||||
@@ -60,7 +60,7 @@ public class Test extends riDBObject {
|
||||
//---
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.matchCurrentID(Current.Group,group_id);
|
||||
return Global.mainModule.matchCurrentID(Current.Group, group_id);
|
||||
}
|
||||
//-
|
||||
public File getArchive() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.TestFields;
|
||||
@@ -106,8 +106,8 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
}
|
||||
public Test getTestByDescription(int group_id_in, String description_in) {
|
||||
for (Test test : Data.values()) {
|
||||
if (test.sender_address.equals("vmk-post@yandex.ru")&&
|
||||
(test.group_id==group_id_in)&&(test.description.equalsIgnoreCase(description_in)))
|
||||
if (test.sender_address.equals("vmk-post@yandex.ru") &&
|
||||
(test.group_id == group_id_in) && (test.description.equalsIgnoreCase(description_in)))
|
||||
return test;
|
||||
}
|
||||
return null;
|
||||
@@ -122,6 +122,6 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
if (test.isSelected()) selectedTests.add(test);
|
||||
}
|
||||
}
|
||||
return selectedTests.isEmpty()?allTests:selectedTests;
|
||||
return selectedTests.isEmpty() ? allTests : selectedTests;
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@ public enum TestType {
|
||||
Performance,
|
||||
SAPFOR,
|
||||
;
|
||||
public String getDescription(){
|
||||
switch (this){
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Correctness:
|
||||
return "Корректность";
|
||||
case Performance:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.AddTestMenu;
|
||||
import _VisualDVM.TestingSystem.Common.Test.UI.EditTestMenu;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
public class TestsMenuBar extends DataMenuBar {
|
||||
public TestsMenuBar() {
|
||||
super("тесты");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test.UI;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class AddTestMenu extends VisualiserMenu {
|
||||
public AddTestMenu() {
|
||||
super("Добавление теста", "/icons/RedAdd.png", false);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package _VisualDVM.TestingSystem.Common.Test.UI;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class EditTestMenu extends VisualiserMenu {
|
||||
public EditTestMenu() {
|
||||
super("Редактирование теста", "/icons/Edit.png", false);
|
||||
add( Global.mainModule.getPass(PassCode.EditTest).createMenuItem());
|
||||
add( Global.mainModule.getPass(PassCode.ReplaceTestProject).createMenuItem());
|
||||
add(Global.mainModule.getPass(PassCode.EditTest).createMenuItem());
|
||||
add(Global.mainModule.getPass(PassCode.ReplaceTestProject).createMenuItem());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,13 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class TestFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
private JPanel content;
|
||||
public JSpinner sMinDim;
|
||||
public JSpinner sMaxDim;
|
||||
private JPanel content;
|
||||
public TestFields() {
|
||||
sMinDim.setModel(new SpinnerNumberModel(1, 0, 16, 1));
|
||||
sMaxDim.setModel(new SpinnerNumberModel(1, 0, 16, 1));
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
@@ -17,8 +21,4 @@ public class TestFields implements DialogFields {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public TestFields(){
|
||||
sMinDim.setModel(new SpinnerNumberModel(1, 0, 16,1));
|
||||
sMaxDim.setModel(new SpinnerNumberModel(1, 0, 16,1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package _VisualDVM.TestingSystem.Common;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.Menus.VisualiserMenuBar;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class TestingBar extends VisualiserMenuBar {
|
||||
// public JLabel KernelsLabel;
|
||||
// public JLabel KernelsLabel;
|
||||
public JButton autorefreshButton;
|
||||
JSpinner sCheckTime;
|
||||
// JSpinner sKernels;
|
||||
// JSpinner sKernels;
|
||||
JLabel serverAdminLabel;
|
||||
public TestingBar() {
|
||||
//-
|
||||
// KernelsLabel = addLabel("", "/icons/Kernels.png");
|
||||
// KernelsLabel.setHorizontalTextPosition(JLabel.LEFT);
|
||||
// KernelsLabel.setToolTipText("количество ядер, задействованное при тестировании");
|
||||
// KernelsLabel = addLabel("", "/icons/Kernels.png");
|
||||
// KernelsLabel.setHorizontalTextPosition(JLabel.LEFT);
|
||||
// KernelsLabel.setToolTipText("количество ядер, задействованное при тестировании");
|
||||
/*
|
||||
add(sKernels = new JSpinner());
|
||||
sKernels.setPreferredSize(new Dimension(60, 26));
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.Common.TestingPackage;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
||||
import _VisualDVM.TestingSystem.Common.Configuration.Json.ConfigurationsJson;
|
||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||
@@ -28,6 +28,14 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
public TasksPackageState state = TasksPackageState.Draft;
|
||||
@Description("DEFAULT ''")
|
||||
public String packedConfigurationsJson = "";
|
||||
//json где хранятся задачи----------------------------------
|
||||
@Description("IGNORE")
|
||||
public J package_json = null;
|
||||
public TestingPackage(TestingPackage p) {
|
||||
SynchronizeFields(p);
|
||||
}
|
||||
public TestingPackage() {
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
@@ -46,12 +54,7 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
connectionErrosCount = tp.connectionErrosCount;
|
||||
state = tp.state;
|
||||
//--
|
||||
packedConfigurationsJson= tp.packedConfigurationsJson;
|
||||
}
|
||||
public TestingPackage(TestingPackage p) {
|
||||
SynchronizeFields(p);
|
||||
}
|
||||
public TestingPackage() {
|
||||
packedConfigurationsJson = tp.packedConfigurationsJson;
|
||||
}
|
||||
public File getLocalWorkspace() {
|
||||
return new File(getHomeDirectory(), String.valueOf(id));
|
||||
@@ -59,9 +62,6 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
public boolean isLoaded() {
|
||||
return new File(getLocalWorkspace(), Constants.LOADED).exists();
|
||||
}
|
||||
//json где хранятся задачи----------------------------------
|
||||
@Description("IGNORE")
|
||||
public J package_json = null;
|
||||
public abstract Class getJsonClass();
|
||||
public abstract File getHomeDirectory();
|
||||
public File getJsonFile() {
|
||||
@@ -84,7 +84,6 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
packedConfigurationsJson = Utils_.gson.toJson(new ConfigurationsJson(configurations));
|
||||
}
|
||||
//определить завершен пакет с ошибками или нет.
|
||||
public void checkFinishState() throws Exception{
|
||||
|
||||
public void checkFinishState() throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package _VisualDVM.TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Loggable;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.RepositoryClient;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
import _VisualDVM.TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
|
||||
import _VisualDVM.Repository.RepositoryClient;
|
||||
import Common.Utils.Loggable;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -26,6 +26,49 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
protected File supervisorHome = null;
|
||||
protected Machine machine = null;
|
||||
protected User user = null;
|
||||
//---
|
||||
public TestingPlanner() {
|
||||
}
|
||||
public TestingPlanner(String... args) {
|
||||
//---
|
||||
String machineAddress = args[0];
|
||||
int machinePort = Integer.parseInt(args[1]);
|
||||
String userName = args[2];
|
||||
String userPassword = args[3];
|
||||
String userWorkspace = args[4];
|
||||
String testingSystemRoot = args[5];
|
||||
serverName = args[6];
|
||||
supervisorHome = Utils_.getHomeDirectory(); //при инициализации это текущая папка.
|
||||
//---
|
||||
Utils_.MainLog = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return supervisorHome.getAbsolutePath();
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return Global.mode.toString();
|
||||
}
|
||||
};
|
||||
Utils_.MainLog.ClearLog();
|
||||
//--
|
||||
Utils_.setHomePath(testingSystemRoot);
|
||||
Global.CheckTestingSystemDirectories();
|
||||
//---
|
||||
machine = new Machine(machineAddress, machineAddress, machinePort, MachineType.Server);
|
||||
user = new User(userName, userPassword, userWorkspace);
|
||||
//---
|
||||
Print("machineAddress=" + Utils_.Brackets(machineAddress));
|
||||
Print("machinePort=" + Utils_.Brackets(String.valueOf(machinePort)));
|
||||
Print("userName=" + Utils_.Brackets(userName));
|
||||
Print("userPassword=" + Utils_.Brackets(userPassword));
|
||||
Print("userWorkspace=" + Utils_.Brackets(userWorkspace));
|
||||
Print("root=" + Utils_.Brackets(Utils_.getHomePath()));
|
||||
Print("serverName=" + serverName);
|
||||
Print("=====");
|
||||
//----
|
||||
Utils.createEmptyFile(Constants.STARTED);
|
||||
}
|
||||
//----
|
||||
protected void UpdatePackageState(TasksPackageState state_in) throws Exception {
|
||||
testingPackage.state = state_in;
|
||||
@@ -62,8 +105,8 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
void EmailPackage() throws Exception {
|
||||
if (testingPackage.needsEmail == 1) {
|
||||
EmailMessage message = new EmailMessage();
|
||||
message.subject = "Состояние пакета тестирования "+packageDescription()+ " "+
|
||||
Utils_.Brackets(testingPackage.id) + " изменилось на " + Utils_.Brackets(testingPackage.state.getDescription());
|
||||
message.subject = "Состояние пакета тестирования " + packageDescription() + " " +
|
||||
Utils_.Brackets(testingPackage.id) + " изменилось на " + Utils_.Brackets(testingPackage.state.getDescription());
|
||||
message.text = testingPackage.description;
|
||||
message.targets.add(testingPackage.sender_address);
|
||||
ServerCommand(ServerCode.Email, message);
|
||||
@@ -76,10 +119,11 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
protected void InitSessionCredentials() {
|
||||
}
|
||||
protected abstract void TestsSynchronize() throws Exception;
|
||||
;
|
||||
protected abstract void PackageWorkspaceCreation() throws Exception;
|
||||
protected void AnalyseResults() throws Exception {
|
||||
UpdatePackageState(TasksPackageState.Done);
|
||||
};
|
||||
}
|
||||
protected abstract void PackageStart() throws Exception;
|
||||
protected abstract boolean CheckNextState() throws Exception;
|
||||
protected abstract void DownloadResults() throws Exception;
|
||||
@@ -116,7 +160,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
} else {
|
||||
//--
|
||||
System.out.println(testingPackage.id+":"+testingPackage.state.getDescription());
|
||||
System.out.println(testingPackage.id + ":" + testingPackage.state.getDescription());
|
||||
switch (testingPackage.state) {
|
||||
case TestsSynchronize:
|
||||
TestsSynchronize();
|
||||
@@ -184,48 +228,6 @@ public abstract class TestingPlanner<P extends TestingPackage> extends Repositor
|
||||
public String getPlanner() {
|
||||
return String.join("/", user.workspace, "modules", "planner");
|
||||
}
|
||||
//---
|
||||
public TestingPlanner(){}
|
||||
public TestingPlanner(String... args) {
|
||||
//---
|
||||
String machineAddress = args[0];
|
||||
int machinePort = Integer.parseInt(args[1]);
|
||||
String userName = args[2];
|
||||
String userPassword = args[3];
|
||||
String userWorkspace = args[4];
|
||||
String testingSystemRoot = args[5];
|
||||
serverName = args[6];
|
||||
supervisorHome = Utils_.getHomeDirectory(); //при инициализации это текущая папка.
|
||||
//---
|
||||
Utils_.MainLog = new Loggable() {
|
||||
@Override
|
||||
public String getLogHomePath() {
|
||||
return supervisorHome.getAbsolutePath();
|
||||
}
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return Global.mode.toString();
|
||||
}
|
||||
};
|
||||
Utils_.MainLog.ClearLog();
|
||||
//--
|
||||
Utils_.setHomePath(testingSystemRoot);
|
||||
Global.CheckTestingSystemDirectories();
|
||||
//---
|
||||
machine = new Machine(machineAddress, machineAddress, machinePort, MachineType.Server);
|
||||
user = new User(userName, userPassword, userWorkspace);
|
||||
//---
|
||||
Print("machineAddress=" + Utils_.Brackets(machineAddress));
|
||||
Print("machinePort=" + Utils_.Brackets(String.valueOf(machinePort)));
|
||||
Print("userName=" + Utils_.Brackets(userName));
|
||||
Print("userPassword=" + Utils_.Brackets(userPassword));
|
||||
Print("userWorkspace=" + Utils_.Brackets(userWorkspace));
|
||||
Print("root=" + Utils_.Brackets(Utils_.getHomePath()));
|
||||
Print("serverName=" + serverName);
|
||||
Print("=====");
|
||||
//----
|
||||
Utils.createEmptyFile(Constants.STARTED);
|
||||
}
|
||||
/*
|
||||
void CheckLocal() {
|
||||
local = false;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package _VisualDVM.TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.Passes.All.DownloadRepository;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
@@ -31,9 +33,7 @@ import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsComma
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTestingPlanner;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
||||
import _VisualDVM.Passes.All.DownloadRepository;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -45,8 +45,39 @@ import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
public String name = "?";
|
||||
public static MachineProcessSet machinesProcesses = new MachineProcessSet();
|
||||
//------>>>
|
||||
public static Timer checkTimer = null;
|
||||
public String name = "?";
|
||||
DVMTestingChecker dvmTestingChecker = new DVMTestingChecker();
|
||||
SapforTestingPlanner sapforTestingPlanner = new SapforTestingPlanner();
|
||||
//--
|
||||
protected Thread testingThread = new Thread(() -> {
|
||||
while (true) {
|
||||
dvmTestingChecker.Perform();
|
||||
sapforTestingPlanner.Perform();
|
||||
Utils_.sleep(5000);
|
||||
}
|
||||
});
|
||||
public TestingServer() {
|
||||
super(TestsDatabase.class);
|
||||
name = Utils_.getDateName("testingServer");
|
||||
System.out.println("ServerName=" + Utils_.Brackets(name));
|
||||
}
|
||||
public static void TimerOn() {
|
||||
checkTimer = new Timer(Global.properties.CheckTestingIntervalSeconds * 1000, e -> {
|
||||
Global.mainModule.getPass(PassCode.ActualizePackages).Do();
|
||||
});
|
||||
checkTimer.start();
|
||||
}
|
||||
public static void TimerOff() {
|
||||
if (checkTimer != null)
|
||||
checkTimer.stop();
|
||||
}
|
||||
public static void ResetTimer() {
|
||||
TimerOff();
|
||||
TimerOn();
|
||||
}
|
||||
@Override
|
||||
public void afterPublishAction(DBObject object) throws Exception {
|
||||
if (object instanceof Test) {
|
||||
@@ -94,7 +125,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
((ServerSapfor) object).home_path
|
||||
)
|
||||
);
|
||||
} else if (object instanceof DVMPackage) {
|
||||
} else if (object instanceof DVMPackage) {
|
||||
DVMPackage dvmPackage = (DVMPackage) object;
|
||||
File workspace = dvmPackage.getLocalWorkspace();
|
||||
Utils_.forceDeleteWithCheck(workspace);
|
||||
@@ -106,7 +137,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
SapforSettings sapforSettings = (SapforSettings) object;
|
||||
Vector<SapforSettingsCommand> commands = new Vector<>();
|
||||
for (SapforSettingsCommand command : db.sapforSettingsCommands.Data.values()) {
|
||||
if (command.sapforsettings_id== sapforSettings.id)
|
||||
if (command.sapforsettings_id == sapforSettings.id)
|
||||
commands.add(command);
|
||||
}
|
||||
for (SapforSettingsCommand command : commands) {
|
||||
@@ -124,11 +155,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
throw new RepositoryRefuseException("Актуальная версия SAPFOR " + max_installed_version + " уже установлена");
|
||||
}
|
||||
}
|
||||
public TestingServer() {
|
||||
super(TestsDatabase.class);
|
||||
name = Utils_.getDateName("testingServer");
|
||||
System.out.println("ServerName=" + Utils_.Brackets(name));
|
||||
}
|
||||
//основа
|
||||
@Override
|
||||
public int getPort() {
|
||||
@@ -139,32 +165,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
protected void startAdditionalThreads() {
|
||||
testingThread.start();
|
||||
}
|
||||
DVMTestingChecker dvmTestingChecker = new DVMTestingChecker();
|
||||
SapforTestingPlanner sapforTestingPlanner = new SapforTestingPlanner();
|
||||
//--
|
||||
protected Thread testingThread = new Thread(() -> {
|
||||
while (true) {
|
||||
dvmTestingChecker.Perform();
|
||||
sapforTestingPlanner.Perform();
|
||||
Utils_.sleep(5000);
|
||||
}
|
||||
});
|
||||
//------>>>
|
||||
public static Timer checkTimer = null;
|
||||
public static void TimerOn() {
|
||||
checkTimer = new Timer(Global.properties.CheckTestingIntervalSeconds * 1000, e -> {
|
||||
Global.mainModule.getPass(PassCode.ActualizePackages).Do();
|
||||
});
|
||||
checkTimer.start();
|
||||
}
|
||||
public static void TimerOff() {
|
||||
if (checkTimer != null)
|
||||
checkTimer.stop();
|
||||
}
|
||||
public static void ResetTimer() {
|
||||
TimerOff();
|
||||
TimerOn();
|
||||
}
|
||||
@Override
|
||||
protected void Session() throws Exception {
|
||||
Test test;
|
||||
@@ -178,7 +178,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
EmailMessage message = Log.isEmpty() ?
|
||||
new EmailMessage(
|
||||
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
"Пакет "+ Utils_.Brackets(autoPackage.id), new Vector<>()) :
|
||||
"Пакет " + Utils_.Brackets(autoPackage.id), new Vector<>()) :
|
||||
new EmailMessage(
|
||||
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
Log.toString(),
|
||||
@@ -296,7 +296,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
&& !pathname.getName().equals("settings")
|
||||
&& !pathname.getName().equals("test-analyzer.sh")
|
||||
&& Utils_.getExtension(pathname).startsWith(languageName.getDVMCompile()));
|
||||
;
|
||||
if (files != null) {
|
||||
groupFiles = new Vector<>(Arrays.asList(files));
|
||||
groupFiles.sort(Comparator.comparing(File::getName));
|
||||
@@ -488,7 +487,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
File json = dvmPackage.getJsonFile();
|
||||
if (!json.exists())
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач DVM " + Utils_.Brackets(package_id));
|
||||
jsons.add((DVMPackage_json) Utils_.jsonFromFile(json, DVMPackage_json.class));
|
||||
jsons.add(Utils_.jsonFromFile(json, DVMPackage_json.class));
|
||||
}
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = jsons;
|
||||
@@ -503,7 +502,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
File json = sapforPackage.getJsonFile();
|
||||
if (!json.exists())
|
||||
throw new RepositoryRefuseException("Не найден JSON файл для пакета задач SAPFOR " + Utils_.Brackets(package_id));
|
||||
jsons.add((SapforPackage_json) Utils_.jsonFromFile(json, SapforPackage_json.class));
|
||||
jsons.add(Utils_.jsonFromFile(json, SapforPackage_json.class));
|
||||
}
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = jsons;
|
||||
@@ -614,8 +613,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
account.email = Constants.MailAddress;
|
||||
//-
|
||||
int sapforId = Integer.parseInt(request.arg);
|
||||
System.out.println("Sapfor_id = "+request.arg);
|
||||
|
||||
System.out.println("Sapfor_id = " + request.arg);
|
||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
||||
Log.Writeln_("Версия SAPFOR " + sapforId + " не существует.");
|
||||
return null;
|
||||
@@ -646,6 +644,5 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
//--
|
||||
return target;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.Common;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Repository.RepositoryRefuseException;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
@@ -27,8 +28,7 @@ import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsComma
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforsDBTable;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
addTable(serverSapfors = new ServerSapforsDBTable());
|
||||
addTable(sapforSettings = new SapforSettingsDBTable());
|
||||
addTable(sapforSettingsCommands = new SapforSettingsCommandsDBTable());
|
||||
addTable(dvmSettings=new DVMSettingsDBTable());
|
||||
addTable(dvmSettings = new DVMSettingsDBTable());
|
||||
}
|
||||
@Override
|
||||
public PassCode getSynchronizePassCode() {
|
||||
@@ -286,7 +286,6 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
public Integer getInstalledSapforMaxVersion() {
|
||||
int max_version = CommonConstants.Nan;
|
||||
@@ -315,16 +314,14 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
tests.CheckAll(false);
|
||||
dvm_configurations.CheckAll(false);
|
||||
}
|
||||
|
||||
public void CheckTestsPackagesDependencies(Vector<Integer> testsIds, TextLog Log){
|
||||
public void CheckTestsPackagesDependencies(Vector<Integer> testsIds, TextLog Log) {
|
||||
//определить есть ли активные пакеты в которые входят упомянутые тесты
|
||||
//если есть выписать группа/тест причина - находится в активном пакете
|
||||
}
|
||||
|
||||
public void RefreshTestNameInConfigurations(Integer testId){
|
||||
public void RefreshTestNameInConfigurations(Integer testId) {
|
||||
//обновить имя теста во всех конфигурация
|
||||
}
|
||||
public void DeleteTestFromConfigurations(Integer testId){
|
||||
public void DeleteTestFromConfigurations(Integer testId) {
|
||||
//обновить имя теста во всех конфигурация
|
||||
}
|
||||
//todo возможно рассмотреть вариант с синхроннизацией тестов для пакетов через команду серверу а не в нити
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.Common.ThreadsPlanner;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.InterruptThread;
|
||||
import Common.Utils.Utils_;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -36,7 +36,7 @@ public abstract class ThreadsPlanner {
|
||||
kernels = maxKernels;
|
||||
}
|
||||
public String printThread(Integer id) {
|
||||
return "thread id = "+id;
|
||||
return "thread id = " + id;
|
||||
}
|
||||
public String getThreadsSummary() {
|
||||
Vector<String> lines = new Vector<>();
|
||||
@@ -83,13 +83,12 @@ public abstract class ThreadsPlanner {
|
||||
}
|
||||
activeThreads.removeAll(toExclude);
|
||||
//--
|
||||
double progress = ((double)done_threads/threads.size())*100.0;
|
||||
Utils_.MainLog.Print("done_threads="+done_threads+";all_threads="+threads.size()+";progress="+progress);
|
||||
double progress = ((double) done_threads / threads.size()) * 100.0;
|
||||
Utils_.MainLog.Print("done_threads=" + done_threads + ";all_threads=" + threads.size() + ";progress=" + progress);
|
||||
File progress_file = new File("progress");
|
||||
try {
|
||||
FileUtils.writeStringToFile(progress_file, String.valueOf(((int)progress)));
|
||||
}
|
||||
catch (Exception exception){
|
||||
FileUtils.writeStringToFile(progress_file, String.valueOf(((int) progress)));
|
||||
} catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,15 @@ import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
||||
//конфгурация тестирования ДВМ
|
||||
public class DVMConfiguration extends Configuration {
|
||||
public int c_maxtime = 40;
|
||||
public DVMConfiguration(DVMConfiguration src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public DVMConfiguration() {
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMConfiguration c = (DVMConfiguration) src;
|
||||
c_maxtime=c.c_maxtime;
|
||||
c_maxtime = c.c_maxtime;
|
||||
}
|
||||
public DVMConfiguration(DVMConfiguration src){
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public DVMConfiguration(){}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.TableRenderers;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI.ConfigurationFields;
|
||||
public class DVMConfigurationDBTable extends iDBTable<DVMConfiguration> {
|
||||
public DVMConfigurationDBTable() {
|
||||
|
||||
@@ -6,12 +6,10 @@ public class DVMConfigurationsMenuBar extends DataMenuBar {
|
||||
super("конфигурации");
|
||||
addPasses(
|
||||
PassCode.PublishConfiguration,
|
||||
|
||||
PassCode.EditConfiguration,
|
||||
PassCode.ShowCurrentDVMConfigurationTests,
|
||||
PassCode.SaveCurrentDVMConfiguration,
|
||||
PassCode.DeleteConfiguration,
|
||||
|
||||
PassCode.StartSelectedDVMConfigurations
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMConfiguration.UI;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Constants;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -9,18 +9,10 @@ public class ConfigurationFields implements DialogFields {
|
||||
public JTextField tfName;
|
||||
public JSpinner sCompilationMaxtime;
|
||||
public JSpinner sRunMaxtime;
|
||||
public JSpinner sKernels;
|
||||
//-
|
||||
private JPanel content;
|
||||
public JSpinner sKernels;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public ConfigurationFields(){
|
||||
public ConfigurationFields() {
|
||||
sCompilationMaxtime.setModel(new SpinnerNumberModel(40,
|
||||
5, 3600, 1
|
||||
));
|
||||
@@ -31,4 +23,12 @@ public class ConfigurationFields implements DialogFields {
|
||||
Constants.testingMaxKernels,
|
||||
1));
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ServerObjectsCache.DVMConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.GlobalData.Compiler.Compiler;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.ServerObjectsCache.DVMConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
@@ -78,6 +77,10 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
package_json = new DVMPackage_json(compilationTasks);
|
||||
saveConfigurationsAsJson(configurations);
|
||||
}
|
||||
public DVMPackage(DVMPackage p) {
|
||||
super(p);
|
||||
this.SynchronizeFields(p);
|
||||
}
|
||||
@Override
|
||||
public Class getJsonClass() {
|
||||
return DVMPackage_json.class;
|
||||
@@ -86,10 +89,6 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
public File getHomeDirectory() {
|
||||
return Global.DVMPackagesDirectory;
|
||||
}
|
||||
public DVMPackage(DVMPackage p) {
|
||||
super(p);
|
||||
this.SynchronizeFields(p);
|
||||
}
|
||||
//---
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
@@ -115,7 +114,6 @@ public class DVMPackage extends TestingPackage<DVMPackage_json> {
|
||||
}
|
||||
@Override
|
||||
public void checkFinishState() throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ServerObjectsCache.PackageCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
@@ -40,7 +40,7 @@ public class DVMPackageDBTable extends iDBTable<DVMPackage> {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(6).setRenderer(RendererMultiline);
|
||||
// columns.get(7).setRenderer(RendererMultiline);
|
||||
// columns.get(7).setRenderer(RendererMultiline);
|
||||
columns.get(9).setRenderer(RendererProgress);
|
||||
columns.get(10).setRenderer(RendererDate);
|
||||
columns.get(11).setRenderer(RendererDate);
|
||||
@@ -64,7 +64,6 @@ public class DVMPackageDBTable extends iDBTable<DVMPackage> {
|
||||
public void MouseAction2() throws Exception {
|
||||
Global.mainModule.getPass(PassCode.DownloadDVMPackage).Do();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -11,11 +11,9 @@ public class DVMPackage_json implements Serializable {
|
||||
public int max_task_id = 0;
|
||||
@Expose
|
||||
public List<DVMCompilationTask> compilationTasks = new Vector<>();
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
public DVMPackage_json() {
|
||||
}
|
||||
public DVMPackage_json(){}
|
||||
public DVMPackage_json(List<DVMCompilationTask> tasks){
|
||||
public DVMPackage_json(List<DVMCompilationTask> tasks) {
|
||||
for (DVMCompilationTask compilationTask : tasks) {
|
||||
compilationTask.id = getMaxTaskId();
|
||||
//-
|
||||
@@ -26,4 +24,7 @@ public class DVMPackage_json implements Serializable {
|
||||
}
|
||||
compilationTasks.addAll(tasks);
|
||||
}
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMPackage;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -11,7 +11,7 @@ public class DVMPackagesBar extends DataMenuBar {
|
||||
super("пакеты задач DVM");
|
||||
addPasses(PassCode.SynchronizeTests);
|
||||
addSeparator();
|
||||
addPasses(PassCode.AbortDVMPackage );
|
||||
addPasses(PassCode.AbortDVMPackage);
|
||||
addSeparator();
|
||||
addPasses(PassCode.DownloadDVMPackage,
|
||||
PassCode.ExportDVMPackageToExcel,
|
||||
|
||||
@@ -7,40 +7,41 @@ import com.sun.org.glassfish.gmbal.Description;
|
||||
import java.util.Vector;
|
||||
public class DVMSettings extends Settings {
|
||||
//todo.хранить флаги и окружение в json чтобы можно было в форме их видеть.
|
||||
public String environments="";
|
||||
public String environments = "";
|
||||
@Description("DEFAULT 0")
|
||||
public int Is_DVM_STAT= 0; //флаг вмест usr par, которые не использовались.
|
||||
// public String usr_par = "";
|
||||
public int Is_DVM_STAT = 0; //флаг вмест usr par, которые не использовались.
|
||||
// public String usr_par = "";
|
||||
//---
|
||||
public int cube = 0; //
|
||||
public int max_proc_count = 4;
|
||||
public int min_dim_proc_count = 1;
|
||||
public int max_dim_proc_count = 4;
|
||||
//
|
||||
public DVMSettings(){}
|
||||
public DVMSettings(DVMSettings src){
|
||||
public DVMSettings() {
|
||||
}
|
||||
public DVMSettings(DVMSettings src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
DVMSettings c = (DVMSettings) src;
|
||||
environments=c.environments;
|
||||
environments = c.environments;
|
||||
Is_DVM_STAT = c.Is_DVM_STAT;
|
||||
// usr_par=c.usr_par;
|
||||
// usr_par=c.usr_par;
|
||||
//-
|
||||
cube= c.cube;
|
||||
max_proc_count=c.max_proc_count;
|
||||
min_dim_proc_count=c.min_dim_proc_count;
|
||||
max_dim_proc_count=c.max_dim_proc_count;
|
||||
cube = c.cube;
|
||||
max_proc_count = c.max_proc_count;
|
||||
min_dim_proc_count = c.min_dim_proc_count;
|
||||
max_dim_proc_count = c.max_dim_proc_count;
|
||||
}
|
||||
public String printUsrPar(){
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
public String printUsrPar() {
|
||||
return "Is_DVM_STAT=" + Is_DVM_STAT;
|
||||
}
|
||||
public Vector<String> getMatrixes(int testDim) {
|
||||
Vector<Vector<Integer>> res_ = new Vector<>();
|
||||
Vector<String> res = new Vector<>();
|
||||
if ((max_proc_count==0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
||||
if ((max_proc_count == 0) || (min_dim_proc_count == 0 && max_dim_proc_count == 0)) {
|
||||
res.add("");
|
||||
} else {
|
||||
if (testDim > 0) {
|
||||
@@ -81,7 +82,7 @@ public class DVMSettings extends Settings {
|
||||
return res;
|
||||
}
|
||||
public String getParamsText() {
|
||||
return "Is_DVM_STAT="+Is_DVM_STAT;
|
||||
return "Is_DVM_STAT=" + Is_DVM_STAT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMSettings;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMSettings.UI.DVMSettingsFields;
|
||||
public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
@@ -117,7 +117,7 @@ public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
fields.cbCube.setSelected(Result.cube == 1);
|
||||
//-
|
||||
fields.sMaxProc.setValue(Result.max_proc_count);
|
||||
fields.cbDvmStat.setSelected(Result.Is_DVM_STAT!=0);
|
||||
fields.cbDvmStat.setSelected(Result.Is_DVM_STAT != 0);
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
@@ -128,7 +128,7 @@ public class DVMSettingsDBTable extends iDBTable<DVMSettings> {
|
||||
Result.max_proc_count = (int) fields.sMaxProc.getValue();
|
||||
Result.flags = fields.tfFlags.getText();
|
||||
Result.environments = fields.tfEnvironments.getText();
|
||||
Result.Is_DVM_STAT = fields.cbDvmStat.isSelected()?1:0;
|
||||
Result.Is_DVM_STAT = fields.cbDvmStat.isSelected() ? 1 : 0;
|
||||
}
|
||||
@Override
|
||||
public void SetReadonly() {
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMSettings.UI;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.Pass;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
public class DVMSettingsFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JSpinner sMinDimProc;
|
||||
public JSpinner sMaxDimProc;
|
||||
@@ -18,38 +17,31 @@ public class DVMSettingsFields implements DialogFields {
|
||||
public JCheckBox cbCube;
|
||||
public JTextField tfFlags;
|
||||
public JTextField tfEnvironments;
|
||||
public JCheckBox cbDvmStat;
|
||||
private JPanel content;
|
||||
private JButton bAddFlags;
|
||||
private JButton bAddEnvironments;
|
||||
private JButton bDeleteFlags;
|
||||
private JButton bDeleteEnvironment;
|
||||
public JCheckBox cbDvmStat;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public DVMSettingsFields(){
|
||||
public DVMSettingsFields() {
|
||||
sMinDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxDimProc.setModel(new SpinnerNumberModel(1, 0, 128, 1));
|
||||
sMaxProc.setModel(new SpinnerNumberModel(0, 0, 128, 1));
|
||||
bAddFlags.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerOptions);
|
||||
if (pass.Do(Global.mainModule.getCompiler())) {
|
||||
tfFlags.setText((String)pass.target);
|
||||
tfFlags.setText((String) pass.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
bAddEnvironments.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
|
||||
Pass pass = Global.mainModule.getPass(PassCode.PickCompilerEnvironmentsForTesting);
|
||||
if (pass.Do(Global.mainModule.getCompiler()))
|
||||
tfEnvironments.setText((String)pass.target);
|
||||
tfEnvironments.setText((String) pass.target);
|
||||
}
|
||||
});
|
||||
bDeleteFlags.addActionListener(new ActionListener() {
|
||||
@@ -65,4 +57,12 @@ public class DVMSettingsFields implements DialogFields {
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,38 +13,10 @@ public class DVMCompilationTask extends DVMTask {
|
||||
public List<DVMRunTask> runTasks = new Vector<>();
|
||||
//-
|
||||
public DVMCompilationTask() {
|
||||
|
||||
}
|
||||
@Override
|
||||
public Vector<String> pack(Object arg) {
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(String.valueOf(id)); //1
|
||||
res.add(String.valueOf(maxtime)); //2
|
||||
res.add(String.valueOf(test_id)); //3
|
||||
res.add(arg.toString().replace("\n", "|")); //4
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
public static String checkFlags(String flags_in) {
|
||||
if (!flags_in.contains("-shared-dvm")) {
|
||||
if (flags_in.isEmpty())
|
||||
return "-shared-dvm";
|
||||
else return flags_in + " -shared-dvm";
|
||||
} else
|
||||
return flags_in;
|
||||
}
|
||||
public static String checkEnvironments(String environmentsSet_in) {
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")) {
|
||||
if (environmentsSet_in.isEmpty())
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
else
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
} else
|
||||
return environmentsSet_in;
|
||||
}
|
||||
//--
|
||||
public DVMCompilationTask(DVMConfiguration configuration, DVMSettings dvmSettings, Group group, Test test, int kernels_in){
|
||||
super (configuration, group, test,checkFlags(dvmSettings.flags));
|
||||
public DVMCompilationTask(DVMConfiguration configuration, DVMSettings dvmSettings, Group group, Test test, int kernels_in) {
|
||||
super(configuration, group, test, checkFlags(dvmSettings.flags));
|
||||
Vector<String> matrixes = dvmSettings.getMatrixes(test.max_dim);
|
||||
String checkedEnvironments = checkEnvironments(dvmSettings.environments);
|
||||
if (dvmSettings.flags.trim().equalsIgnoreCase("-s")) {
|
||||
@@ -71,4 +43,31 @@ public class DVMCompilationTask extends DVMTask {
|
||||
kernels_in));
|
||||
}
|
||||
}
|
||||
//--
|
||||
public static String checkFlags(String flags_in) {
|
||||
if (!flags_in.contains("-shared-dvm")) {
|
||||
if (flags_in.isEmpty())
|
||||
return "-shared-dvm";
|
||||
else return flags_in + " -shared-dvm";
|
||||
} else
|
||||
return flags_in;
|
||||
}
|
||||
public static String checkEnvironments(String environmentsSet_in) {
|
||||
if (!environmentsSet_in.contains("DVMH_NO_DIRECT_COPY")) {
|
||||
if (environmentsSet_in.isEmpty())
|
||||
return "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
else
|
||||
return environmentsSet_in + " " + "DVMH_NO_DIRECT_COPY=" + Utils_.DQuotes("1");
|
||||
} else
|
||||
return environmentsSet_in;
|
||||
}
|
||||
@Override
|
||||
public Vector<String> pack(Object arg) {
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add(String.valueOf(id)); //1
|
||||
res.add(String.valueOf(maxtime)); //2
|
||||
res.add(String.valueOf(test_id)); //3
|
||||
res.add(arg.toString().replace("\n", "|")); //4
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMTasks;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.Common.Test.TestType;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMSettings.DVMSettings;
|
||||
import _VisualDVM.Utils;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.File;
|
||||
@@ -68,6 +68,9 @@ public class DVMRunTask extends DVMTask {
|
||||
}
|
||||
public DVMRunTask() {
|
||||
}
|
||||
public DVMRunTask(DVMRunTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
@@ -88,9 +91,6 @@ public class DVMRunTask extends DVMTask {
|
||||
compilation_time = rt.compilation_time;
|
||||
args = rt.args;
|
||||
}
|
||||
public DVMRunTask(DVMRunTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public Vector<String> pack(Object arg) {
|
||||
@@ -124,10 +124,10 @@ public class DVMRunTask extends DVMTask {
|
||||
).toFile();
|
||||
}
|
||||
public String getCompilationOutput() {
|
||||
return getResultFile(new File(getCompilationTaskWorkspace(),Constants.out_file));
|
||||
return getResultFile(new File(getCompilationTaskWorkspace(), Constants.out_file));
|
||||
}
|
||||
public String getCompilationErrors() {
|
||||
return getResultFile(new File(getCompilationTaskWorkspace(),Constants.err_file));
|
||||
return getResultFile(new File(getCompilationTaskWorkspace(), Constants.err_file));
|
||||
}
|
||||
public String getStatistic() {
|
||||
return getResultFile(new File(getLocalWorkspace(), Constants.statistic + ".txt"));
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMTasks;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import Common.Visual.DBObjectFilter;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.DataSetFilter;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
|
||||
@@ -14,6 +14,9 @@ import static Common.Visual.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class DVMRunTasksSet extends DataSet<Integer, DVMRunTask> {
|
||||
//todo обобщить бы наличие фильтров для всех таблиц.
|
||||
DVMPackage target;
|
||||
public DVMRunTasksSet() {
|
||||
super(Integer.class, DVMRunTask.class);
|
||||
}
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
filters.add(new DataSetFilter<DVMRunTask>("Компиляция", this) {
|
||||
@@ -47,9 +50,6 @@ public class DVMRunTasksSet extends DataSet<Integer, DVMRunTask> {
|
||||
}
|
||||
});
|
||||
}
|
||||
public DVMRunTasksSet() {
|
||||
super(Integer.class, DVMRunTask.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "задача";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.DVM.DVMTasks;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
@@ -42,6 +42,21 @@ public class DVMTask extends iDBObject {
|
||||
//результаты-------------------------------
|
||||
@Expose
|
||||
public double Time; //время выполнения.
|
||||
public DVMTask(DVMTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public DVMTask() {
|
||||
}
|
||||
public DVMTask(DVMConfiguration configuration,
|
||||
Group group, Test test, String flags_in) {
|
||||
group_id = group.id;
|
||||
test_id = test.id;
|
||||
group_description = group.description;
|
||||
test_description = test.description;
|
||||
test_type = group.type;
|
||||
language = group.language;
|
||||
flags = flags_in;
|
||||
}
|
||||
//------------------------------------------------------
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
@@ -59,21 +74,6 @@ public class DVMTask extends iDBObject {
|
||||
test_type = t.test_type;
|
||||
Time = t.Time;
|
||||
}
|
||||
public DVMTask(DVMTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
public DVMTask() {
|
||||
}
|
||||
public DVMTask(DVMConfiguration configuration,
|
||||
Group group, Test test, String flags_in) {
|
||||
group_id = group.id;
|
||||
test_id = test.id;
|
||||
group_description = group.description;
|
||||
test_description = test.description;
|
||||
test_type = group.type;
|
||||
language = group.language;
|
||||
flags = flags_in;
|
||||
}
|
||||
public File getLocalWorkspace() {
|
||||
return
|
||||
Paths.get(Global.DVMPackagesDirectory.getAbsolutePath(),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
@@ -11,6 +10,7 @@ import _VisualDVM.TestingSystem.Common.TestingPlanner;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMTask;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -24,15 +24,6 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
public DVMTestingPlanner(String[] args) {
|
||||
super(args);
|
||||
}
|
||||
LinkedHashMap<Integer, File> getTestsFromJson() {
|
||||
LinkedHashMap<Integer, File> res = new LinkedHashMap<>();
|
||||
for (DVMCompilationTask task : testingPackage.package_json.compilationTasks) {
|
||||
if (!res.containsKey(task.test_id)) {
|
||||
res.put(task.test_id, Paths.get(Global.TestsDirectory.getAbsolutePath(), String.valueOf(task.test_id)).toFile());
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
static LinkedHashMap<LanguageName, Vector<ProjectFile>> getTestPrograms(File test) {
|
||||
LinkedHashMap<LanguageName, Vector<ProjectFile>> res = new LinkedHashMap<>();
|
||||
//--
|
||||
@@ -86,6 +77,15 @@ public abstract class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
//----->>
|
||||
return String.join("\n", "LINK_COMMAND=" + Utils_.DQuotes(dvm_drv) + " " + test_language.getDVMLink(), "LINK_FLAGS=" + flags + "\n", String.join("\n", titles), "all: " + binary, binary + " : " + String.join(" ", objects), "\t" + Utils.MFVar("LINK_COMMAND") + " " + Utils.MFVar("LINK_FLAGS") + " " + String.join(" ", objects) + " -o " + binary, String.join(" ", bodies));
|
||||
}
|
||||
LinkedHashMap<Integer, File> getTestsFromJson() {
|
||||
LinkedHashMap<Integer, File> res = new LinkedHashMap<>();
|
||||
for (DVMCompilationTask task : testingPackage.package_json.compilationTasks) {
|
||||
if (!res.containsKey(task.test_id)) {
|
||||
res.put(task.test_id, Paths.get(Global.TestsDirectory.getAbsolutePath(), String.valueOf(task.test_id)).toFile());
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public void getTasksInfo(List<? extends DVMTask> tasks, String file_name) throws Exception {
|
||||
LinkedHashMap<Integer, DVMTask> sorted_tasks = new LinkedHashMap<>();
|
||||
for (DVMTask task : tasks)
|
||||
|
||||
@@ -56,9 +56,9 @@ public class LocalDVMTestingPlanner extends DVMTestingPlanner {
|
||||
//синхронизировать их.
|
||||
for (int test_id : tests.keySet()) {
|
||||
File test = tests.get(test_id);
|
||||
File testDst = Paths.get(testingPackage.user_workspace,"projects", String.valueOf(test_id)).toFile();
|
||||
File testDst = Paths.get(testingPackage.user_workspace, "projects", String.valueOf(test_id)).toFile();
|
||||
Print(testDst.getAbsolutePath());
|
||||
FileUtils.copyDirectory(test,testDst);
|
||||
FileUtils.copyDirectory(test, testDst);
|
||||
}
|
||||
Finalize("+");
|
||||
}
|
||||
@@ -81,5 +81,4 @@ public class LocalDVMTestingPlanner extends DVMTestingPlanner {
|
||||
@Override
|
||||
protected void Kill() throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@ package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMCompilationTask;
|
||||
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
|
||||
import _VisualDVM.Passes.All.UnzipFolderPass;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
//--
|
||||
int ct_count = 0;
|
||||
int rt_count = 0;
|
||||
int good=0;
|
||||
int good = 0;
|
||||
//--
|
||||
for (DVMCompilationTask compilationTask : testingPackage.package_json.compilationTasks) {
|
||||
compilationTask.dvm_package_id = testingPackage.id;
|
||||
@@ -164,9 +164,9 @@ public class RemoteDVMTestingPlanner extends DVMTestingPlanner {
|
||||
testingPackage.saveJson(); //запись обновленных результатов пакета в json!
|
||||
Print("analysis done, ct_count=" + ct_count + " rt count=" + rt_count);
|
||||
testingPackage.state = hasErrors ? TasksPackageState.DoneWithErrors : TasksPackageState.Done;
|
||||
double percent = ( ((double)(good))/testingPackage.tasksCount)*100.0;
|
||||
testingPackage.description = "Выполнено на "+((int)percent)+"%\n"+
|
||||
"Всего задач: "+testingPackage.tasksCount+", из них с ошибками "+(testingPackage.tasksCount-good);
|
||||
double percent = (((double) (good)) / testingPackage.tasksCount) * 100.0;
|
||||
testingPackage.description = "Выполнено на " + ((int) percent) + "%\n" +
|
||||
"Всего задач: " + testingPackage.tasksCount + ", из них с ошибками " + (testingPackage.tasksCount - good);
|
||||
UpdatePackageState();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.DVM;
|
||||
import Common.CommonConstants;
|
||||
import Common.Passes.PassException;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import Common.Passes.PassException;
|
||||
import _VisualDVM.Utils;
|
||||
import com.jcraft.jsch.*;
|
||||
import javafx.util.Pair;
|
||||
|
||||
@@ -193,7 +193,6 @@ public class UserConnection {
|
||||
try {
|
||||
sftpChannel.lstat(file_full_name);
|
||||
return true;
|
||||
|
||||
} catch (SftpException e) {
|
||||
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
|
||||
// file doesn't exist
|
||||
@@ -208,7 +207,6 @@ public class UserConnection {
|
||||
try {
|
||||
sftpChannel.lstat(file_full_name);
|
||||
return true;
|
||||
|
||||
} catch (SftpException e) {
|
||||
if (e.id == ChannelSftp.SSH_FX_PERMISSION_DENIED) {
|
||||
// file busy
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -26,19 +26,45 @@ public class SapforPackage_json implements Serializable {
|
||||
//--
|
||||
@Expose
|
||||
public int max_set_id = 0;
|
||||
public int getMaxSetId() {
|
||||
return max_set_id++;
|
||||
}
|
||||
@Expose
|
||||
public int max_task_id = 0;
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
//--в отличие от пакета двм,где достаточно инфы о задачах, тут есть инфа о тестах и конфигурациях
|
||||
@Expose
|
||||
public List<SapforTestingSet_json> testingSets = new Vector<>(); //по факту, сет один. Наследие формирования пакетов.
|
||||
@Expose
|
||||
public List<SapforTask> tasks = new Vector<>();
|
||||
//-
|
||||
public PackageSummary root = null;
|
||||
public PackageComparisonSummary comparison_root = null;
|
||||
//---
|
||||
public SapforPackage_json() {
|
||||
}
|
||||
public SapforPackage_json(ServerSapfor serverSapfor, LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> configurations, int kernels_in) {
|
||||
sapfor_drv = serverSapfor.call_command;
|
||||
kernels = kernels_in;
|
||||
//рудимент от формирования пакетов. возможно, объединить с текущим классом.
|
||||
SapforTestingSet_json testingSet = new SapforTestingSet_json(testsByDescriptions, configurations);
|
||||
testingSet.id = getMaxSetId();
|
||||
testingSets.add(testingSet);
|
||||
//формирование задач
|
||||
LinkedHashMap<String, SapforTask> sortedTasks = new LinkedHashMap<>();
|
||||
for (SapforConfiguration_json sapforConfiguration_json : testingSet.configurations) {
|
||||
for (SapforTest_json test : testingSet.tests) {
|
||||
SapforTask task = new SapforTask(testingSet, test, sapforConfiguration_json);
|
||||
if (!sortedTasks.containsKey(task.getUniqueKey())) {
|
||||
task.id = getMaxTaskId();
|
||||
sortedTasks.put(task.getUniqueKey(), task);
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.addAll(sortedTasks.values());
|
||||
}
|
||||
public int getMaxSetId() {
|
||||
return max_set_id++;
|
||||
}
|
||||
public int getMaxTaskId() {
|
||||
return max_task_id++;
|
||||
}
|
||||
//--
|
||||
public Vector<String> getTasksKeys() {
|
||||
Vector<String> keys = new Vector<>();
|
||||
@@ -94,9 +120,6 @@ public class SapforPackage_json implements Serializable {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//-
|
||||
public PackageSummary root = null;
|
||||
public PackageComparisonSummary comparison_root = null;
|
||||
//---------
|
||||
public void DropComparison() {
|
||||
comparison_root = null;
|
||||
@@ -178,27 +201,4 @@ public class SapforPackage_json implements Serializable {
|
||||
});
|
||||
return names;
|
||||
}
|
||||
//---
|
||||
public SapforPackage_json() {
|
||||
}
|
||||
public SapforPackage_json(ServerSapfor serverSapfor, LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> configurations, int kernels_in) {
|
||||
sapfor_drv=serverSapfor.call_command;
|
||||
kernels = kernels_in;
|
||||
//рудимент от формирования пакетов. возможно, объединить с текущим классом.
|
||||
SapforTestingSet_json testingSet = new SapforTestingSet_json(testsByDescriptions, configurations);
|
||||
testingSet.id = getMaxSetId();
|
||||
testingSets.add(testingSet);
|
||||
//формирование задач
|
||||
LinkedHashMap<String, SapforTask> sortedTasks = new LinkedHashMap<>();
|
||||
for (SapforConfiguration_json sapforConfiguration_json : testingSet.configurations) {
|
||||
for (SapforTest_json test : testingSet.tests) {
|
||||
SapforTask task = new SapforTask(testingSet, test, sapforConfiguration_json);
|
||||
if (!sortedTasks.containsKey(task.getUniqueKey())) {
|
||||
task.id = getMaxTaskId();
|
||||
sortedTasks.put(task.getUniqueKey(), task);
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.addAll(sortedTasks.values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,9 @@ public class SapforTest_json implements Serializable {
|
||||
public String description = "";
|
||||
@Expose
|
||||
public String group_description = "";
|
||||
public SapforTest_json(){}
|
||||
public SapforTest_json(Test test){
|
||||
public SapforTest_json() {
|
||||
}
|
||||
public SapforTest_json(Test test) {
|
||||
id = test.id;
|
||||
description = test.description;
|
||||
group_description = Global.testingServer.db.groups.get(test.group_id).description;
|
||||
|
||||
@@ -18,7 +18,8 @@ public class SapforTestingSet_json implements Serializable {
|
||||
public List<SapforTest_json> tests = new Vector<>();
|
||||
@Expose
|
||||
public List<SapforConfiguration_json> configurations = new Vector<>();
|
||||
public SapforTestingSet_json(){}
|
||||
public SapforTestingSet_json() {
|
||||
}
|
||||
public SapforTestingSet_json(LinkedHashMap<String, Test> testsByDescriptions, Vector<SapforConfiguration> sapforConfigurations) {
|
||||
for (Test test : testsByDescriptions.values())
|
||||
tests.add(new SapforTest_json(test));
|
||||
|
||||
@@ -2,7 +2,6 @@ package _VisualDVM.TestingSystem.SAPFOR.Json;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||
import _VisualDVM.ProjectData.Files.FileType;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
@@ -11,6 +10,7 @@ import _VisualDVM.ProjectData.Messages.Errors.MessageError;
|
||||
import _VisualDVM.ProjectData.Project.db_project_info;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.Utils;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.TestingSystem.Common.TaskThread;
|
||||
import _VisualDVM.TestingSystem.Common.ThreadsPlanner.ThreadsPlanner;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforPackage_json;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -31,8 +31,8 @@ public class PackageModeSupervisor extends ThreadsPlanner {
|
||||
FileUtils.writeStringToFile(started, String.valueOf(startDate));
|
||||
//формирование списка задач.
|
||||
setMaxKernels(package_json.kernels);
|
||||
for (SapforTask task: package_json.tasks)
|
||||
addThread(new TaskThread(task,sapfor_drv));
|
||||
for (SapforTask task : package_json.tasks)
|
||||
addThread(new TaskThread(task, sapfor_drv));
|
||||
interruptThread.start();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTask.SapforTask;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.Pass;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
@@ -16,6 +16,13 @@ import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.Vector;
|
||||
public class PerformSapforTask extends Pass<SapforTask> {
|
||||
//--
|
||||
File sapfor_drv;
|
||||
SapforVersion_json version_json;
|
||||
//-----
|
||||
File root;
|
||||
File parentTask;
|
||||
File task;
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "";
|
||||
@@ -25,13 +32,6 @@ public class PerformSapforTask extends Pass<SapforTask> {
|
||||
protected boolean needsAnimation() {
|
||||
return false;
|
||||
}
|
||||
//--
|
||||
File sapfor_drv;
|
||||
SapforVersion_json version_json;
|
||||
//-----
|
||||
File root;
|
||||
File parentTask;
|
||||
File task;
|
||||
//-----
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
@@ -111,8 +111,8 @@ public class PerformSapforTask extends Pass<SapforTask> {
|
||||
protected void body() throws Exception {
|
||||
target.StartDate = new Date().getTime();
|
||||
target.versions.add(version_json = new SapforVersion_json(target.test_description, "исходная"));
|
||||
String [] data = target.codes.split(" ");
|
||||
for (String code_s: data){
|
||||
String[] data = target.codes.split(" ");
|
||||
for (String code_s : data) {
|
||||
PassCode code = PassCode.valueOf(code_s);
|
||||
//--
|
||||
if (parse()) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.ServerObjectsCache.SapforConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
|
||||
import _VisualDVM.TestingSystem.Common.Group.Group;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
@@ -19,7 +19,7 @@ public class SapforConfiguration extends Configuration {
|
||||
SapforConfigurationCache cache = (SapforConfigurationCache) VisualCaches.GetCache(this);
|
||||
//--
|
||||
Vector<Group> groups = cache.getGroups();
|
||||
Vector<SapforSettings> settingsArray= cache.getSettings();
|
||||
Vector<SapforSettings> settingsArray = cache.getSettings();
|
||||
//--
|
||||
Vector<LanguageName> groupsLanguages = new Vector<>();
|
||||
for (Group group : groups) {
|
||||
@@ -28,11 +28,11 @@ public class SapforConfiguration extends Configuration {
|
||||
}
|
||||
//---
|
||||
//1. проверка цепочек команд на корректность
|
||||
for (SapforSettings sapforSettings: settingsArray){
|
||||
for (SapforSettings sapforSettings : settingsArray) {
|
||||
sapforSettings.validate(Log);
|
||||
}
|
||||
//2. Проверка входящих групп на единственный язык фортран
|
||||
if (groupsLanguages.size()>1){
|
||||
if (groupsLanguages.size() > 1) {
|
||||
Log.Writeln_("Запуск тестов на разных языках в рамках одного пакета запрещен!\n");
|
||||
}
|
||||
if ((!groupsLanguages.contains(LanguageName.fortran))) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.TableEditors;
|
||||
import Common.Visual.Tables.TableRenderers;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Utils.Vector_;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.UI.SapforConfigurationFields;
|
||||
|
||||
import java.util.Vector;
|
||||
@@ -121,8 +121,8 @@ public class SapforConfigurationDBTable extends iDBTable<SapforConfiguration> {
|
||||
return res;
|
||||
}
|
||||
//патч.потом удалить.
|
||||
public SapforConfiguration getConfigurationByDescription(String description){
|
||||
for (SapforConfiguration sapforConfiguration: Data.values())
|
||||
public SapforConfiguration getConfigurationByDescription(String description) {
|
||||
for (SapforConfiguration sapforConfiguration : Data.values())
|
||||
if (sapforConfiguration.description.equals(description))
|
||||
return sapforConfiguration;
|
||||
return null;
|
||||
|
||||
@@ -5,12 +5,10 @@ public class SapforConfigurationsMenuBar extends DataMenuBar {
|
||||
public SapforConfigurationsMenuBar() {
|
||||
super("конфигурации",
|
||||
PassCode.PublishSapforConfiguration,
|
||||
|
||||
PassCode.EditSapforConfiguration,
|
||||
PassCode.ShowCurrentSAPFORConfigurationTests,
|
||||
PassCode.SaveCurrentSAPFORConfiguration,
|
||||
PassCode.DeleteSapforConfiguration,
|
||||
|
||||
PassCode.StartSelectedSAPFORConfigurations
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.UI;
|
||||
import _VisualDVM.Constants;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Constants;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class SapforConfigurationFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JSpinner sTransformationMaxtime;
|
||||
public JSpinner sKernels;
|
||||
private JPanel content;
|
||||
public SapforConfigurationFields() {
|
||||
sKernels.setModel(new SpinnerNumberModel(1, 1,
|
||||
Constants.testingMaxKernels,
|
||||
1));
|
||||
}
|
||||
//--
|
||||
@Override
|
||||
public Component getContent() {
|
||||
@@ -19,9 +24,4 @@ public class SapforConfigurationFields implements DialogFields {
|
||||
// TODO: place custom component creation code here
|
||||
tfName = new StyledTextField();
|
||||
}
|
||||
public SapforConfigurationFields(){
|
||||
sKernels.setModel(new SpinnerNumberModel(1, 1,
|
||||
Constants.testingMaxKernels,
|
||||
1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforPackage;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Account.Account;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.TestingSystem.Common.TasksPackageState;
|
||||
import _VisualDVM.TestingSystem.Common.Test.Test;
|
||||
import _VisualDVM.TestingSystem.Common.TestingPackage.TestingPackage;
|
||||
@@ -27,34 +27,6 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
||||
public SapforPackage(SapforPackage sapforPackage) {
|
||||
SynchronizeFields(sapforPackage);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
SapforPackage p = (SapforPackage) src;
|
||||
sapforId = p.sapforId;
|
||||
}
|
||||
@Override
|
||||
public Class getJsonClass() {
|
||||
return SapforPackage_json.class;
|
||||
}
|
||||
@Override
|
||||
public File getHomeDirectory() {
|
||||
return Global.SapforPackagesDirectory;
|
||||
}
|
||||
//--
|
||||
public void init() throws Exception {
|
||||
for (SapforTask task : package_json.tasks)
|
||||
task.sapfortaskspackage_id = id;
|
||||
Utils_.CheckAndCleanDirectory(getLocalWorkspace());
|
||||
saveJson();
|
||||
package_json = null; // объект больше не нужен.
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!SapforPackageDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
(!SapforPackageDBTable.filterActive || state.isActive())
|
||||
;
|
||||
}
|
||||
//---------
|
||||
//конструктор. если 0 задач по итогу,значит пакет не запускаем вообще, и смотрим журнал.
|
||||
//Запрещено выполнять на нитях, так как прямой доступ к бд.
|
||||
@@ -104,9 +76,37 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
SapforPackage p = (SapforPackage) src;
|
||||
sapforId = p.sapforId;
|
||||
}
|
||||
@Override
|
||||
public Class getJsonClass() {
|
||||
return SapforPackage_json.class;
|
||||
}
|
||||
@Override
|
||||
public File getHomeDirectory() {
|
||||
return Global.SapforPackagesDirectory;
|
||||
}
|
||||
//--
|
||||
public void init() throws Exception {
|
||||
for (SapforTask task : package_json.tasks)
|
||||
task.sapfortaskspackage_id = id;
|
||||
Utils_.CheckAndCleanDirectory(getLocalWorkspace());
|
||||
saveJson();
|
||||
package_json = null; // объект больше не нужен.
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return (!SapforPackageDBTable.filterMyOnly || Global.mainModule.getAccount().email.equals(sender_address)) &&
|
||||
(!SapforPackageDBTable.filterActive || state.isActive())
|
||||
;
|
||||
}
|
||||
@Override
|
||||
public void checkFinishState() throws Exception {
|
||||
readJson();
|
||||
int good=0;
|
||||
int good = 0;
|
||||
int bad = 0;
|
||||
for (SapforTask task : package_json.tasks) {
|
||||
if (!task.state.equals(TaskState.Done))
|
||||
@@ -114,8 +114,8 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
||||
else good++;
|
||||
}
|
||||
state = (bad > 0) ? TasksPackageState.DoneWithErrors : TasksPackageState.Done;
|
||||
double percent = ( ((double)(good))/tasksCount)*100.0;
|
||||
description = "Выполнено на "+((int)percent)+"%\n"+
|
||||
"Всего задач: "+tasksCount+", из них с ошибками "+bad;
|
||||
double percent = (((double) (good)) / tasksCount) * 100.0;
|
||||
description = "Выполнено на " + ((int) percent) + "%\n" +
|
||||
"Всего задач: " + tasksCount + ", из них с ошибками " + bad;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforPackage;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ServerObjectsCache.PackageCache;
|
||||
import _VisualDVM.ServerObjectsCache.VisualCaches;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
@@ -14,6 +14,9 @@ import static Common.Visual.Tables.TableRenderers.*;
|
||||
public class SapforPackageDBTable extends iDBTable<SapforPackage> {
|
||||
public static boolean filterMyOnly = false;
|
||||
public static boolean filterActive = false;
|
||||
public SapforPackageDBTable() {
|
||||
super(SapforPackage.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.SapforPackage;
|
||||
@@ -26,9 +29,6 @@ public class SapforPackageDBTable extends iDBTable<SapforPackage> {
|
||||
public String getPluralDescription() {
|
||||
return "пакеты задач SAPFOR";
|
||||
}
|
||||
public SapforPackageDBTable() {
|
||||
super(SapforPackage.class);
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this) {
|
||||
@@ -95,7 +95,7 @@ public class SapforPackageDBTable extends iDBTable<SapforPackage> {
|
||||
return new Comparator<SapforPackage>() {
|
||||
@Override
|
||||
public int compare(SapforPackage o1, SapforPackage o2) {
|
||||
return o2.id-o1.id;
|
||||
return o2.id - o1.id;
|
||||
}
|
||||
};
|
||||
// return Comparator.comparingInt(o -> o.).reversed();
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.TextLog;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.Common.Settings.Settings;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
@@ -16,6 +16,11 @@ public class SapforSettings extends Settings {
|
||||
public int MAX_SHADOW_WIDTH = 50; // "Максимальный размер теневых граней"; (%) -shwidth значение поля
|
||||
public int KEEP_SPF_DIRECTIVES = 0; //"Сохранять SPF директивы при построении параллельных вариантов"; -keepSPF
|
||||
public int KEEP_DVM_DIRECTIVES = 0;// "Учитывать DVM директивы"; -keepDVM
|
||||
public SapforSettings(SapforSettings sapforSettings) {
|
||||
this.SynchronizeFields(sapforSettings);
|
||||
}
|
||||
public SapforSettings() {
|
||||
}
|
||||
//----
|
||||
//----
|
||||
public void packFlags() {
|
||||
@@ -45,21 +50,16 @@ public class SapforSettings extends Settings {
|
||||
KEEP_SPF_DIRECTIVES = c.KEEP_SPF_DIRECTIVES;
|
||||
KEEP_DVM_DIRECTIVES = c.KEEP_DVM_DIRECTIVES;
|
||||
}
|
||||
public SapforSettings(SapforSettings sapforSettings) {
|
||||
this.SynchronizeFields(sapforSettings);
|
||||
}
|
||||
public SapforSettings() {
|
||||
}
|
||||
public Vector<PassCode> getCodes() {
|
||||
Vector<PassCode> res = new Vector<>();
|
||||
for (SapforSettingsCommand command : Global.testingServer.db.sapforSettingsCommands.Data.values())
|
||||
if (command.sapforsettings_id == id) res.add(command.passCode);
|
||||
return res;
|
||||
}
|
||||
public List<PassCode> getCheckedCodes(){
|
||||
public List<PassCode> getCheckedCodes() {
|
||||
Vector<PassCode> res = getCodes();
|
||||
if (!res.firstElement().equals(PassCode.SPF_InsertIncludesPass))
|
||||
res.insertElementAt(PassCode.SPF_CorrectCodeStylePass,0); //всегда добавляется.
|
||||
res.insertElementAt(PassCode.SPF_CorrectCodeStylePass, 0); //всегда добавляется.
|
||||
return res;
|
||||
}
|
||||
@Override
|
||||
@@ -81,7 +81,7 @@ public class SapforSettings extends Settings {
|
||||
Log.Writeln_("Неверные настройки:" + id + ": проход" +
|
||||
Utils_.Brackets(code.getDescription()) +
|
||||
" может быть только первым!");
|
||||
res=false;
|
||||
res = false;
|
||||
}
|
||||
}
|
||||
if (code.isSapforTerminal()) {
|
||||
@@ -89,14 +89,14 @@ public class SapforSettings extends Settings {
|
||||
Log.Writeln_("Неверные настройки:" + id + ": проход " +
|
||||
Utils_.Brackets(code.getDescription()) +
|
||||
" может быть только последним!");
|
||||
res= false;
|
||||
res = false;
|
||||
}
|
||||
}
|
||||
if (matches.contains(code)) {
|
||||
Log.Writeln_("Неверные настройки:" + id + ": проход " +
|
||||
Utils_.Brackets(code.getDescription()) +
|
||||
" запрещено применять более одного раза!");
|
||||
res=false;
|
||||
res = false;
|
||||
} else matches.add(code);
|
||||
}
|
||||
//-
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.FKBehaviour;
|
||||
import Common.Database.Tables.FKCurrentObjectBehaviuor;
|
||||
import Common.Database.Tables.FKDataBehaviour;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsFields;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand.SapforSettingsCommand;
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettings.UI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Tables.StyledCellLabel;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class SapforSettingsCommandFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JComboBox<PassCode> cbPassCode;
|
||||
private JPanel content;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
|
||||
@@ -5,13 +5,13 @@ import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class SapforSettingsFields implements DialogFields {
|
||||
private JPanel content;
|
||||
public JTextField tfName;
|
||||
public JCheckBox cbFREE_FORM;
|
||||
public JCheckBox cbKEEP_SPF_DIRECTIVES;
|
||||
public JCheckBox cbSTATIC_SHADOW_ANALYSIS;
|
||||
public JCheckBox cbKEEP_DVM_DIRECTIVES;
|
||||
public JSlider sMAX_SHADOW_WIDTH;
|
||||
private JPanel content;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class SapforSettingsCommand extends riDBObject {
|
||||
public class SapforSettingsCommand extends riDBObject {
|
||||
@Description("DEFAULT -1")
|
||||
public int sapforsettings_id = CommonConstants.Nan;
|
||||
public PassCode passCode = PassCode.SPF_RemoveDvmDirectives;
|
||||
public SapforSettingsCommand() {
|
||||
}
|
||||
public SapforSettingsCommand(SapforSettingsCommand sapforSettingsCommand) {
|
||||
this.SynchronizeFields(sapforSettingsCommand);
|
||||
}
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return Global.mainModule.matchCurrentID(Current.SapforSettings,sapforsettings_id);
|
||||
return Global.mainModule.matchCurrentID(Current.SapforSettings, sapforsettings_id);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
@@ -21,9 +26,4 @@ public class SapforSettingsCommand extends riDBObject {
|
||||
sapforsettings_id = c.sapforsettings_id;
|
||||
passCode = c.passCode;
|
||||
}
|
||||
public SapforSettingsCommand() {
|
||||
}
|
||||
public SapforSettingsCommand(SapforSettingsCommand sapforSettingsCommand) {
|
||||
this.SynchronizeFields(sapforSettingsCommand);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforSettingsCommand;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.SapforSettings;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforSettings.UI.SapforSettingsCommandFields;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.util.Vector;
|
||||
public class SapforSettingsCommandsDBTable extends iDBTable<SapforSettingsCommand> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTask;
|
||||
import Common.Visual.StatusEnum;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.StatusEnum;
|
||||
public enum ComparisonState implements StatusEnum {
|
||||
Unknown,
|
||||
NotMatch,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTask;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.*;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforPackageTreeNode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI.SapforTaskNode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI.VersionNode;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
@@ -55,6 +55,28 @@ public class SapforTask extends DBObject {
|
||||
public TaskState state = TaskState.Inactive;
|
||||
@Description("IGNORE")
|
||||
public ComparisonState comparisonState = ComparisonState.Unknown; //для сравнения. в обычном режиме всегда Unknown!
|
||||
//-----------
|
||||
public SapforTask() {
|
||||
}
|
||||
public SapforTask(SapforTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
//-
|
||||
public SapforTask(SapforTestingSet_json testingSet, SapforTest_json test, SapforConfiguration_json sapforConfiguration_json) {
|
||||
id = CommonConstants.Nan;
|
||||
set_id = testingSet.id;
|
||||
sapfortaskspackage_id = CommonConstants.Nan;
|
||||
//-- unique key--
|
||||
group_description = test.group_description;
|
||||
test_description = test.description;
|
||||
sapfor_configuration_id = sapforConfiguration_json.id;
|
||||
//---------------
|
||||
flags = sapforConfiguration_json.flags;
|
||||
Vector<String> codes_s = new Vector<>();
|
||||
for (PassCode code : sapforConfiguration_json.codes)
|
||||
codes_s.add(code.toString());
|
||||
codes = String.join(" ", codes_s);
|
||||
}
|
||||
//--------------------------------------------------
|
||||
public String getUniqueKey() {
|
||||
return group_description + "_" + test_description + "_" + sapfor_configuration_id;
|
||||
@@ -67,17 +89,11 @@ public class SapforTask extends DBObject {
|
||||
lines.add(flags);
|
||||
return String.join(" ", lines);
|
||||
}
|
||||
//-----------
|
||||
public SapforTask() {
|
||||
}
|
||||
public void Reset() {
|
||||
state = TaskState.Inactive;
|
||||
versions.clear();
|
||||
variants.clear();
|
||||
}
|
||||
public SapforTask(SapforTask src) {
|
||||
this.SynchronizeFields(src);
|
||||
}
|
||||
@Override
|
||||
public Object getPK() {
|
||||
return id;
|
||||
@@ -141,7 +157,7 @@ public class SapforTask extends DBObject {
|
||||
version1.comparisonState = VersionComparisonState.NotMatch;
|
||||
version2.comparisonState = VersionComparisonState.NotMatch;
|
||||
//-
|
||||
}else {
|
||||
} else {
|
||||
version1.comparisonState = VersionComparisonState.Match;
|
||||
version2.comparisonState = VersionComparisonState.Match;
|
||||
//-
|
||||
@@ -222,20 +238,4 @@ public class SapforTask extends DBObject {
|
||||
res.add(versions_info);
|
||||
return res;
|
||||
}
|
||||
//-
|
||||
public SapforTask(SapforTestingSet_json testingSet, SapforTest_json test, SapforConfiguration_json sapforConfiguration_json) {
|
||||
id = CommonConstants.Nan;
|
||||
set_id = testingSet.id;
|
||||
sapfortaskspackage_id = CommonConstants.Nan;
|
||||
//-- unique key--
|
||||
group_description = test.group_description;
|
||||
test_description = test.description;
|
||||
sapfor_configuration_id = sapforConfiguration_json.id;
|
||||
//---------------
|
||||
flags = sapforConfiguration_json.flags;
|
||||
Vector<String> codes_s = new Vector<>();
|
||||
for (PassCode code : sapforConfiguration_json.codes)
|
||||
codes_s.add(code.toString());
|
||||
codes = String.join(" ", codes_s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ import _VisualDVM.Visual.Menus.VisualiserMenu;
|
||||
public class AddSapforPackageMenu extends VisualiserMenu {
|
||||
public AddSapforPackageMenu() {
|
||||
super("", "/icons/RedAdd.png");
|
||||
// addPasses(PassCode_2021.AddSapforPackage,PassCode_2021.CloneSapforPackage);
|
||||
// addPasses(PassCode_2021.AddSapforPackage,PassCode_2021.CloneSapforPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class PackageComparisonSummary extends SapforPackageTreeNode {
|
||||
public class PackageComparisonSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
public int mismatches_count = 0;
|
||||
public PackageComparisonSummary() {
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Package";
|
||||
}
|
||||
public PackageComparisonSummary() {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "всего задач : " + count + ", различий : " + mismatches_count;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
public class PackageSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
public int errors_count=0;
|
||||
public int errors_count = 0;
|
||||
public PackageSummary() {
|
||||
}
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return "Package";
|
||||
}
|
||||
public PackageSummary() {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "всего задач : " + count+", с ошибками : "+errors_count;
|
||||
return "всего задач : " + count + ", с ошибками : " + errors_count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||
public ImageIcon getIcon() {
|
||||
ImageIcon res = new ImageIcon((getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
if (res==null) {
|
||||
ImageIcon res = new ImageIcon((getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
if (res == null) {
|
||||
Utils_.MainLog.Print("/icons/versions/" + getImageKey() + ".png=NULL");
|
||||
// res= new ImageIcon((getClass().getResource("/icons/versions/Version.png")));
|
||||
// res= new ImageIcon((getClass().getResource("/icons/versions/Version.png")));
|
||||
}
|
||||
return (getImageKey() != null) ? res : null;
|
||||
return (getImageKey() != null) ? res : null;
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Controls.MenuBarButton;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackageDBTable;
|
||||
|
||||
import javax.swing.*;
|
||||
public class SapforPackagesBar extends DataMenuBar {
|
||||
|
||||
@@ -10,11 +10,11 @@ public class SapforTaskNode extends SapforPackageTreeNode {
|
||||
SapforTask task = (SapforTask) getUserObject();
|
||||
//обычный режим
|
||||
if (task.comparisonState == ComparisonState.Unknown) {
|
||||
return task.state.toString();
|
||||
return task.state.toString();
|
||||
}
|
||||
//режим сравнения.
|
||||
else {
|
||||
return task.comparisonState.toString()+task.state.toString();
|
||||
return task.comparisonState.toString() + task.state.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.Current_;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Visual.Trees.DataTree;
|
||||
import Common.Visual.Trees.TreeRenderers;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Visual.UI;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.Json.SapforVersion_json;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
@@ -13,13 +12,13 @@ import java.util.Vector;
|
||||
public class SapforTasksPackageTree extends DataTree {
|
||||
Current current;
|
||||
SapforTasksPackageTree slave_tree = null;
|
||||
public void setSlaveTree(SapforTasksPackageTree slave_tree_in) {
|
||||
slave_tree = slave_tree_in;
|
||||
}
|
||||
public SapforTasksPackageTree(DefaultMutableTreeNode root_in, Current current_in) {
|
||||
super(root_in);
|
||||
current = current_in;
|
||||
}
|
||||
public void setSlaveTree(SapforTasksPackageTree slave_tree_in) {
|
||||
slave_tree = slave_tree_in;
|
||||
}
|
||||
@Override
|
||||
protected int getStartLine() {
|
||||
return 1;
|
||||
|
||||
@@ -10,10 +10,10 @@ public class VersionNode extends SapforPackageTreeNode {
|
||||
public String getImageKey() {
|
||||
SapforVersion_json version = (SapforVersion_json) getUserObject();
|
||||
String res = "";
|
||||
if (version.comparisonState.equals(VersionComparisonState.Unknown)||version.state.equals(SapforVersionState.Empty)){
|
||||
if (version.comparisonState.equals(VersionComparisonState.Unknown) || version.state.equals(SapforVersionState.Empty)) {
|
||||
res = version.state.toString();
|
||||
}else {
|
||||
res = version.comparisonState.toString()+version.state.toString();
|
||||
} else {
|
||||
res = version.comparisonState.toString() + version.state.toString();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import Common.CommonConstants;
|
||||
import Common.Mode;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
@@ -17,7 +17,7 @@ import _VisualDVM.TestingSystem.SAPFOR.Json.SapforTestingSet_json;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapfor;
|
||||
import _VisualDVM.TestingSystem.SAPFOR.ServerSapfor.ServerSapforState;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -232,8 +232,8 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
SyncronizeRepository();
|
||||
max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion);
|
||||
current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(), "/sapfor/experts/Sapfor_2017/_src/Utils/version.h").toFile());
|
||||
if (current_version==max_version){
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class,sapfor.id));
|
||||
if (current_version == max_version) {
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class, sapfor.id));
|
||||
return;
|
||||
}
|
||||
//-
|
||||
@@ -257,7 +257,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
FileUtils.copyFile(repo_bin, sapforBin);
|
||||
sapforBin.setExecutable(true, false);
|
||||
//--
|
||||
sapfor.version= String.valueOf(current_version);
|
||||
sapfor.version = String.valueOf(current_version);
|
||||
sapfor.call_command = sapforBin.getAbsolutePath();
|
||||
sapfor.buildDate = new Date().getTime();
|
||||
//--
|
||||
|
||||
@@ -20,15 +20,15 @@ public class ServerSapfor extends riDBObject {
|
||||
public long buildDate = 0;
|
||||
@Description("DEFAULT 'Done'")
|
||||
public ServerSapforState state = ServerSapforState.Done;
|
||||
public Date getBuildDate() {
|
||||
return new Date(buildDate);
|
||||
}
|
||||
//--
|
||||
public ServerSapfor() {
|
||||
}
|
||||
public ServerSapfor(ServerSapfor s) {
|
||||
SynchronizeFields(s);
|
||||
}
|
||||
public Date getBuildDate() {
|
||||
return new Date(buildDate);
|
||||
}
|
||||
@Override
|
||||
public void SynchronizeFields(DBObject src) {
|
||||
super.SynchronizeFields(src);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.ServerSapfor;
|
||||
import Common.Visual.StatusEnum;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.StatusEnum;
|
||||
public enum ServerSapforState implements StatusEnum {
|
||||
Queued,
|
||||
DVMRepositorySynchronization,
|
||||
@@ -10,7 +10,7 @@ public enum ServerSapforState implements StatusEnum {
|
||||
DoneWithErrors;
|
||||
@Override
|
||||
public VisualiserFonts getFont() {
|
||||
switch (this){
|
||||
switch (this) {
|
||||
case Queued:
|
||||
return VisualiserFonts.UnknownState;
|
||||
case Done:
|
||||
@@ -44,8 +44,8 @@ public enum ServerSapforState implements StatusEnum {
|
||||
return StatusEnum.super.getDescription();
|
||||
}
|
||||
}
|
||||
public boolean isActive(){
|
||||
switch (this){
|
||||
public boolean isActive() {
|
||||
switch (this) {
|
||||
case Done:
|
||||
case DoneWithErrors:
|
||||
return false;
|
||||
@@ -53,5 +53,4 @@ public enum ServerSapforState implements StatusEnum {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,10 +4,10 @@ import _VisualDVM.Passes.PassCode;
|
||||
public class ServerSapforsBar extends DataMenuBar {
|
||||
public ServerSapforsBar() {
|
||||
super("версии SAPFOR",
|
||||
PassCode.CompileServerSapfor,
|
||||
PassCode.ShowSapforCompilationOut,
|
||||
PassCode.ShowSapforCompilationErr,
|
||||
PassCode.DeleteServerSapfor
|
||||
PassCode.CompileServerSapfor,
|
||||
PassCode.ShowSapforCompilationOut,
|
||||
PassCode.ShowSapforCompilationErr,
|
||||
PassCode.DeleteServerSapfor
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package _VisualDVM.TestingSystem.SAPFOR.ServerSapfor;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.TableRenderers;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Visual.UI;
|
||||
|
||||
import java.util.Comparator;
|
||||
@@ -24,7 +24,7 @@ public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{"версия","автор", "дата сборки", "сборка"};
|
||||
return new String[]{"версия", "автор", "дата сборки", "сборка"};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(ServerSapfor object, int columnIndex) {
|
||||
@@ -45,7 +45,7 @@ public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
|
||||
return new DataSetControlForm(this) {
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
// columns.get(0).setVisible(false);
|
||||
// columns.get(0).setVisible(false);
|
||||
columns.get(3).setRenderer(TableRenderers.RendererDate);
|
||||
columns.get(4).setRenderer(TableRenderers.RendererStatusEnum);
|
||||
}
|
||||
@@ -66,9 +66,9 @@ public class ServerSapforsDBTable extends iDBTable<ServerSapfor> {
|
||||
return new Comparator<ServerSapfor>() {
|
||||
@Override
|
||||
public int compare(ServerSapfor o1, ServerSapfor o2) {
|
||||
return o2.id-o1.id;
|
||||
return o2.id - o1.id;
|
||||
}
|
||||
};
|
||||
// return Comparator.comparingInt(o -> o.).reversed();
|
||||
// return Comparator.comparingInt(o -> o.).reversed();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user