no message
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
package TestingSystem.Common.Test;
|
||||
import Common.Current;
|
||||
import Common.Database.iDBTable;
|
||||
import Common.Global;
|
||||
import Common.UI.DataSetControlForm;
|
||||
import Common.UI.Windows.Dialog.DBObjectDialog;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.UI.TestFields;
|
||||
|
||||
import java.util.Vector;
|
||||
public class TestDBTable extends iDBTable<Test> {
|
||||
public TestDBTable() {
|
||||
super(Test.class);
|
||||
@@ -108,4 +112,16 @@ public class TestDBTable extends iDBTable<Test> {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public Vector<Test> getSelectedGroupTests(Group group) {
|
||||
Vector<Test> allTests = new Vector<>();
|
||||
Vector<Test> selectedTests = new Vector<>();
|
||||
//--
|
||||
for (Test test : Data.values()) {
|
||||
if (test.group_id == group.id) {
|
||||
allTests.add(test);
|
||||
if (test.isSelected()) selectedTests.add(test);
|
||||
}
|
||||
}
|
||||
return selectedTests.isEmpty()?allTests:selectedTests;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,18 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
public String packedGroups = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedTests = "";
|
||||
//----
|
||||
@Description("DEFAULT ''")
|
||||
public String configurationsNames = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String groupsNames = "";
|
||||
//----
|
||||
@Description("DEFAULT 0")
|
||||
public int configurationsCount = 0;
|
||||
@Description("DEFAULT 0")
|
||||
public int groupsCount = 0;
|
||||
@Description("DEFAULT 0")
|
||||
public int testsCount = 0;
|
||||
//--
|
||||
public TasksPackageState state = TasksPackageState.Draft;
|
||||
//--
|
||||
@@ -54,10 +66,16 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
connectionErrosCount = tp.connectionErrosCount;
|
||||
state = tp.state;
|
||||
//--
|
||||
packedConfigurations=tp.packedConfigurations;
|
||||
packedGroups=tp.packedGroups;
|
||||
packedTests=tp.packedTests;
|
||||
packedConfigurations = tp.packedConfigurations;
|
||||
packedGroups = tp.packedGroups;
|
||||
packedTests = tp.packedTests;
|
||||
//--
|
||||
configurationsCount = tp.configurationsCount;
|
||||
groupsCount = tp.groupsCount;
|
||||
testsCount = tp.testsCount;
|
||||
//--
|
||||
groupsNames = tp.groupsNames;
|
||||
configurationsNames = tp.configurationsNames;
|
||||
}
|
||||
public TestingPackage(TestingPackage p) {
|
||||
SynchronizeFields(p);
|
||||
@@ -142,44 +160,44 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
}
|
||||
}
|
||||
*/
|
||||
public void addConfigurations(Vector<Configuration> new_configurations){
|
||||
Vector<String> res= Utils.unpack_s(packedConfigurations);
|
||||
public void addConfigurations(Vector<Configuration> new_configurations) {
|
||||
Vector<String> res = Utils.unpack_s(packedConfigurations);
|
||||
//---
|
||||
System.out.println("old_configs "+res.size());
|
||||
for(String id_: res){
|
||||
System.out.println("old_configs " + res.size());
|
||||
for (String id_ : res) {
|
||||
System.out.println(Utils.Brackets(id_));
|
||||
}
|
||||
//---
|
||||
for (Configuration configuration: new_configurations){
|
||||
for (Configuration configuration : new_configurations) {
|
||||
String id_ = String.valueOf(configuration.id);
|
||||
if (!res.contains(id_))
|
||||
res.add(id_);
|
||||
}
|
||||
packedConfigurations= String.join("\n", res );
|
||||
System.out.println("new_configs="+res.size());
|
||||
for(String id_: res){
|
||||
packedConfigurations = String.join("\n", res);
|
||||
System.out.println("new_configs=" + res.size());
|
||||
for (String id_ : res) {
|
||||
System.out.println(Utils.Brackets(id_));
|
||||
}
|
||||
}
|
||||
public void addGroups(Vector<Group> new_groups){
|
||||
Vector<String> res= Utils.unpack_s(packedGroups);
|
||||
public void addGroups(Vector<Group> new_groups) {
|
||||
Vector<String> res = Utils.unpack_s(packedGroups);
|
||||
//---
|
||||
for (Group group: new_groups){
|
||||
for (Group group : new_groups) {
|
||||
String id_ = String.valueOf(group.id);
|
||||
if (!res.contains(id_))
|
||||
res.add(id_);
|
||||
}
|
||||
packedGroups= String.join("\n", res );
|
||||
packedGroups = String.join("\n", res);
|
||||
}
|
||||
public void addTests(Vector<Test> new_tests){
|
||||
Vector<String> res= Utils.unpack_s(packedTests);
|
||||
public void addTests(Vector<Test> new_tests) {
|
||||
Vector<String> res = Utils.unpack_s(packedTests);
|
||||
//---
|
||||
for (Test test: new_tests){
|
||||
for (Test test : new_tests) {
|
||||
String id_ = String.valueOf(test.id);
|
||||
if (!res.contains(id_))
|
||||
res.add(id_);
|
||||
}
|
||||
packedTests= String.join("\n", res );
|
||||
packedTests = String.join("\n", res);
|
||||
}
|
||||
//------------------------------------------------------->>>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user