no message
This commit is contained in:
@@ -5,10 +5,8 @@ import Common.Database.riDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import TestingSystem.Common.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.DVMConfiguration;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfiguration;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.io.File;
|
||||
@@ -30,25 +28,12 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
public int connectionErrosCount = 0;
|
||||
//--
|
||||
@Description("DEFAULT ''")
|
||||
public String packedConfigurations = "";
|
||||
public String packedConfigurationsIds = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedGroups = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String packedTests = "";
|
||||
//----
|
||||
@Description("DEFAULT ''")
|
||||
public String configurationsNames = "";
|
||||
@Description("DEFAULT ''")
|
||||
public String groupsNames = "";
|
||||
//----
|
||||
public String packedConfigurationsNames = "";
|
||||
@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;
|
||||
//--
|
||||
@Override
|
||||
@@ -68,16 +53,9 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
connectionErrosCount = tp.connectionErrosCount;
|
||||
state = tp.state;
|
||||
//--
|
||||
packedConfigurations = tp.packedConfigurations;
|
||||
packedGroups = tp.packedGroups;
|
||||
packedTests = tp.packedTests;
|
||||
//--
|
||||
packedConfigurationsIds = tp.packedConfigurationsIds;
|
||||
packedConfigurationsNames = tp.packedConfigurationsNames;
|
||||
configurationsCount = tp.configurationsCount;
|
||||
groupsCount = tp.groupsCount;
|
||||
testsCount = tp.testsCount;
|
||||
//--
|
||||
groupsNames = tp.groupsNames;
|
||||
configurationsNames = tp.configurationsNames;
|
||||
}
|
||||
public TestingPackage(TestingPackage p) {
|
||||
SynchronizeFields(p);
|
||||
@@ -112,72 +90,11 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
}
|
||||
public Vector<DVMConfiguration> getConfigurations() {
|
||||
Vector<DVMConfiguration> res = new Vector<>();
|
||||
for (int o_id : Utils.unpackIntegers(packedConfigurations, "\n"))
|
||||
for (int o_id : Utils.unpackIntegers(packedConfigurationsIds, "\n"))
|
||||
if (Global.testingServer.db.dvm_configurations.containsKey(o_id))
|
||||
res.add(Global.testingServer.db.dvm_configurations.get(o_id));
|
||||
return res;
|
||||
}
|
||||
public Vector<Group> getGroups() {
|
||||
Vector<Group> res = new Vector<>();
|
||||
for (int o_id : Utils.unpackIntegers(packedGroups, "\n"))
|
||||
if (Global.testingServer.db.groups.containsKey(o_id))
|
||||
res.add(Global.testingServer.db.groups.get(o_id));
|
||||
return res;
|
||||
}
|
||||
public Vector<Test> getTests() {
|
||||
Vector<Test> res = new Vector<>();
|
||||
for (int o_id : Utils.unpackIntegers(packedTests, "\n"))
|
||||
if (Global.testingServer.db.tests.containsKey(o_id))
|
||||
res.add(Global.testingServer.db.tests.get(o_id));
|
||||
return res;
|
||||
}
|
||||
public void Reset() {
|
||||
StartDate = 0;
|
||||
ChangeDate = 0;
|
||||
progress = 0;
|
||||
state = TasksPackageState.Inactive;
|
||||
//--
|
||||
File loaded = new File(getLocalWorkspace(), Constants.LOADED);
|
||||
if (loaded.exists()) {
|
||||
try {
|
||||
Utils.forceDeleteWithCheck(loaded);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
public void printCGT() {
|
||||
try {
|
||||
System.out.println("package="+id);
|
||||
Vector<Configuration> configurations = getConfigurations();
|
||||
System.out.println("+");
|
||||
|
||||
Vector<Group> groups = getGroups();
|
||||
Vector<Test> tests = getTests();
|
||||
Vector<String> res = new Vector<>();
|
||||
res.add("конфигурации: " + configurations.size());
|
||||
for (Configuration configuration : configurations)
|
||||
res.add(configuration.description);
|
||||
|
||||
res.add("группы: " + groups.size());
|
||||
for (Group group : groups)
|
||||
res.add(group.description);
|
||||
//--
|
||||
res.add("тесты: " + tests.size());
|
||||
for (Test test : tests)
|
||||
res.add(test.description);
|
||||
//--
|
||||
res.add("-------");
|
||||
System.out.println(String.join("\n", res));
|
||||
}
|
||||
catch (Exception ex){
|
||||
System.out.println("```");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
*/
|
||||
//------------------------------------------------------->>>
|
||||
public void saveConfigurations(Vector<? extends Configuration> new_configurations) {
|
||||
Vector<String> res = new Vector<>();
|
||||
Vector<String> names = new Vector<>();
|
||||
@@ -185,26 +102,8 @@ public abstract class TestingPackage<J> extends riDBObject {
|
||||
res.add(String.valueOf(configuration.id));
|
||||
names.add(configuration.description);
|
||||
}
|
||||
packedConfigurations = String.join("\n", res);
|
||||
configurationsNames = String.join(";", names);
|
||||
packedConfigurationsIds = String.join("\n", res);
|
||||
packedConfigurationsNames = String.join("\n", names);
|
||||
configurationsCount = new_configurations.size();
|
||||
}
|
||||
public void saveGroups(Vector<Group> new_groups) {
|
||||
Vector<String> res = new Vector<>();
|
||||
Vector<String> names = new Vector<>();
|
||||
for (Group group : new_groups) {
|
||||
res.add(String.valueOf(group.id));
|
||||
names.add(group.description);
|
||||
}
|
||||
packedGroups = String.join("\n", res);
|
||||
groupsNames = String.join(";", names);
|
||||
groupsCount = new_groups.size();
|
||||
}
|
||||
public void saveTests(Vector<Test> new_tests) {
|
||||
Vector<String> res = new Vector<>();
|
||||
for (Test test : new_tests)
|
||||
res.add(String.valueOf(test.id));
|
||||
packedTests = String.join("\n", res);
|
||||
testsCount = new_tests.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import TestingSystem.Common.Group.GroupsDBTable;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.Test.TestDBTable;
|
||||
import TestingSystem.Common.TestingPackageToKill.TestingPackagesToKillDBTable;
|
||||
import TestingSystem.DVM.Configuration.DVMConfigurationDBTable;
|
||||
import TestingSystem.DVM.DVMConfiguration.DVMConfigurationDBTable;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackage;
|
||||
import TestingSystem.DVM.DVMPackage.DVMPackageDBTable;
|
||||
import TestingSystem.DVM.DVMTasks.DVMRunTasksSet;
|
||||
|
||||
Reference in New Issue
Block a user