включение цепочки преобразований в описание теста при его импорте из пакета сапфор

v++
This commit is contained in:
2025-02-14 00:13:00 +03:00
parent f2b2acb49f
commit 245ed7c5f0
9 changed files with 93 additions and 18 deletions

9
.idea/workspace.xml generated
View File

@@ -7,10 +7,15 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/Common/Visual/Tables/RendererLongCell.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadDVMPackages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadDVMPackages.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadSapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerRequestUnit.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerRequestUnit.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestDialog.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.form" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestFields.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Test/UI/TestsForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -1,6 +1,6 @@
{
"Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1739383720\\1835",
"ProjectsSearchDirectory": "E:\\BUG",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
"Visualizer_2Path": "C:\\Users\\misha\\Documents",

View File

@@ -0,0 +1,16 @@
package Common.Visual.Tables;
import Common.MainModule_;
import Common.Visual.Fonts.VisualiserFonts;
import javax.swing.*;
public class RendererLongCell extends RendererCell {
@Override
public Object Init(JTable table, Object value, int row, int column) {
return value;
}
@Override
public void Display() {
setText(value.toString());
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
}
}

View File

@@ -1,7 +1,7 @@
package _VisualDVM.Repository.Server;
import java.io.Serializable;
public class ServerRequestUnit {
public static final int version = 1164;
public static final int version = 1165;
//--------------------------------------------
public String codeName;
public String arg;

View File

@@ -11,7 +11,7 @@ public class TestDialog extends DBObjectDialog<Test, TestFields> {
}
@Override
public int getDefaultHeight() {
return 200;
return 400;
}
@Override
public int getDefaultWidth() {
@@ -31,10 +31,12 @@ public class TestDialog extends DBObjectDialog<Test, TestFields> {
fields.tfName.setText(Result.description);
fields.sMinDim.setValue(Result.min_dim);
fields.sMaxDim.setValue(Result.max_dim);
fields.taExtendedDescription.setText(Result.extended_description);
}
@Override
public void ProcessResult() {
Result.description = fields.tfName.getText();
Result.extended_description=fields.taExtendedDescription.getText();
Result.min_dim = (int) fields.sMinDim.getValue();
Result.max_dim = (int) fields.sMaxDim.getValue();
if (!edit) {
@@ -47,5 +49,6 @@ public class TestDialog extends DBObjectDialog<Test, TestFields> {
fields.tfName.setEnabled(false);
fields.sMinDim.setEnabled(false);
fields.sMaxDim.setEnabled(false);
fields.taExtendedDescription.setEnabled(false);
}
}

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.TestingSystem.Common.Test.UI.TestFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
<xy x="20" y="20" width="718" height="400"/>
</constraints>
<properties/>
<border type="none"/>
@@ -19,7 +19,7 @@
</component>
<vspacer id="9a439">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="ddf02" class="javax.swing.JTextField" binding="tfName" custom-create="true">
@@ -34,7 +34,7 @@
</component>
<component id="fbef6" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -43,7 +43,7 @@
</component>
<component id="2b54" class="javax.swing.JSpinner" binding="sMaxDim">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="50" height="-1"/>
<maximum-size width="50" height="-1"/>
</grid>
@@ -52,7 +52,7 @@
</component>
<component id="82807" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
@@ -61,13 +61,34 @@
</component>
<component id="c59e6" class="javax.swing.JSpinner" binding="sMinDim">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="50" height="-1"/>
<maximum-size width="50" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="6397b" class="javax.swing.JTextArea" binding="taExtendedDescription">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="150" height="50"/>
</grid>
</constraints>
<properties>
<lineWrap value="true"/>
</properties>
</component>
<component id="c5c14" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="описание"/>
<verticalAlignment value="0"/>
<verticalTextPosition value="0"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -8,6 +8,7 @@ public class TestFields implements DialogFields {
public JTextField tfName;
public JSpinner sMinDim;
public JSpinner sMaxDim;
public JTextArea taExtendedDescription;
private JPanel content;
public TestFields() {
sMinDim.setModel(new SpinnerNumberModel(1, 0, 16, 1));

View File

@@ -1,16 +1,21 @@
package _VisualDVM.TestingSystem.Common.Test.UI;
import Common.CommonConstants;
import Common.Database.Tables.DataSet;
import Common.Passes.PassCode_;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Tables.HeaderTextFilter;
import Common.Visual.Tables.RendererHiddenList;
import Common.Visual.Tables.RendererLongCell;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Test.Test;
import _VisualDVM.TestingSystem.SAPFOR.SapforConfiguration.SapforConfiguration;
import _VisualDVM.Visual.Tables.RendererHyperlinks;
import javax.swing.*;
public class TestsForm extends DataSetControlForm<Test> {
@@ -26,6 +31,20 @@ public class TestsForm extends DataSetControlForm<Test> {
return object.description;
}
},
new ColumnInfo<Test>("описание") {
@Override
public Object getFieldAt(Test object) {
return object.extended_description.replace("\n","");
}
@Override
public Class getRendererClass() {
return RendererLongCell.class;
}
@Override
public int getMaxWidth() {
return 600;
}
},
new ColumnInfo<Test>("min_dim") {
@Override
public Object getFieldAt(Test object) {

View File

@@ -632,7 +632,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//--
SapforPackage_json json = Utils_.jsonFromFile(sapforPackage.getJsonFile(), SapforPackage_json.class);
LinkedHashMap<String, File> versions = new LinkedHashMap<>();
Vector<String> paths = new Vector<>();
LinkedHashMap<String, String> descriptions = new LinkedHashMap<>();
for (SapforTask task : json.tasks) {
if (task.state.equals(TaskState.Done)) {
File task_root = Paths.get(
@@ -647,16 +647,25 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
task.test_description,
versionProject.getName()
);
versions.put(String.join("_", name_parts), versionProject);
paths.add(versionProject.getAbsolutePath());
String name = String.join("_", name_parts);
versions.put(name, versionProject);
//--
String[] data = task.codes.split(" ");
Vector<String> codes_ = new Vector<>();
for (String datum : data) {
PassCode code = PassCode.valueOf(datum);
codes_.add(code.getDescription());
//--
descriptions.put(name, String.join("\n", codes_));
}
}
}
}
ZipFolderPass zip = new ZipFolderPass();
//создание тестов.
Vector<Test> tests = new Vector<>();
for (String description : versions.keySet()) {
File src = versions.get(description);
for (String name : versions.keySet()) {
File src = versions.get(name);
File[] files = src.listFiles(pathname -> !pathname.isDirectory());
if (files != null && files.length > 0) {
//--
@@ -666,10 +675,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//--
Test test = new Test();
test.group_id = group.id;
test.description = description;
test.description = name;
test.files = String.join("\n", filesNames);
test.sender_address = group.sender_address;
test.sender_name = group.sender_name;
test.extended_description = descriptions.get(name);
db.Insert(test);
//---
File testProject = new File(Global.TestsDirectory, String.valueOf(test.id));